2 Replies Latest reply on Apr 19, 2011 12:22 PM by nicolas.bielza

    Error deploying WebServiceProvider when using WS-RM

    nicolas.bielza

      Hello All,

       

      I'm using JBoss AS 5.1 with ESB 4.8 and JBossWS Metro 3.3.1

       

      I converted an existing web service to a web service provider. When trying to deploy the web service provider, I get a NPE. If I comment out the RMAssertion from the WSDL, the service provider deploys fine.

       

       

      {code}

      11:32:33,465 ERROR [org.jboss.kernel.plugins.dependency.AbstractKernelController] Error installing to Real: name=vfsfile:/E:/ChuckNorris/JBoss/JBoss-AS/server/default/deploy/ByDesign_JBoss5.1.war/ state=PreReal mode=Manual requiredState=Real

      org.jboss.deployers.spi.DeploymentException: Error during deploy: vfsfile:/E:/ChuckNorris/JBoss/JBoss-AS/server/default/deploy/ByDesign_JBoss5.1.war/

          at org.jboss.deployers.spi.DeploymentException.rethrowAsDeploymentException(DeploymentException.java:49)

          at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:177)

          at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1439)

          at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1157)

          at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1098)

          at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)

          at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)

          at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)

          at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)

          at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)

          at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)

          at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)

          at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:781)

          at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:702)

          at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.process(MainDeployerAdapter.java:117)

          at org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDScanner.java:362)

          at org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java:255)

          at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)

          at java.util.concurrent.FutureTask$Sync.innerRunAndReset(Unknown Source)

          at java.util.concurrent.FutureTask.runAndReset(Unknown Source)

          at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(Unknown Source)

          at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(Unknown Source)

          at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)

          at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)

          at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

          at java.lang.Thread.run(Unknown Source)

      Caused by: javax.xml.ws.WebServiceException: Failed to build METRO runtime model

          at org.jboss.wsf.stack.metro.metadata.RuntimeModelDeploymentAspect.start(RuntimeModelDeploymentAspect.java:135)

          at org.jboss.webservices.integration.deployers.WSDeploymentAspectDeployer.internalDeploy(WSDeploymentAspectDeployer.java:107)

          at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)

          at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:171)

          ... 24 more

      Caused by: java.lang.NullPointerException

          at com.sun.xml.ws.rm.runtime.AbstractRmServerTube.<init>(AbstractRmServerTube.java:102)

          at com.sun.xml.ws.rm.runtime.Rm11ServerTube.<init>(Rm11ServerTube.java:74)

          at com.sun.xml.ws.rm.runtime.AbstractRmServerTube.getInstance(AbstractRmServerTube.java:80)

          at com.sun.xml.ws.rm.runtime.RmTubeAppender.appendTube(RmTubeAppender.java:86)

          at com.sun.xml.ws.assembler.TubelineAssemblerFactoryImpl$WsitTubelineAssembler.createServer(TubelineAssemblerFactoryImpl.java:101)

          at com.sun.xml.ws.server.WSEndpointImpl.<init>(WSEndpointImpl.java:152)

          at com.sun.xml.ws.server.EndpointFactory.createEndpoint(EndpointFactory.java:218)

          at com.sun.xml.ws.api.server.WSEndpoint.create(WSEndpoint.java:467)

          at org.jboss.wsf.stack.metro.DeploymentDescriptorParserExt.parseAdapters(DeploymentDescriptorParserExt.java:295)

          at org.jboss.wsf.stack.metro.DeploymentDescriptorParserExt.parse(DeploymentDescriptorParserExt.java:171)

          at org.jboss.wsf.stack.metro.metadata.RuntimeModelDeploymentAspect.start(RuntimeModelDeploymentAspect.java:111)

          ... 27 more

      {code}

       

      The web service provider looks like this:

       

      {code}

      @WebServiceProvider(serviceName = "purchaseorderprocessin3",

                          portName = "SalesOrderProcessingOrderingOutPort",

                          targetNamespace = "http://sap.com/xi/AP/CRM/Global",

                          wsdlLocation = "WEB-INF/wsdl/SalesOrderProcessingOrderingOutWrapper.wsdl")

      @ServiceMode(value = Service.Mode.PAYLOAD)

      public class SalesOrderProcessingOrderingOutImpl implements Provider<Source> /*SalesOrderProcessingOrderingOut*/ {

       

          public Source invoke(Source req) {

              System.out.println("Got order confirmation !");

              return null;

          }

      }

      {code}

       

      I'd appreciate it very much if someone could tell me whether it is feasible or not to build a WebServiceProvider using WS-RM (I must use WS-RM 1.1, that's the reason why I'm using the Metro stack).

       

      Thanks,

      Nicolas.

        • 1. Re: Error deploying WebServiceProvider when using WS-RM
          nicolas.bielza

          The NPE is throw from the AbstractRmServerTube constructor, which looks like this:

           

          {code}

              AbstractRmServerTube(Configuration configuration, Tube tubelineHead) {

                  super(tubelineHead);

           

                  this.configuration = configuration;

           

                  // TODO don't take the first config alternative automatically...

                  if (configuration.getAddressingVersion() != AddressingVersion.W3C) {

                      throw new RmRuntimeException(LocalizationMessages.WSRM_1120_UNSUPPORTED_WSA_VERSION(configuration.getAddressingVersion().toString()));

                  }

           

                  this.sequenceManager = SequenceManagerFactory.INSTANCE.getServerSequenceManager();

                  this.requestAdapter = null;

              }

          {code}

           

          The problem is that configuration.getAddressingVersion() actually returns null, so the NPE is throw instead of RmRuntimeException (because of the configuration.getAddressingVersion().toString() call).

           

          So I'm now trying to adjust my policy definition in hope that the configuration will pick up a known addressing version.

           

          My original WSDL policy is:

           

           

          {code}

              <wsp1:Policy xmlns:wsp1="http://www.w3.org/ns/ws-policy" wsu:Id="SalesOrderProcessingOrderingOutBindingPolicy">

                  <wsp1:ExactlyOne>

                      <wsp1:All>

                          <wsam:Addressing xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" wsp1:Optional="false"/>

                          <wsrm:RMAssertion xmlns:wsrm="http://docs.oasis-open.org/ws-rx/wsrmp/200702"/>

                          <sp:TransportBinding xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">

                              <wsp:Policy>

                                  <sp:TransportToken>

                                      <wsp:Policy>

                                          <sp:HttpsToken>

                                              <wsp:Policy>

                                                  <sp:RequireClientCertificate/>

                                              </wsp:Policy>

                                          </sp:HttpsToken>

                                      </wsp:Policy>

                                  </sp:TransportToken>

                              </wsp:Policy>

                          </sp:TransportBinding>

                      </wsp1:All>

                  </wsp1:ExactlyOne>

              </wsp1:Policy>

          {code}

          • 2. Re: Error deploying WebServiceProvider when using WS-RM
            nicolas.bielza

            I finally found out that the use of WS-Addressing is not picked up from the policy.

             

            I got rid of the problem by adding the @Addressing annotation to the Provider implementation:

             

            {code}

            @WebServiceProvider(serviceName = "purchaseorderprocessin3",

                                portName = "SalesOrderProcessingOrderingOutPort",

                                targetNamespace = "http://sap.com/xi/AP/CRM/Global",

                                wsdlLocation = "WEB-INF/wsdl/SalesOrderProcessingOrderingOut.wsdl")

            @ServiceMode(value = Service.Mode.PAYLOAD)

            @Addressing(required=true)

            public class SalesOrderProcessingOrderingOutImpl implements Provider<Source> {

            ...

            }

            {code}

             

            More details here: http://download.oracle.com/javase/6/docs/api/javax/xml/ws/soap/AddressingFeature.html