2

I am trying to reach a webservice running on my Wildfly instance. The webservice is annotated as Post and accepts JSON. When I try to call the service, my Wildfly throws an Nullpointerexception.

The actual stack trace looks like this:

15:23:40,324 ERROR [io.undertow.request] (default task-1) Undertow request  failed HttpServerExchange{ POST <path to my service>}: java.lang.NullPointerException
at io.undertow.servlet.spec.ServletInputStreamImpl.readIntoBuffer(ServletInputStreamImpl.java:171)
at io.undertow.servlet.spec.ServletInputStreamImpl.close(ServletInputStreamImpl.java:245)
at io.undertow.servlet.spec.HttpServletRequestImpl.closeAndDrainRequest(HttpServletRequestImpl.java:602)
at io.undertow.servlet.core.ServletBlockingHttpExchange.close(ServletBlockingHttpExchange.java:87)
at io.undertow.server.HttpServerExchange.endExchange(HttpServerExchange.java:1444)
at io.undertow.server.Connectors.executeRootHandler(Connectors.java:213)
at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:759)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_75]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_75]
at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_75]

I don't really understand what evoked a Nullpointerexception as I am not very familiar with Wildfly development.

monimo
  • 21
  • 1
  • 1
  • 4
  • Without your sample request and your service implementation, it's difficult to tell what's happening. – kolossus Apr 09 '15 at 18:47
  • We had the issue when sending an JSON object in the POST request which was not present on the backend Java class signature that was invoked on the Api call. Strangely though, the issue just appears when proxying through our node connect-proxy which we use in dev (for our Angular app). I'm investigating..if I find the reason I'll post it here – Juri Apr 14 '15 at 14:45
  • 1
    Sorry for my slow response, it was quite a dumb error because we forgot to put the ApplicationPath in the URL. Anyway thank you very much for your responses! – monimo Apr 15 '15 at 08:28

1 Answers1

3

It seems to be WildFly defect: UNDERTOW-367: NullPointerException when POST method has no ordinary parameters

Felix
  • 3,999
  • 3
  • 42
  • 66