我正在尝试在程序中进行webservice调用并将其部署在tomcat服务器中。但我收到错误“java.lang.NoClassDefFoundError:无法初始化类weblogic.wsee.jaxws.spi.WLSProvider”。但是这个类在weblogic.jar中可用,并且在tomcat / lib文件夹中也是如此。有关如何解决此异常的任何建议?
EVERE: Servlet.service() for servlet [test] in context with path [/VTM-Engg-UI] threw exception [Handler processing failed; nested exception is
**java.lang.NoClassDefFoundError: Could not initialize class weblogic.wsee.jaxws.spi.WLSProvider] with root causejava.lang.NoClassDefFoundError: Could not initialize class weblogic.wsee.jaxws.spi.WLSProvider**
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at java.lang.Class.newInstance0(Class.java:357)
at java.lang.Class.newInstance(Class.java:310)
at javax.xml.ws.spi.FactoryFinder.newInstance(FactoryFinder.java:31)
at javax.xml.ws.spi.FactoryFinder.find(FactoryFinder.java:90)
at javax.xml.ws.spi.Provider.provider(Provider.java:83)
at javax.xml.ws.Service.<init>(Service.java:56)
at com.onstar.vcs.services.ws.ProcessVehicleTask.<init>(ProcessVehicleTask.java:42)
at com.onstar.vtm.manager.GetTaskWs.getTask(GetTaskWs.java:99)
at com.onstar.vtm.vehType.controller.VehTypeController.getGetTaskAttribute(VehTypeController.java:584)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 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.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:219)
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:132)
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:100)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:604)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:565)
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:80)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:923)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:852)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882)
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:778)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1041)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:603)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
at java.lang.Thread.run(Thread.java:662)`
答案 0 :(得分:2)
可能存在一些可能性。
应用程序无法访问tomcat / lib / weblogic.jar文件。可能不是在应用程序类路径中。
可能有多个包含weblogic.wsee.jaxws.spi.WLSProvider的jar文件,这可能会造成问题。
检查包名称的完整类名。有时,jar文件的版本也可能是个问题。
可能是WLSProvider没有正确初始化。如果您查看日志中的完整堆栈跟踪并查看所有错误,则可能存在指向其初始化的错误。类似的问题在JavaRanch上发布了很长时间 - http://www.coderanch.com/t/582814/BEA-Weblogic/initialize-class-weblogic-wsee-jaxws
深入挖掘日志文件,看看是否有更多错误。可能是在加载此类之前需要加载其他内容,并且可能未正确加载。
尝试配对编程。如果你能让同伴看到你的问题,他们可能会看到你可能错过的东西。很多时候两个头比一个好!
祝你好运。