2 qq 29878685 qq_29878685 于 2017.09.18 09:31 提问

webservice问题,报错,求大神帮忙

图片说明图片说明图片说明
我是用JDK的wsimport方式创建的webservice,写个简单的字段,测试没有问题,但是服务端一操作数据库就报错500了。不清楚原因,用的springmvc,mybatis
难道还需要配置其他东西吗?求大神帮忙,

4个回答

qq_33727653
qq_33727653   2017.09.18 09:49
已采纳

楼主的DatacentMiddleClient这个类的第8行是不是save的那一行?里面是什么代码? 为啥报异常,楼主仔细看看代码!!!!

qq_29878685
qq_29878685 已经修改好了。改用jdbc操作数据库就可以了,不知道为啥什么
2 个月之前 回复
qq_33727653
qq_33727653 第7行没有得到df这个对象!!!
2 个月之前 回复
qq_29878685
qq_29878685 UsersMapper.insertSelective(td);这就是mapper类调用sql啊。我用的mybatis
2 个月之前 回复
vane11
vane11   2017.09.18 09:38

如果服务端有错的话,应该吧 服务端错误贴出来

qq_29878685
qq_29878685 注入和webservice都应该是不正确的?可是哪里错了呢,我这第一次用,下面是我贴的错误,现在已经不是500了
2 个月之前 回复
vane11
vane11 网速慢,就刷出一张图,题主见谅。服务端代码有问题,注入和webservice都应该是不正确的
2 个月之前 回复
r562253897
r562253897   2017.09.18 09:53

首先看到500状态码,应该是服务端异常,需要看服务端日志定位是服务端代码问题,或者是你传入的参数导致了服务端异常。

qq_29878685
qq_29878685 现在解决500的错了。报错在楼下,麻烦帮忙看一下
2 个月之前 回复
qq_29878685
qq_29878685   2017.09.18 13:29

```九月 18, 2017 12:21:38 下午 com.sun.xml.internal.ws.server.sei.TieHandler createResponse
严重: null
java.lang.NullPointerException
at com.bjhnd.Service.DatacenterMiddle.DatacenterMiddle.save(DatacenterMiddle.java:23)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:71)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:275)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at com.sun.xml.internal.ws.api.server.MethodUtil.invoke(MethodUtil.java:68)
at com.sun.xml.internal.ws.api.server.InstanceResolver$1.invoke(InstanceResolver.java:235)
at com.sun.xml.internal.ws.server.InvokerTube$2.invoke(InvokerTube.java:134)
at com.sun.xml.internal.ws.server.sei.SEIInvokerTube.processRequest(SEIInvokerTube.java:73)
at com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Fiber.java:1121)
at com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Fiber.java:1035)
at com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Fiber.java:1004)
at com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Fiber.java:862)
at com.sun.xml.internal.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:404)
at com.sun.xml.internal.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:706)
at com.sun.xml.internal.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:260)
at com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handleExchange(WSHttpHandler.java:98)
at com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handle(WSHttpHandler.java:82)
at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:79)
at sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:83)
at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:82)
at sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:675)
at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:79)
at sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:647)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)

九月 18, 2017 12:21:38 下午 com.sun.xml.internal.ws.transport.http.HttpAdapter$HttpToolkit handle
严重: Unknown JAXBContext implementation: class com.sun.xml.bind.v2.runtime.JAXBContextImpl
com.sun.xml.internal.ws.spi.db.DatabindingException: Unknown JAXBContext implementation: class com.sun.xml.bind.v2.runtime.JAXBContextImpl
at com.sun.xml.internal.ws.spi.db.BindingContextFactory.getJAXBFactory(BindingContextFactory.java:192)
at com.sun.xml.internal.ws.spi.db.BindingContextFactory.create(BindingContextFactory.java:134)
at com.sun.xml.internal.ws.message.jaxb.JAXBMessage.create(JAXBMessage.java:152)
at com.sun.xml.internal.ws.fault.SOAPFaultBuilder.createSOAP11Fault(SOAPFaultBuilder.java:424)
at com.sun.xml.internal.ws.fault.SOAPFaultBuilder.createSOAPFaultMessage(SOAPFaultBuilder.java:201)
at com.sun.xml.internal.ws.fault.SOAPFaultBuilder.createSOAPFaultMessage(SOAPFaultBuilder.java:189)
at com.sun.xml.internal.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:411)
at com.sun.xml.internal.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:706)
at com.sun.xml.internal.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:260)
at com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handleExchange(WSHttpHandler.java:98)
at com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handle(WSHttpHandler.java:82)
at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:79)
at sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:83)
at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:82)
at sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:675)
at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:79)
at sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:647)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)


warmcore
warmcore 楼主,你的DatacenterMiddle 23行是啥,上面那张图片里的23行啥都没有
2 个月之前 回复
Csdn user default icon
上传中...
上传图片
插入图片