我有我在GlassFish 3.我設置了一個MySQL數據庫連接池,我的數據庫位於同一臺服務器被作爲GlassFish上部署Java Web服務。Web服務將無法連接到數據庫
如果我從管理控制檯ping數據庫,它將會成功,但是當我嘗試運行我的Web服務並測試它時,它具有數據庫集的位置以及它的用戶名和密碼,它將無法連接。這裏的錯誤我得到測試時:在org.glassfish.webservices java.lang.reflect.InvocationTargetException在org.glassfish.webservices.monitoring.WebServiceTesterServlet.doPost(WebServiceTesterServlet.java:326):
javax.servlet.ServletException .javax.servlet.http.HttpServlet.service(HttpServlet.java:754)上的org.glassfish.webservices.JAXWSServlet.doPost(JAXWSServlet.java:137)上的.monitoring.WebServiceTesterServlet.invoke(WebServiceTesterServlet.java:102)。 servlet.http.HttpServlet.service(HttpServlet.java:847)at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1523)at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java: 279)在org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:188)在org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:641)在com.sun.enterprise.w eb.WebPipeline.invoke(WebPipeline.java:97)at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:85)at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:185)在org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:325)在org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:226)在com.sun.enterprise.v3.services.impl .ContainerMapper.service(ContainerMapper.java:165)at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:791)at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:693)at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:954)at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:170)at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain。 java:135)at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:102)at com.sun.grizzly.DefaultProtocolChain.exe com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76)com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:53)com.sun.grizzly上的可愛(DefaultProtocolChain.java:88) .SelectionKeyContextTask.call(SelectionKeyContextTask.java:57)at com.sun.grizzly.ContextTask.run(ContextTask.java:69)at com.sun.grizzly.util.AbstractThreadPool $ Worker.doWork(AbstractThreadPool.java:330)at在sun.reflect java.lang.reflect.InvocationTargetException:com.sun.grizzly.util.AbstractThreadPool $ Worker.run(AbstractThreadPool.java:309)在java.lang.Thread.run(Thread.java:662)引起的。在sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)上的NativeMethodAccessorImpl.invoke0(Native方法)位於java.lang.reflect.Method.invoke(Method。 java:597)at org.glassfish.webservices.monitoring.WebServiceTesterServlet.doPost(WebServiceTesterServlet.java:297)... 28 more javax.xml.ws.soap.SOAPFaultException:在com.sun.xml.ws.fault顯示java.lang.NullPointerException在com.sun.xml.ws.fault.SOAP11Fault.getProtocolException(SOAP11Fault.java:189)所致。 SOAPFaultBuilder.createException(SOAPFaultBuilder.java:130)at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:119)at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke( SyncMethodHandler.java:89)位於$ Proxy255.verifyUserAccount(未知源)的com.sun.xml.ws.client.sei.SEIStub.invoke(SEIStub.java:140)... 33更多原因:java.lang。在Sun.reflect.NativeMethodAccessorImpl.invoke0(本地方法)上的WebService.SocialServerWS.VerifyUserAccount(SocialServerWS.java:148)上的ManagersBD.UserManager.verifyUserAccount(UserManager.java:153)處的NullPointerException(位於sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl。 java:39)at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)at java.lang.reflect.Method.invoke(Method.java:597)at org。 glassfish.webservices.InstanceResolverImpl $ 1.invoke(InstanceResolverImpl.java:137)在com.sun.xml.ws.server.InvokerTube $ 2.invoke(InvokerTube.java:146)在com.sun.xml.ws.server.sei。 EndpointMethodHandler.invoke(EndpointMethodHandler.java:257)at com.sun.xml.ws.server.sei.SEIInvokerTube.processRequest(SEIInvokerTube.java:95)at com.sun.xml.ws.api.pipe.Fiber .__ doRun(纖維。java:629)at com.sun.xml.ws.api.pipe.Fiber。 doRun(Fiber.java:588)at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:573)at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber .java:470)at com.sun.xml.ws.api.pipe.helper.AbstractTubeImpl.process(AbstractTubeImpl.java:112)at org.glassfish.webservices.MonitoringPipe.process(MonitoringPipe.java:138)at com。在com.sun.xml.ws.api.pipe.Fiber上的sun.xml.ws.api.pipe.helper.PipeAdapter.processRequest(PipeAdapter.java:115)。_doRun(Fiber.java:629)at com.sun.xml.ws.api.pipe.Fiber。 doRun(Fiber.java:588)at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:573)at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber .java:470)at com.sun.xml.ws.api.pipe.helper.AbstractTubeImpl.process(AbstractTubeImpl.java:112)at com.sun.enterprise.security.webservices.CommonServerSecurityPipe.processRequest(CommonServerSecurityPipe.java:195 )at com.sun.enterprise.security.webservices.CommonServerSecurityPipe.process(CommonServerSecurityPipe.java:127)at com.sun.xml.ws.api.pipe.helper.PipeAdapter.processRequest(PipeAdapter.java:115)at com。 sun.xml.ws.api.pipe.Fiber。_doRun(Fiber.java:629)at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:588)at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber .java:573)at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:470)at com.sun.xml.ws.server.WSEndpointImpl $ 2.process(WSEndpointImpl.java:295)在com.sun.xml.ws.transport.http.HttpAdapter $ HttpToolkit.handle(HttpAdapter.java:519)在com.sun.xml.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:288)在COM .sun.xml.ws.transport.http.servlet.ServletAdapter.handle(ServletAdapter.java:143)at org.glassfish.webservices.JAXWSServlet.doPost(JAXWSServlet.java:149)... 26更多
我現在有這個問題,你是如何解決它的? – 2015-11-09 13:01:09