4 Replies Latest reply on Jun 7, 2012 8:55 PM by spyhunter99

    Call web service in JBoss server A which call another web service in JBoss server B

    xujin_helen

      Hi,

       

      I encountered some JBoss web service issue, and hope I can get some help here from some JBoss expert.

       

      We have vendor's software installed on JBoss EAP 5.0.0 (this is the latest version they support, so we can't install any newer version of JBoss). Then we have our own web service installed on another JBoss EAP 5.0.0 which invoke vendor's web service. So both JBoss versions are exactly same.

       

      Client => our web service on JBoss EAP 5.0.0 => vendor's web service on another JBoss EAP 5.0.0

       

      1. There is no issue for a standalone Java application to invoke vendor's proxy which invoke vender's web service.

      2. There is no problem when I create a simple operation (@WebMethod) in our web service. This is used to verify our web service war file is working.

      3. However, when I create a new operation that invoke vender's web service, it has problem. I am using eclipse Helios 32 bit with JBoss 5.0 Runtime Server setup inside eclipse (jdk1.6.0_20).

       

      Vendor provides us a list of libraries that include

      a) many libraries from JBoss client folder

      b) vendor's proxy library which ease us to invoke vendor's web service.

      c) several other libraries.

       

      3.1 If I only configure libraries of b) and c) at JBoss server Classpath, it will throws below exception, and I know this class is in jbossws-native-core.jar which is located at JBoss client folder.

       

      3.2 If I configure all libraries of a), b), and c), then I can't start JBoss from eclipse. Please see errors from attached file.

       

      2012-06-07 13:55:36,599 ERROR [STDERR] (http-localhost%2F127.0.0.1-8080-1) java.lang.NoClassDefFoundError: org/jboss/ws/jaxrpc/ServiceFactoryImpl

      2012-06-07 13:55:36,599 ERROR [STDERR] (http-localhost%2F127.0.0.1-8080-1)  at com.datasweep.plantops.proxies.jboss.soapImpl.SecuritySOAPImpl._login(Unknown Source)

      2012-06-07 13:55:36,599 ERROR [STDERR] (http-localhost%2F127.0.0.1-8080-1)  at com.datasweep.plantops.proxies.ProxyFactory.getSecurityProxy(Unknown Source)

      2012-06-07 13:55:36,599 ERROR [STDERR] (http-localhost%2F127.0.0.1-8080-1)  at com.datasweep.plantops.proxies.ProxyFactory.login(Unknown Source)

      2012-06-07 13:55:36,599 ERROR [STDERR] (http-localhost%2F127.0.0.1-8080-1)  at com.aligntech.service.MyService.connectFTPC90(MyService.java:77)

      2012-06-07 13:55:36,599 ERROR [STDERR] (http-localhost%2F127.0.0.1-8080-1)  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

      2012-06-07 13:55:36,599 ERROR [STDERR] (http-localhost%2F127.0.0.1-8080-1)  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

      2012-06-07 13:55:36,599 ERROR [STDERR] (http-localhost%2F127.0.0.1-8080-1)  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

      2012-06-07 13:55:36,599 ERROR [STDERR] (http-localhost%2F127.0.0.1-8080-1)  at java.lang.reflect.Method.invoke(Method.java:597)

      2012-06-07 13:55:36,599 ERROR [STDERR] (http-localhost%2F127.0.0.1-8080-1)  at org.jboss.wsf.container.jboss50.invocation.InvocationHandlerJSE.invoke(InvocationHandlerJSE.java:108)

      2012-06-07 13:55:36,599 ERROR [STDERR] (http-localhost%2F127.0.0.1-8080-1)  at org.jboss.ws.core.server.ServiceEndpointInvoker.invoke(ServiceEndpointInvoker.java:221)

      2012-06-07 13:55:36,599 ERROR [STDERR] (http-localhost%2F127.0.0.1-8080-1)  at org.jboss.wsf.stack.jbws.RequestHandlerImpl.processRequest(RequestHandlerImpl.java:468)

      2012-06-07 13:55:36,599 ERROR [STDERR] (http-localhost%2F127.0.0.1-8080-1)  at org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleRequest(RequestHandlerImpl.java:293)

      2012-06-07 13:55:36,599 ERROR [STDERR] (http-localhost%2F127.0.0.1-8080-1)  at org.jboss.wsf.stack.jbws.RequestHandlerImpl.doPost(RequestHandlerImpl.java:203)

      2012-06-07 13:55:36,599 ERROR [STDERR] (http-localhost%2F127.0.0.1-8080-1)  at org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleHttpRequest(RequestHandlerImpl.java:129)

      2012-06-07 13:55:36,599 ERROR [STDERR] (http-localhost%2F127.0.0.1-8080-1)  at org.jboss.wsf.common.servlet.AbstractEndpointServlet.service(AbstractEndpointServlet.java:85)

      2012-06-07 13:55:36,599 ERROR [STDERR] (http-localhost%2F127.0.0.1-8080-1)  at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

      2012-06-07 13:55:36,599 ERROR [STDERR] (http-localhost%2F127.0.0.1-8080-1)  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)

      2012-06-07 13:55:36,599 ERROR [STDERR] (http-localhost%2F127.0.0.1-8080-1)  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

      2012-06-07 13:55:36,599 ERROR [STDERR] (http-localhost%2F127.0.0.1-8080-1)  at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)

      2012-06-07 13:55:36,599 ERROR [STDERR] (http-localhost%2F127.0.0.1-8080-1)  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

      2012-06-07 13:55:36,599 ERROR [STDERR] (http-localhost%2F127.0.0.1-8080-1)  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

      2012-06-07 13:55:36,599 ERROR [STDERR] (http-localhost%2F127.0.0.1-8080-1)  at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)

      2012-06-07 13:55:36,599 ERROR [STDERR] (http-localhost%2F127.0.0.1-8080-1)  at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)

      2012-06-07 13:55:36,599 ERROR [STDERR] (http-localhost%2F127.0.0.1-8080-1)  at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)

      2012-06-07 13:55:36,599 ERROR [STDERR] (http-localhost%2F127.0.0.1-8080-1)  at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)

      2012-06-07 13:55:36,599 ERROR [STDERR] (http-localhost%2F127.0.0.1-8080-1)  at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)

      2012-06-07 13:55:36,599 ERROR [STDERR] (http-localhost%2F127.0.0.1-8080-1)  at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)

      2012-06-07 13:55:36,599 ERROR [STDERR] (http-localhost%2F127.0.0.1-8080-1)  at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)

      2012-06-07 13:55:36,599 ERROR [STDERR] (http-localhost%2F127.0.0.1-8080-1)  at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)

      2012-06-07 13:55:36,599 ERROR [STDERR] (http-localhost%2F127.0.0.1-8080-1)  at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)

      2012-06-07 13:55:36,599 ERROR [STDERR] (http-localhost%2F127.0.0.1-8080-1)  at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

      2012-06-07 13:55:36,599 ERROR [STDERR] (http-localhost%2F127.0.0.1-8080-1)  at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)

      2012-06-07 13:55:36,599 ERROR [STDERR] (http-localhost%2F127.0.0.1-8080-1)  at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)

      2012-06-07 13:55:36,599 ERROR [STDERR] (http-localhost%2F127.0.0.1-8080-1)  at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)

      2012-06-07 13:55:36,599 ERROR [STDERR] (http-localhost%2F127.0.0.1-8080-1)  at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)

      2012-06-07 13:55:36,599 ERROR [STDERR] (http-localhost%2F127.0.0.1-8080-1)  at java.lang.Thread.run(Thread.java:619)

      2012-06-07 13:55:36,599 ERROR [STDERR] (http-localhost%2F127.0.0.1-8080-1) Caused by: java.lang.ClassNotFoundException: org.jboss.ws.jaxrpc.ServiceFactoryImpl

      2012-06-07 13:55:36,599 ERROR [STDERR] (http-localhost%2F127.0.0.1-8080-1)  at java.net.URLClassLoader$1.run(URLClassLoader.java:202)

      2012-06-07 13:55:36,599 ERROR [STDERR] (http-localhost%2F127.0.0.1-8080-1)  at java.security.AccessController.doPrivileged(Native Method)

      2012-06-07 13:55:36,599 ERROR [STDERR] (http-localhost%2F127.0.0.1-8080-1)  at java.net.URLClassLoader.findClass(URLClassLoader.java:190)

      2012-06-07 13:55:36,599 ERROR [STDERR] (http-localhost%2F127.0.0.1-8080-1)  at java.lang.ClassLoader.loadClass(ClassLoader.java:307)

      2012-06-07 13:55:36,599 ERROR [STDERR] (http-localhost%2F127.0.0.1-8080-1)  at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)

      2012-06-07 13:55:36,599 ERROR [STDERR] (http-localhost%2F127.0.0.1-8080-1)  at java.lang.ClassLoader.loadClass(ClassLoader.java:248)

      2012-06-07 13:55:36,599 ERROR [STDERR] (http-localhost%2F127.0.0.1-8080-1)  ... 36 more

       

      Thanks in advance,

       

      Jin

        • 1. Re: Call web service in JBoss server A which call another web service in JBoss server B
          spyhunter99

          Honestly, I've never had much luck running a web server from inside of an IDE.

           

          Start with the out of the box jboss eap 5, no modifications

           

          I vote for building your war, deploying it and testing. JbossWS and other server libraries do not need to be added to the classpath nor to your war for operation.

           

          If necessary, you can enable debugging on the server so that you can attach the IDE's debugger to jboss. See run.conf or run.conf.bat

          1 of 1 people found this helpful
          • 2. Re: Call web service in JBoss server A which call another web service in JBoss server B
            xujin_helen

            Thanks for the tip.

             

            I manually deployed war and started JBoss. When I invoke our web service, it throws below error, which means it is already inside our web service. It looks like vendor's proxy failed to invoke its web service. But when in standalone mode, it worked.

             

            2012-06-07 17:00:20,895 ERROR [STDERR] (http-0.0.0.0-8080-1) java.lang.LinkageError: loader constraint violation: when resolving method "org.jboss.ws.jaxrpc.ServiceFactoryImpl.createService(Ljava/net/URL;Ljavax/xml/namespace/QName;Ljava/net/URL;)Ljavax/xml/rpc/Service;" the class loader (instance of org/jboss/classloader/spi/base/BaseClassLoader) of the current class, com/datasweep/plantops/proxies/jboss/soapImpl/SecuritySOAPImpl, and the class loader (instance of org/jboss/classloader/spi/base/BaseClassLoader) for resolved class, org/jboss/ws/jaxrpc/ServiceFactoryImpl, have different Class objects for the type javax/xml/namespace/QName used in the signature
            2012-06-07 17:00:20,895 ERROR [STDERR] (http-0.0.0.0-8080-1)  at com.datasweep.plantops.proxies.jboss.soapImpl.SecuritySOAPImpl._login(Unknown Source)
            2012-06-07 17:00:20,895 ERROR [STDERR] (http-0.0.0.0-8080-1)  at com.datasweep.plantops.proxies.ProxyFactory.getSecurityProxy(Unknown Source)
            2012-06-07 17:00:20,895 ERROR [STDERR] (http-0.0.0.0-8080-1)  at com.datasweep.plantops.proxies.ProxyFactory.login(Unknown Source)
            2012-06-07 17:00:20,895 ERROR [STDERR] (http-0.0.0.0-8080-1)  at com.aligntech.service.MyService.connectFTPC90(MyService.java:77)
            2012-06-07 17:00:20,911 ERROR [STDERR] (http-0.0.0.0-8080-1)  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            2012-06-07 17:00:20,911 ERROR [STDERR] (http-0.0.0.0-8080-1)  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
            2012-06-07 17:00:20,911 ERROR [STDERR] (http-0.0.0.0-8080-1)  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            2012-06-07 17:00:20,911 ERROR [STDERR] (http-0.0.0.0-8080-1)  at java.lang.reflect.Method.invoke(Method.java:597)
            2012-06-07 17:00:20,911 ERROR [STDERR] (http-0.0.0.0-8080-1)  at org.jboss.wsf.container.jboss50.invocation.InvocationHandlerJSE.invoke(InvocationHandlerJSE.java:108)
            2012-06-07 17:00:20,911 ERROR [STDERR] (http-0.0.0.0-8080-1)  at org.jboss.ws.core.server.ServiceEndpointInvoker.invoke(ServiceEndpointInvoker.java:221)
            2012-06-07 17:00:20,911 ERROR [STDERR] (http-0.0.0.0-8080-1)  at org.jboss.wsf.stack.jbws.RequestHandlerImpl.processRequest(RequestHandlerImpl.java:468)
            2012-06-07 17:00:20,911 ERROR [STDERR] (http-0.0.0.0-8080-1)  at org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleRequest(RequestHandlerImpl.java:293)
            2012-06-07 17:00:20,911 ERROR [STDERR] (http-0.0.0.0-8080-1)  at org.jboss.wsf.stack.jbws.RequestHandlerImpl.doPost(RequestHandlerImpl.java:203)
            2012-06-07 17:00:20,911 ERROR [STDERR] (http-0.0.0.0-8080-1)  at org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleHttpRequest(RequestHandlerImpl.java:129)
            2012-06-07 17:00:20,911 ERROR [STDERR] (http-0.0.0.0-8080-1)  at org.jboss.wsf.common.servlet.AbstractEndpointServlet.service(AbstractEndpointServlet.java:85)
            2012-06-07 17:00:20,911 ERROR [STDERR] (http-0.0.0.0-8080-1)  at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
            2012-06-07 17:00:20,911 ERROR [STDERR] (http-0.0.0.0-8080-1)  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
            2012-06-07 17:00:20,911 ERROR [STDERR] (http-0.0.0.0-8080-1)  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
            2012-06-07 17:00:20,911 ERROR [STDERR] (http-0.0.0.0-8080-1)  at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
            2012-06-07 17:00:20,911 ERROR [STDERR] (http-0.0.0.0-8080-1)  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
            2012-06-07 17:00:20,911 ERROR [STDERR] (http-0.0.0.0-8080-1)  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
            2012-06-07 17:00:20,926 ERROR [STDERR] (http-0.0.0.0-8080-1)  at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
            2012-06-07 17:00:20,926 ERROR [STDERR] (http-0.0.0.0-8080-1)  at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
            2012-06-07 17:00:20,926 ERROR [STDERR] (http-0.0.0.0-8080-1)  at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
            2012-06-07 17:00:20,926 ERROR [STDERR] (http-0.0.0.0-8080-1)  at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
            2012-06-07 17:00:20,926 ERROR [STDERR] (http-0.0.0.0-8080-1)  at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
            2012-06-07 17:00:20,926 ERROR [STDERR] (http-0.0.0.0-8080-1)  at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
            2012-06-07 17:00:20,926 ERROR [STDERR] (http-0.0.0.0-8080-1)  at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
            2012-06-07 17:00:20,926 ERROR [STDERR] (http-0.0.0.0-8080-1)  at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
            2012-06-07 17:00:20,926 ERROR [STDERR] (http-0.0.0.0-8080-1)  at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
            2012-06-07 17:00:20,926 ERROR [STDERR] (http-0.0.0.0-8080-1)  at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
            2012-06-07 17:00:20,926 ERROR [STDERR] (http-0.0.0.0-8080-1)  at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
            2012-06-07 17:00:20,926 ERROR [STDERR] (http-0.0.0.0-8080-1)  at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
            2012-06-07 17:00:20,926 ERROR [STDERR] (http-0.0.0.0-8080-1)  at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)
            2012-06-07 17:00:20,926 ERROR [STDERR] (http-0.0.0.0-8080-1)  at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
            2012-06-07 17:00:20,926 ERROR [STDERR] (http-0.0.0.0-8080-1)  at java.lang.Thread.run(Thread.java:619)
            2012-06-07 17:00:20,942 ERROR [org.jboss.ws.core.jaxws.SOAPFaultHelperJAXWS] (http-0.0.0.0-8080-1) SOAP request exception

            Thanks,

             

            Jin

            • 3. Re: Call web service in JBoss server A which call another web service in JBoss server B
              xujin_helen

              I found this link (https://community.jboss.org/thread/103479) which has similar/same issue as me. That link suggests to download new web service library http://www.jboss.org/jbossws/downloads/.

               

              Now my question is which version of the library I should download. There are JBossWS-CXF, JBossWS-Native, JBossWS-Metro. I guess I should download JBossWS-Native since I am using JBoss EAP

              5.0.0.

               

              Thanks,

               

              Jin

              • 4. Re: Call web service in JBoss server A which call another web service in JBoss server B
                spyhunter99

                The redhat folks on here cringe when anyone brings this up. You're not suppose to mix community and enterprise jboss components. Since you have to use EAP, see if there are any EAP updates that are applicable.

                 

                It's not clear where your stack trace came from, the server hosting your service, or the vendors. Regardless, the ye ole' linker error is a class loading issue. It's telling you that there's an extra library somewhere that not suppose to be there. Look for anything releated to jax-b in the WEB-INF/lib of your app and remove it