java.lang.NoClassDefFoundError:com / sun / tools / apt / Main

时间:2019-07-03 06:26:52

标签: java web-services servlets annotations jax-ws

使用注释生成WSDL时出现错误。

我不知道为什么在运行项目时会产生此错误。

我主要是得到这个: java.lang.NoClassDefFoundError:com / sun / tools / apt / Main

在控制台上:

javax.xml.ws.WebServiceException: Error occurred generating WSDL file for Web service implementation class {serviceimplementation.TCUtil}
        org.apache.axis2.jaxws.description.builder.JAXWSRIWSDLGenerator.generateWsdl(JAXWSRIWSDLGenerator.java:198)
        org.apache.axis2.jaxws.description.builder.JAXWSRIWSDLGenerator.initialize(JAXWSRIWSDLGenerator.java:389)
        org.apache.axis2.jaxws.description.builder.JAXWSRIWSDLGenerator.getWSDL(JAXWSRIWSDLGenerator.java:382)
        org.apache.axis2.jaxws.description.builder.JAXWSRIWSDLGenerator.getWSDL(JAXWSRIWSDLGenerator.java:86)
        org.apache.axis2.description.AxisService.printWSDL(AxisService.java:1474)
        org.apache.axis2.transport.http.ListingAgent.handleWSDLRequest(ListingAgent.java:313)
        org.apache.axis2.transport.http.ListingAgent.processListService(ListingAgent.java:185)
        org.apache.axis2.transport.http.AxisServlet.doGet(AxisServlet.java:277)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:622)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
        org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    java.lang.reflect.InvocationTargetException
        sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        java.lang.reflect.Method.invoke(Unknown Source)
        org.apache.axis2.jaxws.description.builder.JAXWSRIWSDLGenerator.generateWsdl(JAXWSRIWSDLGenerator.java:184)
        org.apache.axis2.jaxws.description.builder.JAXWSRIWSDLGenerator.initialize(JAXWSRIWSDLGenerator.java:389)
        org.apache.axis2.jaxws.description.builder.JAXWSRIWSDLGenerator.getWSDL(JAXWSRIWSDLGenerator.java:382)
        org.apache.axis2.jaxws.description.builder.JAXWSRIWSDLGenerator.getWSDL(JAXWSRIWSDLGenerator.java:86)
        org.apache.axis2.description.AxisService.printWSDL(AxisService.java:1474)
        org.apache.axis2.transport.http.ListingAgent.handleWSDLRequest(ListingAgent.java:313)
        org.apache.axis2.transport.http.ListingAgent.processListService(ListingAgent.java:185)
        org.apache.axis2.transport.http.AxisServlet.doGet(AxisServlet.java:277)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:622)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
        org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)


    root cause
    java.lang.NoClassDefFoundError: com/sun/tools/apt/Main
        com.sun.tools.ws.wscompile.WsgenTool.buildModel(WsgenTool.java:194)
        com.sun.tools.ws.wscompile.WsgenTool.run(WsgenTool.java:119)
        com.sun.tools.ws.util.WSToolsObjectFactoryImpl.wsgen(WSToolsObjectFactoryImpl.java:61)
        com.sun.tools.ws.spi.WSToolsObjectFactory.wsgen(WSToolsObjectFactory.java:107)
        sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        java.lang.reflect.Method.invoke(Unknown Source)
        org.apache.axis2.jaxws.description.builder.JAXWSRIWSDLGenerator.generateWsdl(JAXWSRIWSDLGenerator.java:184)
        org.apache.axis2.jaxws.description.builder.JAXWSRIWSDLGenerator.initialize(JAXWSRIWSDLGenerator.java:389)
        org.apache.axis2.jaxws.description.builder.JAXWSRIWSDLGenerator.getWSDL(JAXWSRIWSDLGenerator.java:382)
        org.apache.axis2.jaxws.description.builder.JAXWSRIWSDLGenerator.getWSDL(JAXWSRIWSDLGenerator.java:86)
        org.apache.axis2.description.AxisService.printWSDL(AxisService.java:1474)
        org.apache.axis2.transport.http.ListingAgent.handleWSDLRequest(ListingAgent.java:313)
        org.apache.axis2.transport.http.ListingAgent.processListService(ListingAgent.java:185)`enter code here`
        org.apache.axis2.transport.http.AxisServlet.doGet(AxisServlet.java:277)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:622)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
        org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

如何解决这个问题?

谢谢。

0 个答案:

没有答案