1 2 Previous Next 19 Replies Latest reply on May 24, 2015 1:10 PM by ahmeddrira

    Moving to JBossWS-CXF in AS 6 Final

    asoldano

      Kuntal Mondal wrote on https://issues.jboss.org/browse/JBAS-8779 :

       

      Alessio - thanks a lot for responding to this issue. I am not using  anything very specific to  JBossWS-Metro and will be happy to use  JBossWS-CXF stack if it works. 
      Below here is my exception detail.

      I am using SpringSecurity (3.0.3) for user authentication/authorization. I have 2 WAR modules under EAR. 
      All the Spring libraries are placed within EAR/lib so that both of my WAR modules can access those. 
      With "Jboss6-Final" release I am getting following exception while  invoking web service. The complete stack trace has been attached - I  have specified the relevant portion here.

      =======================================
      11:04:05,769 ERROR [[/edm]] Servlet /edm threw load() exception:  java.lang.ClassNotFoundException:  org.springframework.beans.BeansException from BaseClassLoader@138847d{vfs:///C:/Workspace/DM1.0/dependencies/repository/jboss/jboss-6.0.0.Final/server/default/conf/jboss-service.xml}
               at org.jboss.classloader.spi.base.BaseClassLoader.loadClass(BaseClassLoader.java:480) [jboss-classloader.jar:2.2.0.GA]
               at java.lang.ClassLoader.loadClass(ClassLoader.java:248) [:1.6.0_23]
               at  org.jboss.wsf.stack.cxf.client.configuration.JBossWSBusFactory.getSpringBusFactory(JBossWSBusFactory.java:120)  [:3.4.1.GA]
               at org.jboss.wsf.stack.cxf.client.configuration.JBossWSBusFactory.createBus(JBossWSBusFactory.java:54) [:3.4.1.GA]
               at org.jboss.wsf.stack.cxf.client.ProviderImpl.createServiceDelegate(ProviderImpl.java:69) [:3.4.1.GA]
               at javax.xml.ws.Service.<init>(Service.java:57) [:1.0.0.Final]
               at com.towersoft.schema.webservice.trim2.Engine.<init>(Engine.java:42) [:]
               at com.im.server.edm.datasource.trim.TrimSession.createTrimSession(TrimSession.java:73) [:]
               at com.im.server.edm.datasource.trim.TrimDatasource.createSession(TrimDatasource.java:60) [:]
               at com.im.server.edm.datasource.trim.TrimDatasource.createSession(TrimDatasource.java:15) [:]
               at com.im.server.edm.datasource.SessionCache.acquire(SessionCache.java:34) [:]
               at com.im.server.edm.datasource.Datasource.openSession(Datasource.java:96) [:]
               at com.im.server.edm.buslogic.DatasourceBL.persistTrimCustomFields(DatasourceBL.java:186) [:]
               at com.im.server.edm.buslogic.InstallBL.createDatasources(InstallBL.java:211) [:]
               at com.im.server.edm.buslogic.InstallBL.createDevDatasources(InstallBL.java:172) [:]
               at com.im.server.edm.buslogic.InstallBL.initializeApplication(InstallBL.java:40) [:]
               at com.im.server.edm.ejb.ApplicationBean.initializeApplication(ApplicationBean.java:42) [:]
               at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_23]
               at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [:1.6.0_23]
               at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_23]
               at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_23]
      ==================================================
      I have no idea why "org.springframework.beans.BeansException" class has been referred from JBossWS-CXF library.
      Is it because I am using SpringSecurity??

      Since CXF libraries are under {JBOSS}\common\lib, those are loaded by  BaseClassLoaders - where as my Spring libraries are under EAR and loaded  by different classloader.

      After lot of trial and error ultimately I have found that if I place  following 8 Spring libraries (together with  aopalliance.jar) under  {JBOSS}\common\lib, I can avoid all Spring-class-not-found related  exceptions. These are:
      1) aopalliance.jar
      2) org.springframework.aop-3.0.3.RELEASE.jar
      3) org.springframework.asm-3.0.3.RELEASE.jar
      4) org.springframework.beans-3.0.3.RELEASE.jar
      5) org.springframework.context-3.0.3.RELEASE.jar
      6) org.springframework.context.support-3.0.3.RELEASE.jar
      7) org.springframework.core-3.0.3.RELEASE.jar
      8) org.springframework.expression-3.0.3.RELEASE.jar

      I have serious doubt why I have to keep these libs under  {JBOSS}\common\lib? - these are app-specific lib, so these should not be  placed under {JBOSS}\common\lib.
      But without these spring libs JBossWS-CXF always thorws exception. Can you "please" advise??
      Because of this reason last time (JBoss 6.0.0.CR1) I switched to "JBossWS-Metro".

      Now for webservice-invocation I also need to place following 3 additional libraries under {JBOSS}\common\lib. These are:
      1) commons-lang-2.5.jar
      2) saaj-api.jar
      3) saaj-impl.jar

      With these modification I was able to invoke my web services (at least 2 out of 3).

      I have to invoke webservice to 3 different web servers. Two of them are working with above configuration.
      For the 3rd one I am getting following error. Not sure it is related to  JBossWS-CXF library or not - but the server is up and I can access the  WSDL using browser.
      So I am at lost here.

      Any suggestion/advise will be very helpful.

      ====================================================================
      Caused by: javax.xml.ws.soap.SOAPFaultException: Can't find input stream in message
               at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:146) [:2.3.1]
               at $Proxy203.execute(Unknown Source)    at com.im.server.edm.datasource.trim.Sessionexecute(TrimSession.java:563) [:]
               at com.im.server.edm.datasource.trim.Sessionexecute(TrimSession.java:556) [:]
               at com.im.server.edm.datasource.trim.SessionrunQuery(TrimSession.java:144) [:]
               at com.im.server.edm.datasource.trim.SessionfetchMetadata(TrimSession.java:96) [:]
               at com.im.server.edm.datasource.DatasourceSession.runQuery(DatasourceSession.java:51) [:]
               at com.im.server.edm.buslogic.FederationBL.runQuery(FederationBL.java:99) [:]
               at com.im.server.edm.ejb.FederationBean.runQuery(FederationBean.java:50) [:]
               at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_23]
               at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [:1.6.0_23]
               at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_23]
               at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_23]
               at org.jboss.aop.joinpoint.MethodInvocation.invokeTarget(MethodInvocation.java:122) [jboss-aop.jar:2.2.1.GA]
               at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:111) [jboss-aop.jar:2.2.1.GA]
               at  org.jboss.ejb3.interceptors.container.ContainerMethodInvocationWrapper.invokeNext(ContainerMethodInvocationWrapper.java:72)  [:1.1.3]
               at org.jboss.ejb3.interceptors.aop.InterceptorSequencer.invoke(InterceptorSequencer.java:76) [:1.1.3]
               at org.jboss.ejb3.interceptors.aop.InterceptorSequencer.aroundInvoke(InterceptorSequencer.java:62) [:1.1.3]
               at sun.reflect.GeneratedMethodAccessor461.invoke(Unknown Source) [:1.6.0_23]
               at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_23]
               at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_23]
               at org.jboss.aop.advice.PerJoinpointAdvice.invoke(PerJoinpointAdvice.java:174) [jboss-aop.jar:2.2.1.GA]
               at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) [jboss-aop.jar:2.2.1.GA]
               at  org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor.fillMethod(InvocationContextInterceptor.java:74)  [:1.1.3]
               at  org.jboss.aop.advice.org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor_z_fillMethod_21583340.invoke(InvocationContextInterceptor_z_fillMethod_21583340.java)  [:]
               at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) [jboss-aop.jar:2.2.1.GA]
               at org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor.setup(InvocationContextInterceptor.java:90) [:1.1.3]
               at  org.jboss.aop.advice.org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor_z_setup_21583340.invoke(InvocationContextInterceptor_z_setup_21583340.java)  [:]
               at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) [jboss-aop.jar:2.2.1.GA]
               at  org.jboss.ejb3.async.impl.interceptor.AsynchronousServerInterceptor.invoke(AsynchronousServerInterceptor.java:128)  [:1.7.17]
               at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) [jboss-aop.jar:2.2.1.GA]
               at org.jboss.ejb3.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:62) [:1.7.17]
               at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) [jboss-aop.jar:2.2.1.GA]
               at  org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:56)  [:1.7.17]
               at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) [jboss-aop.jar:2.2.1.GA]
               at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47) [:1.7.17]
               at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) [jboss-aop.jar:2.2.1.GA]
               at org.jboss.ejb3.tx.StatelessBMTInterceptor.handleInvocation(StatelessBMTInterceptor.java:106) [:1.0.3]
               at org.jboss.ejb3.tx.BMTInterceptor.invoke(BMTInterceptor.java:55) [:1.0.3]
               at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) [jboss-aop.jar:2.2.1.GA]
               at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:68) [:1.7.17]
               at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) [jboss-aop.jar:2.2.1.GA]
               at  org.jboss.ejb3.core.context.SessionInvocationContextAdapter.proceed(SessionInvocationContextAdapter.java:95)  [:1.7.17]
               at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:247) [:0.0.1]
               ... 39 more
      Caused by: java.lang.RuntimeException: Can't find input stream in message
               at  org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:116)  [:2.3.1]
               at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:60) [:2.3.1]
               at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:255) [:2.3.1]
               at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:755) [:2.3.1]
               at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:2330) [:2.3.1]
               at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:2192) [:2.3.1]
               at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:2036) [:2.3.1]
               at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56) [:2.3.1]
               at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:696) [:2.3.1]
               at  org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)  [:2.3.1]
               at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:255) [:2.3.1]
               at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:516) [:2.3.1]
               at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:313) [:2.3.1]
               at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:265) [:2.3.1]
               at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73) [:2.3.1]
               at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:124) [:2.3.1]
               ... 82 more

        • 1. Re: Moving to JBossWS-CXF in AS 6 Final
          asoldano

          Alessio Soldano wrote:

           

          Kuntal Mondal wrote on https://issues.jboss.org/browse/JBAS-8779 :

           

          Alessio - thanks a lot for responding to this issue. I am not using  anything very specific to  JBossWS-Metro and will be happy to use  JBossWS-CXF stack if it works. 
          Below here is my exception detail.

          I am using SpringSecurity (3.0.3) for user authentication/authorization. I have 2 WAR modules under EAR. 
          All the Spring libraries are placed within EAR/lib so that both of my WAR modules can access those. 
          With "Jboss6-Final" release I am getting following exception while  invoking web service. The complete stack trace has been attached - I  have specified the relevant portion here.

          =======================================
          11:04:05,769 ERROR [[/edm]] Servlet /edm threw load() exception:  java.lang.ClassNotFoundException:  org.springframework.beans.BeansException from BaseClassLoader@138847d{vfs:///C:/Workspace/DM1.0/dependencies/repository/jboss/jboss-6.0.0.Final/server/default/conf/jboss-service.xml}
                   at org.jboss.classloader.spi.base.BaseClassLoader.loadClass(BaseClassLoader.java:480) [jboss-classloader.jar:2.2.0.GA]
                   at java.lang.ClassLoader.loadClass(ClassLoader.java:248) [:1.6.0_23]
                   at  org.jboss.wsf.stack.cxf.client.configuration.JBossWSBusFactory.getSpringBusFactory(JBossWSBusFactory.java:120)  [:3.4.1.GA]
                   at org.jboss.wsf.stack.cxf.client.configuration.JBossWSBusFactory.createBus(JBossWSBusFactory.java:54) [:3.4.1.GA]
                   at org.jboss.wsf.stack.cxf.client.ProviderImpl.createServiceDelegate(ProviderImpl.java:69) [:3.4.1.GA]
                   at javax.xml.ws.Service.<init>(Service.java:57) [:1.0.0.Final]
                   at com.towersoft.schema.webservice.trim2.Engine.<init>(Engine.java:42) [:]
                   at com.im.server.edm.datasource.trim.TrimSession.createTrimSession(TrimSession.java:73) [:]
                   at com.im.server.edm.datasource.trim.TrimDatasource.createSession(TrimDatasource.java:60) [:]
                   at com.im.server.edm.datasource.trim.TrimDatasource.createSession(TrimDatasource.java:15) [:]
                   at com.im.server.edm.datasource.SessionCache.acquire(SessionCache.java:34) [:]
                   at com.im.server.edm.datasource.Datasource.openSession(Datasource.java:96) [:]
                   at com.im.server.edm.buslogic.DatasourceBL.persistTrimCustomFields(DatasourceBL.java:186) [:]
                   at com.im.server.edm.buslogic.InstallBL.createDatasources(InstallBL.java:211) [:]
                   at com.im.server.edm.buslogic.InstallBL.createDevDatasources(InstallBL.java:172) [:]
                   at com.im.server.edm.buslogic.InstallBL.initializeApplication(InstallBL.java:40) [:]
                   at com.im.server.edm.ejb.ApplicationBean.initializeApplication(ApplicationBean.java:42) [:]
                   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_23]
                   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [:1.6.0_23]
                   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_23]
                   at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_23]
          ==================================================
          I have no idea why "org.springframework.beans.BeansException" class has been referred from JBossWS-CXF library.
          Is it because I am using SpringSecurity??

          Since CXF libraries are under {JBOSS}\common\lib, those are loaded by  BaseClassLoaders - where as my Spring libraries are under EAR and loaded  by different classloader.

          After lot of trial and error ultimately I have found that if I place  following 8 Spring libraries (together with  aopalliance.jar) under  {JBOSS}\common\lib, I can avoid all Spring-class-not-found related  exceptions. These are:
          1) aopalliance.jar
          2) org.springframework.aop-3.0.3.RELEASE.jar
          3) org.springframework.asm-3.0.3.RELEASE.jar
          4) org.springframework.beans-3.0.3.RELEASE.jar
          5) org.springframework.context-3.0.3.RELEASE.jar
          6) org.springframework.context.support-3.0.3.RELEASE.jar
          7) org.springframework.core-3.0.3.RELEASE.jar
          8) org.springframework.expression-3.0.3.RELEASE.jar

          I have serious doubt why I have to keep these libs under  {JBOSS}\common\lib? - these are app-specific lib, so these should not be  placed under {JBOSS}\common\lib.
          But without these spring libs JBossWS-CXF always thorws exception. Can you "please" advise??

           

          As you figured out, this is a classloading issue. Basically, Apache CXF requires Spring for some funcionalities, hence the same applies to JBossWS-CXF. JBossWS-CXF libraries (and Apache CXF ones) needs to be in common/lib in order for any ws deployment to be properly handled. As a consequence, *if* the user needs Spring (or the Apache CXF features strictly requiring Spring), those libs needs to be in common/lib too. There was a mention on this in the JBoss AS 6 M4 release notes http://community.jboss.org/wiki/JBossWSonAS6M4ReleaseNotes.

          This said, to be honest, the JBossWS-CXF layer actually tries to detect whether Spring is actually available or not. As a matter of fact, if it isn't, the non-spring version of every JBossWS-CXF and Apache CXF facilities are automatically used at runtime. So in this case the big-ball-of-mud classloader of AS 6 is probably allowing JBossWS-CXF to see Spring is available somewhere (in your deployment), but it then can't use it together with stuff that's actually loaded by the common/shared classloader (things become quite tricky here...). This loading stuff is something that is very likely to change and be solved in AS7.

          Back to you issue / options: assuming you're really using the ws-security facilities of Apache CXF which are based on Spring, you need to have Spring libs in common/lib. You can either do that manually and use the Spring version you prefer, or download JBossWS-CXF 3.4.1.GA and run "ant -Dspring=true deploy-jboss600".

           

           

          Now for webservice-invocation I also need to place following 3 additional libraries under {JBOSS}\common\lib. These are:

          1) commons-lang-2.5.jar
          2) saaj-api.jar
          3) saaj-impl.jar

          With these modification I was able to invoke my web services (at least 2 out of 3).

           

          You're not supposed to play with the SAAJ api and implementation being used (why the default is not fine with you?)

           

          I have to invoke webservice to 3 different web servers. Two of them are working with above configuration.
          For the 3rd one I am getting following error. Not sure it is related to  JBossWS-CXF library or not - but the server is up and I can access the  WSDL using browser.
          So I am at lost here.

          Any suggestion/advise will be very helpful.

          ====================================================================
          Caused by: javax.xml.ws.soap.SOAPFaultException: Can't find input stream in message
                   at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:146) [:2.3.1]
                   at $Proxy203.execute(Unknown Source)    at com.im.server.edm.datasource.trim.Sessionexecute(TrimSession.java:563) [:]
                   at com.im.server.edm.datasource.trim.Sessionexecute(TrimSession.java:556) [:]
                   at com.im.server.edm.datasource.trim.SessionrunQuery(TrimSession.java:144) [:]
                   at com.im.server.edm.datasource.trim.SessionfetchMetadata(TrimSession.java:96) [:]
                   at com.im.server.edm.datasource.DatasourceSession.runQuery(DatasourceSession.java:51) [:]
                   at com.im.server.edm.buslogic.FederationBL.runQuery(FederationBL.java:99) [:]
                   at com.im.server.edm.ejb.FederationBean.runQuery(FederationBean.java:50) [:]
                   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_23]
                   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [:1.6.0_23]
                   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_23]
                   at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_23]
                   at org.jboss.aop.joinpoint.MethodInvocation.invokeTarget(MethodInvocation.java:122) [jboss-aop.jar:2.2.1.GA]
                   at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:111) [jboss-aop.jar:2.2.1.GA]
                   at  org.jboss.ejb3.interceptors.container.ContainerMethodInvocationWrapper.invokeNext(ContainerMethodInvocationWrapper.java:72)  [:1.1.3]
                   at org.jboss.ejb3.interceptors.aop.InterceptorSequencer.invoke(InterceptorSequencer.java:76) [:1.1.3]
                   at org.jboss.ejb3.interceptors.aop.InterceptorSequencer.aroundInvoke(InterceptorSequencer.java:62) [:1.1.3]
                   at sun.reflect.GeneratedMethodAccessor461.invoke(Unknown Source) [:1.6.0_23]
                   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_23]
                   at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_23]
                   at org.jboss.aop.advice.PerJoinpointAdvice.invoke(PerJoinpointAdvice.java:174) [jboss-aop.jar:2.2.1.GA]
                   at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) [jboss-aop.jar:2.2.1.GA]
                   at  org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor.fillMethod(InvocationContextInterceptor.java:74)  [:1.1.3]
                   at  org.jboss.aop.advice.org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor_z_fillMethod_21583340.invoke(InvocationContextInterceptor_z_fillMethod_21583340.java)  [:]
                   at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) [jboss-aop.jar:2.2.1.GA]
                   at org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor.setup(InvocationContextInterceptor.java:90) [:1.1.3]
                   at  org.jboss.aop.advice.org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor_z_setup_21583340.invoke(InvocationContextInterceptor_z_setup_21583340.java)  [:]
                   at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) [jboss-aop.jar:2.2.1.GA]
                   at  org.jboss.ejb3.async.impl.interceptor.AsynchronousServerInterceptor.invoke(AsynchronousServerInterceptor.java:128)  [:1.7.17]
                   at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) [jboss-aop.jar:2.2.1.GA]
                   at org.jboss.ejb3.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:62) [:1.7.17]
                   at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) [jboss-aop.jar:2.2.1.GA]
                   at  org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:56)  [:1.7.17]
                   at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) [jboss-aop.jar:2.2.1.GA]
                   at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47) [:1.7.17]
                   at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) [jboss-aop.jar:2.2.1.GA]
                   at org.jboss.ejb3.tx.StatelessBMTInterceptor.handleInvocation(StatelessBMTInterceptor.java:106) [:1.0.3]
                   at org.jboss.ejb3.tx.BMTInterceptor.invoke(BMTInterceptor.java:55) [:1.0.3]
                   at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) [jboss-aop.jar:2.2.1.GA]
                   at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:68) [:1.7.17]
                   at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) [jboss-aop.jar:2.2.1.GA]
                   at  org.jboss.ejb3.core.context.SessionInvocationContextAdapter.proceed(SessionInvocationContextAdapter.java:95)  [:1.7.17]
                   at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:247) [:0.0.1]
                   ... 39 more
          Caused by: java.lang.RuntimeException: Can't find input stream in message
                   at  org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:116)  [:2.3.1]
                   at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:60) [:2.3.1]
                   at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:255) [:2.3.1]
                   at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:755) [:2.3.1]
                   at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:2330) [:2.3.1]
                   at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:2192) [:2.3.1]
                   at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:2036) [:2.3.1]
                   at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56) [:2.3.1]
                   at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:696) [:2.3.1]
                   at  org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)  [:2.3.1]
                   at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:255) [:2.3.1]
                   at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:516) [:2.3.1]
                   at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:313) [:2.3.1]
                   at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:265) [:2.3.1]
                   at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73) [:2.3.1]
                   at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:124) [:2.3.1]
                   ... 82 more

          mmh... I don't have special idea here... can you share a bit of the client code and/or isolate a small testcase to reproduce? Does issuing the soap request using tools like SoapUI work? (trying to isolate the problem, whether it's a server side or client side one, etc.)

          • 2. Re: Moving to JBossWS-CXF in AS 6 Final
            jbossuser71

            Hi Alessio,

            Actually the saaj-api.jar and saaj-impl.jar are not required there - I get the same exception even if I remove the saaj*.jar from common/lib directory.

            Btw, where is the default implementation? I could not find any saaj*.jar in Jboss 6.0.GA - may be these are not required with CXF stack??

             

            The web service works fine when I use the WS-Metro stack with JBoss-6.0.0.CR1.

            I do not have the visibility in server side implementation of the web service as I am the consumer of the web service.

            I have the WSDL and a jar file containing all artifact classes.

             

            The client side code is like-

            ==============================

                    final URL url = new URL(useSSL ? "https" : "http", host, port, "/trimws/trim.asmx?WSDL");

                    class MyAuthenticator extends Authenticator {

                        public PasswordAuthentication getPasswordAuthentication() {

                            return new PasswordAuthentication(login, password.toCharArray());

                        }

                    }

             

                    Authenticator.setDefault(new MyAuthenticator());

                    final QName serviceName = new QName("http://www.trsoft.com/schema/webservice/trim2/", "Engine");

                    final Engine engine = new Engine(url, serviceName);

                    final EngineSoap engineSoap = engine.getEngineSoap();

             

            The Engine class extends javax.xml.ws.Service

            ==========================================

            @javax.xml.ws.WebServiceClient(name = "Engine", targetNamespace = "http://www.trsoft.com/schema/webservice/trim2/", wsdlLocation = "file:/C:/Workspace/resources/trim.wsdl")

            public static class Engine extends javax.xml.ws.Service {

            .

            .

            .

            }

             

             

             

            The EngineSoap is an interface

            =============================

            @javax.jws.WebService(name = "EngineSoap", targetNamespace = "http://www.trsoft.com/schema/webservice/trim2/")

            @javax.xml.bind.annotation.XmlSeeAlso({null})

            public static interface EngineSoap  {

             

                @javax.jws.WebMethod(operationName = "ListProperties", action = "http://www.trsoft.com/schema/webservice/trim2/ListProperties")

                @javax.jws.WebResult(name = "ListPropertiesResult", targetNamespace = "http://www.trsoft.com/schema/webservice/trim2/")

                @javax.xml.ws.RequestWrapper(localName = "ListProperties", targetNamespace = "http://www.trsoft.com/schema/webservice/trim2/", className = "com.trsoft.schema.webservice.trim2.ListProperties")

                @javax.xml.ws.ResponseWrapper(localName = "ListPropertiesResponse", targetNamespace = "http://www.trsoft.com/schema/webservice/trim2/", className = "com.trsoft.schema.webservice.trim2.ListPropertiesResponse")

                com.trsoft.schema.webservice.trim2.ArrayOfPropertyDescription listProperties(@javax.jws.WebParam(name = "ObjectName", targetNamespace = "http://www.trsoft.com/schema/webservice/trim2/") java.lang.String s);

             

                @javax.jws.WebMethod(operationName = "ListProperty", action = "http://www.trsoft.com/schema/webservice/trim2/ListProperty")

                @javax.jws.WebResult(name = "ListPropertyResult", targetNamespace = "http://www.trsoft.com/schema/webservice/trim2/")

                @javax.xml.ws.RequestWrapper(localName = "ListProperty", targetNamespace = "http://www.trsoft.com/schema/webservice/trim2/", className = "com.trsoft.schema.webservice.trim2.ListProperty")

                @javax.xml.ws.ResponseWrapper(localName = "ListPropertyResponse", targetNamespace = "http://www.trsoft.com/schema/webservice/trim2/", className = "com.trsoft.schema.webservice.trim2.ListPropertyResponse")

                com.trsoft.schema.webservice.trim2.PropertyDescription listProperty(@javax.jws.WebParam(name = "PropertyName", targetNamespace = "http://www.trsoft.com/schema/webservice/trim2/") java.lang.String s);

             

                @javax.jws.WebMethod(operationName = "Execute", action = "http://www.trsoft.com/schema/webservice/trim2/Execute")

                @javax.jws.WebResult(name = "ExecuteResult", targetNamespace = "http://www.trsoft.com/schema/webservice/trim2/")

                @javax.xml.ws.RequestWrapper(localName = "Execute", targetNamespace = "http://www.trsoft.com/schema/webservice/trim2/", className = "com.trsoft.schema.webservice.trim2.Execute")

                @javax.xml.ws.ResponseWrapper(localName = "ExecuteResponse", targetNamespace = "http://www.trsoft.com/schema/webservice/trim2/", className = "com.trsoft.schema.webservice.trim2.ExecuteResponse")

                com.trsoft.schema.webservice.trim2.TrimResponse execute(@javax.jws.WebParam(name = "req", targetNamespace = "http://www.trsoft.com/schema/webservice/trim2/") com.trsoft.schema.webservice.trim2.TrimRequest trimRequest);

             

                @javax.jws.WebMethod(operationName = "ExecuteXml", action = "http://www.trsoft.com/schema/webservice/trim2/ExecuteXml")

                @javax.jws.WebResult(name = "ExecuteXmlResult", targetNamespace = "http://www.trsoft.com/schema/webservice/trim2/")

                @javax.xml.ws.RequestWrapper(localName = "ExecuteXml", targetNamespace = "http://www.trsoft.com/schema/webservice/trim2/", className = "com.trsoft.schema.webservice.trim2.ExecuteXml")

                @javax.xml.ws.ResponseWrapper(localName = "ExecuteXmlResponse", targetNamespace = "http://www.trsoft.com/schema/webservice/trim2/", className = "com.trsoft.schema.webservice.trim2.ExecuteXmlResponse")

                java.lang.String executeXml(@javax.jws.WebParam(name = "xml", targetNamespace = "http://www.trsoft.com/schema/webservice/trim2/") java.lang.String s);

             

                @javax.jws.WebMethod(operationName = "ListPropertiesXml", action = "http://www.trsoft.com/schema/webservice/trim2/ListPropertiesXml")

                @javax.jws.WebResult(name = "ListPropertiesXmlResult", targetNamespace = "http://www.trsoft.com/schema/webservice/trim2/")

                @javax.xml.ws.RequestWrapper(localName = "ListPropertiesXml", targetNamespace = "http://www.trsoft.com/schema/webservice/trim2/", className = "com.trsoft.schema.webservice.trim2.ListPropertiesXml")

                @javax.xml.ws.ResponseWrapper(localName = "ListPropertiesXmlResponse", targetNamespace = "http://www.trsoft.com/schema/webservice/trim2/", className = "com.trsoft.schema.webservice.trim2.ListPropertiesXmlResponse")

                java.lang.String listPropertiesXml(@javax.jws.WebParam(name = "ObjectName", targetNamespace = "http://www.trsoft.com/schema/webservice/trim2/") java.lang.String s);

             

                @javax.jws.WebMethod(operationName = "ConvertToXml", action = "http://www.trsoft.com/schema/webservice/trim2/ConvertToXml")

                @javax.jws.WebResult(name = "ConvertToXmlResult", targetNamespace = "http://www.trsoft.com/schema/webservice/trim2/")

                @javax.xml.ws.RequestWrapper(localName = "ConvertToXml", targetNamespace = "http://www.trsoft.com/schema/webservice/trim2/", className = "com.trsoft.schema.webservice.trim2.ConvertToXml")

                @javax.xml.ws.ResponseWrapper(localName = "ConvertToXmlResponse", targetNamespace = "http://www.trsoft.com/schema/webservice/trim2/", className = "com.trsoft.schema.webservice.trim2.ConvertToXmlResponse")

                java.lang.String convertToXml(@javax.jws.WebParam(name = "req", targetNamespace = "http://www.trsoft.com/schema/webservice/trim2/") com.trsoft.schema.webservice.trim2.TrimRequest trimRequest);

            }

             

             

            Thanks for your time.

            • 3. Re: Moving to JBossWS-CXF in AS 6 Final
              asoldano

              Kuntal Mondal wrote:

               

              Hi Alessio,

              Actually the saaj-api.jar and saaj-impl.jar are not required there - I get the same exception even if I remove the saaj*.jar from common/lib directory.

              Btw, where is the default implementation? I could not find any saaj*.jar in Jboss 6.0.GA - may be these are not required with CXF stack??

              Basically, the SAAJ reference impl is included in JDK 6 and Apache CXF simply works with that.

               

               

              The web service works fine when I use the WS-Metro stack with JBoss-6.0.0.CR1.

              I do not have the visibility in server side implementation of the web service as I am the consumer of the web service.

              I have the WSDL and a jar file containing all artifact classes.

              [...]

              OK, you mean the spring related exception? Did you move the spring libs to common/lib (removing them from your ear) or installed jbossws 3.4.1 with the -Dspring=true option as mentioned above?

              • 4. Re: Moving to JBossWS-CXF in AS 6 Final
                jbossuser71

                Alessio - I removed the all "required" spring lib from my EAR/lib and placed as part of JBoss/common/lib. In this way I do not get any spring-class-not-found exception - my user authentication works fine.

                Only exception I get is the "SOAPFaultException" which occurs as soon as I invoke the web service. In internet I didn't find much discussion for such exception. It looks like the call to the JaxWS proxy fails, for some reason,  with "Can't find input stream in message" - but I have no clue at this point.

                Same call works fine with Metro stack.

                • 5. Re: Moving to JBossWS-CXF in AS 6 Final
                  asoldano

                  ok...  I still don't have special idea/solutions regarding that "Can't find input stream in message" exception from Apache CXF. Would you be able to isolate a testcase for that and attach it here? Do you also see the same behaviour using a standalone client that does the same, except it's not (running from) an ejb3 bean?

                  • 6. Re: Moving to JBossWS-CXF in AS 6 Final
                    jbossuser71

                    The standalone client works fine but if I make the same call from app container (with CXF stack) I get this error.

                     

                    Also the test client does not need any other jar (except the webservice's artifact jar) - that means the standard Java environment/libs are enough to invoke the web service.

                     

                    The TestClient code is given below. But I don't have the server side implementation.

                    I will try to get in touch with the folks who implemented the server side part of the webservice - most likely it was developed using .NET.

                     

                    ===========================

                    import javax.xml.namespace.QName;

                    import java.io.FileInputStream;

                    import java.io.FileOutputStream;

                    import java.net.Authenticator;

                    import java.net.PasswordAuthentication;

                    import java.net.URL;

                    import java.util.List;

                     

                    public class TrimTest {

                     

                        EngineSoap engSoap;

                     

                        public static void main(String[] args) {

                            try {

                                new TrimTest(args);

                            } catch (Throwable t) {

                                t.printStackTrace();

                            }

                        }

                     

                        public TrimTest(String[] args) throws Exception {

                            // Setup service definition

                            Authenticator.setDefault(new MyAuthenticator());

                             URL host = new URL("http://16.93.14.69/trimws/trim.asmx");

                             QName serviceName = new QName("http://www.towersoft.com/schema/webservice/trim2/", "Engine");

                     

                            Engine eng = new Engine(host, serviceName);

                            engSoap = eng.getEngineSoap();

                     

                            try {

                     

                                trimListProperties();

                     

                            } catch (Exception e) {

                                e.printStackTrace();

                            }

                        }

                     

                        static class MyAuthenticator extends Authenticator {

                            @Override

                            public PasswordAuthentication getPasswordAuthentication() {

                                return (new PasswordAuthentication("Admin", "AdminPassword".toCharArray()));

                            }

                        }

                     

                        /**

                        //Print out all the properties of a TRIM "record".

                        //@throws Exception

                         */

                        public void trimListProperties() throws Exception {

                            // Send the request to the TRIM server and get a response back

                            ArrayOfPropertyDescription descs = engSoap.listProperties("record");

                            List<PropertyDescription> pdList = descs.getPropertyDescription();

                     

                            for(PropertyDescription pd : pdList) {

                                System.out.println(pd.getName() + "\t" + pd.getCaption());

                            }

                        }

                    }

                    • 7. Re: Moving to JBossWS-CXF in AS 6 Final
                      asoldano

                      Kuntal Mondal wrote:

                       

                      The standalone client works fine but if I make the same call from app container (with CXF stack) I get this error.

                       

                      Also the test client does not need any other jar (except the webservice's artifact jar) - that means the standard Java environment/libs are enough to invoke the web service.

                       

                      Are you using the jbossws-cxf libraries when trying with the standalone client, right? (including setting -Djava.endorsed.dirs to the lib/endorsed of your AS with jbossws-cxf) Otherwise you're basically leveraging the JAXWS RI included in JDK6.

                      Basically, what I'm trying to understand here is if this is a JBossWS-CXF / Apache CXF problem, or something related to environment this app is run on.

                      • 8. Re: Moving to JBossWS-CXF in AS 6 Final
                        jbossuser71

                        Alessio - you are right - I was not using CXF stack while executing the test client.

                        That means the test program was using standard JAXWS RI from my JDK6 installation. 

                        Now when I run the program as:

                              java -classpath ".;trim2.jar;<ALL-RELATED-CXF-LIB>"  -Djava.endorsed.dirs="C:\jboss-6.0.0.Final\common\lib\endorsed"  TrimTest

                        I get following error. Specifying "-Djava.endorsed.dirs" does not help - without it also I get the same error.

                        ================================================

                        javax.xml.ws.WebServiceException: org.apache.cxf.service.factory.ServiceConstructionException: Failed to create service.

                                at org.apache.cxf.jaxws.ServiceImpl.<init>(ServiceImpl.java:152)

                                at org.apache.cxf.jaxws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:90)

                                at javax.xml.ws.Service.<init>(Service.java:56)

                                at com.towersoft.schema.webservice.trim2.Engine.<init>(Engine.java:42)

                                at TrimTest.<init>(TrimTest.java:35)

                                at TrimTest.main(TrimTest.java:22)

                        Caused by: org.apache.cxf.service.factory.ServiceConstructionException: Failed to create service.

                                at org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java:93)

                                at org.apache.cxf.jaxws.ServiceImpl.initializePorts(ServiceImpl.java:207)

                                at org.apache.cxf.jaxws.ServiceImpl.<init>(ServiceImpl.java:150)

                                ... 5 more

                        Caused by: javax.wsdl.WSDLException: WSDLException: faultCode=PARSER_ERROR: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[96,17]

                        Message: The element type "p" must be terminated by the matching end-tag "</p>".

                                at org.apache.cxf.wsdl11.WSDLManagerImpl.loadDefinition(WSDLManagerImpl.java:235)

                                at org.apache.cxf.wsdl11.WSDLManagerImpl.getDefinition(WSDLManagerImpl.java:186)

                                at org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java:91)

                                ... 7 more

                        Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[96,17]

                        Message: The element type "p" must be terminated by the matching end-tag "</p>".

                                at com.sun.org.apache.xerces.internal.impl.XMLStreamReaderImpl.next(XMLStreamReaderImpl.java:594)

                                at org.apache.cxf.staxutils.StaxUtils.readDocElements(StaxUtils.java:998)

                                at org.apache.cxf.staxutils.StaxUtils.read(StaxUtils.java:849)

                                at org.apache.cxf.wsdl11.WSDLManagerImpl.loadDefinition(WSDLManagerImpl.java:226)

                                ... 9 more

                         

                        Surprising thing is my WSDL does not contain any <p> or </p> tag.

                        The libs I put in the classpath are (all from JBOSS/common/lib):

                        =====================================================

                        cxf-api.jar        cxf-common-schemas.jar    cxf-common-utilities.jar    cxf-rt-bindings-coloc.jar    cxf-rt-bindings-http.jar

                        cxf-rt-bindings-object.jar    cxf-rt-bindings-soap.jar    cxf-rt-bindings-xml.jar    cxf-rt-core.jar    cxf-rt-databinding-aegis.jar

                        cxf-rt-databinding-jaxb.jar    cxf-rt-frontend-jaxws.jar    cxf-rt-frontend-simple.jar    cxf-rt-management.jar    cxf-rt-transports-http.jar

                        cxf-rt-transports-jms.jar    cxf-rt-transports-local.jar    cxf-rt-ws-addr.jar    cxf-rt-ws-policy.jar    cxf-rt-ws-rm.jar

                        cxf-rt-ws-security.jar    cxf-tools-common.jar    cxf-tools-java2ws.jar    cxf-tools-validator.jar    cxf-tools-wsdlto-core.jar

                        cxf-tools-wsdlto-databinding-jaxb.jar    cxf-tools-wsdlto-frontend-jaxws.jar    cxf-xjc-boolean.jar    cxf-xjc-bug671.jar

                        cxf-xjc-dv.jar    cxf-xjc-ts.jar    jboss-jaxb-api_2.2_spec.jar    jboss-jaxb-intros.jar    jboss-jaxr-api_1.0_spec.jar

                        jboss-jaxrpc-api_1.1_spec.jar    jboss-jaxws-api_2.2_spec.jar    jbossws-common.jar    jbossws-framework.jar

                        jbossws-jboss60.jar    jbossws-native-core.jar    jbossws-spi.jar    wsdl4j.jar    wss4j.jar    xalan.jar    xmlsec.jar

                        xnio-api.jar    jsr181-api.jar    log4j-snmp-appender.jar    log4j.jar    mail-plugin.jar    mail.jar    neethi.jar    XmlSchema.jar

                         

                        The WSDL is attached here.

                        Do you think some parser library is not handling the WSDL properly?

                        • 9. Re: Moving to JBossWS-CXF in AS 6 Final
                          asoldano

                          OK, two comments here then:

                          1) you should really try capturing the network traffic to see what goes to the wire; the message you get about "<p>" seems to indicated that you're getting an html page instead of the wsdl. My guess is that "http://16.93.14.69/trimws/trim.asmx" is not the exact path to the wsdl

                          2) regarding the libs to include, consider taking a look at the wsrunclient scripts in jboss-home/bin; in particular I don't see the jbossws-cxf-*.jar here above.

                          • 10. Re: Moving to JBossWS-CXF in AS 6 Final
                            tom.fusillo

                            I had a similar issue with my Spring and CXF libraries in my EAR. Instead of adding the Spring libraries to the common/lib directory I added the CXF libraries to the EAR and added a jboss-classloading.xml to the WAR. You can find my solution here: http://community.jboss.org/thread/160566

                            • 11. Re: Moving to JBossWS-CXF in AS 6 Final
                              jbossuser71

                              Alessio - the address for WSDL is right - but my mistake, I did not put "?wsdl" at the end of it. So it "was" returning a HTML page - sorry for that.

                              Now the test client works okay using the CXF library set specfied above, as well as the libs specified in 'jboss-home/bin/wsrunclient.bat" file.

                              But the same call is failing from my J2EE app. Looks like a classloader or configuration issue - but I could not figure it out.

                               

                              I have the exact similar application configuration like Tom and tried his approach as well. But problem with that is: I am invoking the webservice, rather than deploying the webservice. So if I put all CXF libs under my EAR/lib, my app comes up fine. But when I make the webservice call, it needs other depenedent library like (jaxb-api, stax-api,etc) - and all those libs are part of either jboss/common/lib or jboss/client - so I am again ended up with same classloader-violation issue for those lib. Because now my CXF libs are loaded by EAR-classloader but internally these look for other 3rd party libs which are loaded by Jboss BaseClassLoader.

                              I am uncessful to find out the exact set of dependent libs I need to put as part of my EAR/lib beside the CXF libray set.

                               

                              I will ask Tom (in his thread) to describe what set of CXF libs and any other dependent libs he put as part of his EAR/lib deployment.

                              Again, in Tom's case he deployed the webservice,  but I am invoking a webservice - thus I believe the required library set will vary and I am unable to determine that set.

                              • 12. Re: Moving to JBossWS-CXF in AS 6 Final
                                jbossuser71

                                I tried few other combinations - I installed "jbossws-cxf-3.4.1.GA" stack on top of JBoss-6.0-GA.

                                Now I get slight different error,  though in my WSDL I do not find any HEAD or META tag.

                                 

                                =====================================================================

                                Caused by: org.apache.cxf.service.factory.ServiceConstructionException: Failed to create service.

                                        at org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java:93) [:2.3.1]

                                        at org.apache.cxf.jaxws.ServiceImpl.initializePorts(ServiceImpl.java:207) [:2.3.1]

                                        at org.apache.cxf.jaxws.ServiceImpl.<init>(ServiceImpl.java:150) [:2.3.1]

                                        ... 93 more

                                Caused by: javax.wsdl.WSDLException: WSDLException: faultCode=PARSER_ERROR: com.ctc.wstx.exc.WstxParsingException: Unexpected close tag </HEAD>; expected </META>.

                                at [row,col,system-id]: [11,6,"http://rclient114.cup.hp.com:80/trimws/trim.asmx?WSDL"]

                                        at org.apache.cxf.wsdl11.WSDLManagerImpl.loadDefinition(WSDLManagerImpl.java:235) [:2.3.1]

                                        at org.apache.cxf.wsdl11.WSDLManagerImpl.getDefinition(WSDLManagerImpl.java:186) [:2.3.1]

                                        at org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java:91) [:2.3.1]

                                        ... 95 more

                                Caused by: com.ctc.wstx.exc.WstxParsingException: Unexpected close tag </HEAD>; expected </META>.

                                at [row,col,system-id]: [11,6,"http://rclient114.cup.hp.com:80/trimws/trim.asmx?WSDL"]

                                        at com.ctc.wstx.sr.StreamScanner.constructWfcException(StreamScanner.java:630) [:3.2.6]

                                        at com.ctc.wstx.sr.StreamScanner.throwParseError(StreamScanner.java:461) [:3.2.6]

                                        at com.ctc.wstx.sr.BasicStreamReader.reportWrongEndElem(BasicStreamReader.java:3256) [:3.2.6]

                                        at com.ctc.wstx.sr.BasicStreamReader.readEndElem(BasicStreamReader.java:3198) [:3.2.6]

                                        at com.ctc.wstx.sr.BasicStreamReader.nextFromTree(BasicStreamReader.java:2830) [:3.2.6]

                                        at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1019) [:3.2.6]

                                        at org.apache.cxf.staxutils.StaxUtils.readDocElements(StaxUtils.java:998) [:2.3.1]

                                        at org.apache.cxf.staxutils.StaxUtils.read(StaxUtils.java:849) [:2.3.1]

                                        at org.apache.cxf.wsdl11.WSDLManagerImpl.loadDefinition(WSDLManagerImpl.java:226) [:2.3.1]

                                        ... 97 more

                                 

                                 

                                 

                                The other thing I realized is that I did not have any "CXF Client Configuration" file - not sure if I have to have.

                                My WS-Client code resides in a jar file and part of EJB/lib dir.

                                So can anyone tell me where should I put the "cxf.xml" file?

                                 

                                The CXF documentation says it should be in your class-path - does that mean I can keep this file inside my jar file (top level) ? -- or may be in {JBOSS}\server\default\deploy dir??

                                 

                                The content of "cxf.xml" file I found by googling:

                                ======================================

                                <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

                                    xmlns:http-conf="http://cxf.apache.org/transports/http/configuration"

                                    xsi:schemaLocation="http://cxf.apache.org/transports/http/configuration

                                                        http://cxf.apache.org/schemas/configuration/http-conf.xsd

                                                        http://www.springframework.org/schema/beans

                                                        http://www.springframework.org/schema/beans/spring-beans.xsd">

                                 

                                    <import resource="classpath:META-INF/cxf/cxf.xml"/>

                                    <import resource="classpath:META-INF/cxf/cxf-extension-soap.xml"/>

                                    <import resource="classpath:META-INF/cxf/cxf-servlet.xml"/>

                                 

                                </beans>

                                • 13. Re: Moving to JBossWS-CXF in AS 6 Final
                                  asoldano

                                  Kuntal Mondal wrote:

                                   

                                  I tried few other combinations - I installed "jbossws-cxf-3.4.1.GA" stack on top of JBoss-6.0-GA.

                                  Now I get slight different error,  though in my WSDL I do not find any HEAD or META tag.

                                   

                                  =====================================================================

                                  Caused by: org.apache.cxf.service.factory.ServiceConstructionException: Failed to create service.

                                          at org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java:93) [:2.3.1]

                                          at org.apache.cxf.jaxws.ServiceImpl.initializePorts(ServiceImpl.java:207) [:2.3.1]

                                          at org.apache.cxf.jaxws.ServiceImpl.<init>(ServiceImpl.java:150) [:2.3.1]

                                          ... 93 more

                                  Caused by: javax.wsdl.WSDLException: WSDLException: faultCode=PARSER_ERROR: com.ctc.wstx.exc.WstxParsingException: Unexpected close tag </HEAD>; expected </META>.

                                  at [row,col,system-id]: [11,6,"http://rclient114.cup.hp.com:80/trimws/trim.asmx?WSDL"]

                                          at org.apache.cxf.wsdl11.WSDLManagerImpl.loadDefinition(WSDLManagerImpl.java:235) [:2.3.1]

                                          at org.apache.cxf.wsdl11.WSDLManagerImpl.getDefinition(WSDLManagerImpl.java:186) [:2.3.1]

                                          at org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java:91) [:2.3.1]

                                          ... 95 more

                                  Caused by: com.ctc.wstx.exc.WstxParsingException: Unexpected close tag </HEAD>; expected </META>.

                                  at [row,col,system-id]: [11,6,"http://rclient114.cup.hp.com:80/trimws/trim.asmx?WSDL"]

                                          at com.ctc.wstx.sr.StreamScanner.constructWfcException(StreamScanner.java:630) [:3.2.6]

                                          at com.ctc.wstx.sr.StreamScanner.throwParseError(StreamScanner.java:461) [:3.2.6]

                                          at com.ctc.wstx.sr.BasicStreamReader.reportWrongEndElem(BasicStreamReader.java:3256) [:3.2.6]

                                          at com.ctc.wstx.sr.BasicStreamReader.readEndElem(BasicStreamReader.java:3198) [:3.2.6]

                                          at com.ctc.wstx.sr.BasicStreamReader.nextFromTree(BasicStreamReader.java:2830) [:3.2.6]

                                          at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1019) [:3.2.6]

                                          at org.apache.cxf.staxutils.StaxUtils.readDocElements(StaxUtils.java:998) [:2.3.1]

                                          at org.apache.cxf.staxutils.StaxUtils.read(StaxUtils.java:849) [:2.3.1]

                                          at org.apache.cxf.wsdl11.WSDLManagerImpl.loadDefinition(WSDLManagerImpl.java:226) [:2.3.1]

                                          ... 97 more

                                   

                                  My suggestion, again, is to start by looking at the traffic on the wire. What is being asked, what is being replied.

                                   

                                   

                                   

                                  The other thing I realized is that I did not have any "CXF Client Configuration" file - not sure if I have to have.

                                  My WS-Client code resides in a jar file and part of EJB/lib dir.

                                  So can anyone tell me where should I put the "cxf.xml" file?

                                   

                                  The CXF documentation says it should be in your class-path - does that mean I can keep this file inside my jar file (top level) ? -- or may be in {JBOSS}\server\default\deploy dir??

                                   

                                  The content of "cxf.xml" file I found by googling:

                                  ======================================

                                  <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

                                      xmlns:http-conf="http://cxf.apache.org/transports/http/configuration"

                                      xsi:schemaLocation="http://cxf.apache.org/transports/http/configuration

                                                          http://cxf.apache.org/schemas/configuration/http-conf.xsd

                                                          http://www.springframework.org/schema/beans

                                                          http://www.springframework.org/schema/beans/spring-beans.xsd">

                                   

                                      <import resource="classpath:META-INF/cxf/cxf.xml"/>

                                      <import resource="classpath:META-INF/cxf/cxf-extension-soap.xml"/>

                                      <import resource="classpath:META-INF/cxf/cxf-servlet.xml"/>

                                   

                                  </beans>

                                   

                                  For running the standard jaxws client you posted the code of before, you don't need to provide any cxf.xml / jbossws-cxf.xml conf file. The JBossWS-CXF stack is already properly configured for dealing with that and already imports all the required cxf extensions.

                                  • 14. Re: Moving to JBossWS-CXF in AS 6 Final
                                    jbossuser71

                                    I have got the resolution.

                                    Thanks a lot to Alessio and Tom for providing the valuable suggestion and tips.

                                     

                                    It turns out that the web service was deployed on Microsoft IIS and if we use Apache CXF library for ws-client, we must need to setup the CXF client to turn off chunking. The reason is that the NTLM authentication requires a 3 part handshake which breaks the  streaming. This was beyond my knowledge as I have very very limited knowledge about Microsoft technologies.

                                    Surprisingly JAX-WS RI implementation or Metro-WS stack does not demand this kind requirement. Thus in my opinion it is indeed an overhead for CXF users. Anyway I have no other stack available other than CXF stack with JBoss 6.0.GA !!

                                     

                                    The other error. i.e. "Unexpected close tag </HEAD>; expected </META>", was occurring because the server was sending an error page which was lacking an end </META> tag. The CXF library is strict in XML parsing and instead of showing error as "401 Authentication Required", it just states about the parsing error. AGAIN, the JAX-WS RI implementation or Metro-WS stack does properly show the corret error message (i.e. 401 authentication required.)  even if the returned html page misses an end </META> tag.

                                     

                                    Though I have found the solution but I would love to know more about NTLM authentication and how the turning the chunking off resolves the authentication failure issues with CXF stack. So if anybody can throw some light in it, will be very happy.

                                     

                                    Cheers,

                                    - Kuntal

                                    1 2 Previous Next