java Wildfly Undertow 请求在 Web 服务上失败 HttpServerExchange

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/29517553/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-11-02 15:24:27  来源:igfitidea点击:

Wildfly Undertow request failed HttpServerExchange on Webservice

javaweb-serviceswildflyundertow

提问by monimo

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.

我正在尝试访问在我的 Wildfly 实例上运行的网络服务。Web 服务被注释为 Post 并接受 JSON。当我尝试调用该服务时,Wildfly 会抛出 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.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.

我真的不明白是什么引起了 Nullpointerexception,因为我对 Wildfly 开发不是很熟悉。