jeudi 26 février 2015

how to import a .JAR file in the "/dist" folder of a Java Application project in netbeans to eclipse

i have a spring mvc project in eclipe spring tools suite IDE and i wanted to add some classes from a WSDL, i try using maven-jaxb2-plugin but it dont do nothing when i update my project using maven. So i try to create a web service client in eclipse and in the service definition i put my WSDL url but after a few seconds loading it gives me a Invalid segment definition, after all this i try creating a Java Application Project in Netbeans and then add a web services client in that project with my WSDL url this time it worked!, so i try to add the .JAR file of that project that locates in D:/Users/myUser/Documents/NetBeansProjects/ImportClassesFromWSDL/dist/ImportClassesFromWSDL.jar


i added this jar as a external JAR following this steps How to import a jar in Eclipse , the .JAR was added but i have this warning Classpath entry D:/Users/myUser/Documents/NetBeansProjects/ImportClassesFromWSDL/dist/ImportClassesFromWSDL.jar will not be exported or published. Runtime ClassNotFoundExceptions may result. WSproject P/WSproject Classpath Dependency Validator Message in the eclipse text editor i can write with no problems the name of the classes and create objects of this classes with no problem, but at the moment when i run my project and get to the part when i create this objects from the imported classes i get a class not found exception


HTTP 500 - Handler processing failed; nested exception is java.lang.NoClassDefFoundError: mycompany/myws/myschema/myClassWs



: Servlet.service() servlet [appServlet] [/app] [Handler processing failed; nested exception is java.lang.NoClassDefFoundError: mycompany/myws/myschema/myClassWs] java.lang.ClassNotFoundException: mycompany/myws/myschema/myClassWs
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1720)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1571)
at com.pruebaWsCompany.app.HomeController.myWsPage(HomeController.java:54)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:213)
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:126)
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:96)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:617)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:578)
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:620)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1040)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

Aucun commentaire:

Enregistrer un commentaire