2 Replies Latest reply on May 4, 2011 7:16 PM by jshepher

    Jboss Native - EJB based Webservice top down approach

      Hello,

       

      I was trying top down approach for generating EJB based webservice, using Jboss Native stack.
      Generated the stubs using wsconsume command.
      created EJB and web project in eclipse (copied the stubs and defined HelloServiceImpl) and structure as follows

       

      EAR
        - EJB
            - src
                  HelloServiceImpl
                  HelloServicePort
            - META-INF
                   wsdl
                      HelloService.wsdl
        - WEB
             - WebContent
                     META-INF
                         wsdl
                          HelloService.wsdl
                    WEB-INF
                          web.xml (defined servlet entry for HelloService)
         
      HelloServiceImpl defined with annotations. Here i have to use the wsdl which i had defined so i am having the wsdlLocation.
                        
          @Stateless
          @javax.jws.WebService(
                  name = "HelloServicePortImpl",
                  endpointInterface="com.mytest.test.businessservice.helloservice.facade.HelloServicePort",
                  targetNamespace = "http://facade.helloService.businessService.test.mytest.com/",
                  portName="HelloServicePort",
                  serviceName="HelloService",
                  wsdlLocation="META-INF/wsdl/HelloService.wsdl")
          @TransactionManagement(TransactionManagementType.CONTAINER)

       

      When i deploy this ear in jboss with native, it is not able to locate the wsdl in web project, but able to locate in EJB project.
      (Note: But same EAR works fine on Jboss with Metro)

       

      17:18:43,396 INFO  [WSDLFilePublisher] WSDL published to: file:/C:/Architecture_POC/jboss-5.1.0.GA/server/default/data/wsdl/NewHelloEAR.ear/NewHelloEJB.jar/HelloService.wsdl
      17:18:43,443 INFO  [SessionSpecContainer] Stopping jboss.j2ee:ear=NewHelloEAR.ear,jar=NewHelloEJB.jar,name=HelloServicePortImpl,service=EJB3
      17:18:43,443 INFO  [EJBContainer] STOPPED EJB: com.starwood.test.businessservice.helloservice.facade.HelloServicePortImpl ejbName: HelloServicePortImpl
      17:18:43,505 ERROR [AbstractKernelController] Error installing to Real: name=vfszip:/C:/Architecture_POC/jboss-5.1.0.GA/server/default/deploy/NewHelloEAR.ear/ state=PreReal mode=Manual requiredState=Real
      org.jboss.deployers.spi.DeploymentException: Error during deploy: vfszip:/C:/Architecture_POC/jboss-5.1.0.GA/server/default/deploy/NewHelloEAR.ear/NewHelloWebRouter.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.doInstallParentFirst(DeployersImpl.java:1210)
          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(Executors.java:417)
          at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:280)
          at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:135)
          at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:65)
          at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:146)
          at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:170)
          at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:651)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:676)
          at java.lang.Thread.run(Thread.java:595)
      Caused by: org.jboss.ws.WSException: Invalid wsdlFile 'vfszip:/C:/Architecture_POC/jboss-5.1.0.GA/server/default/deploy/NewHelloEAR.ear/NewHelloWebRouter.war/META-INF/wsdl/HelloService.wsdl', expected in: WEB-INF/wsdl/
          at org.jboss.wsf.stack.jbws.WSDLFilePublisher.getPublishLocation(WSDLFilePublisher.java:373)
          at org.jboss.wsf.stack.jbws.WSDLFilePublisher.publishWsdlFiles(WSDLFilePublisher.java:103)
          at org.jboss.wsf.stack.jbws.PublishContractDeploymentAspect.start(PublishContractDeploymentAspect.java:50)
          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)
          ... 25 more
      17:18:43,505 WARN  [HDScanner] Failed to process changes
      org.jboss.deployers.client.spi.IncompleteDeploymentException: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS):

       

      *** DEPLOYMENTS IN ERROR: Name -> Error

       

      vfszip:/C:/Architecture_POC/jboss-5.1.0.GA/server/default/deploy/NewHelloEAR.ear/ -> org.jboss.deployers.spi.DeploymentException: Error during deploy: vfszip:/C:/Architecture_POC/jboss-5.1.0.GA/server/default/deploy/NewHelloEAR.ear/NewHelloWebRouter.war/

       


      DEPLOYMENTS IN ERROR:
        Deployment "vfszip:/C:/Architecture_POC/jboss-5.1.0.GA/server/default/deploy/NewHelloEAR.ear/" is in error due to the following reason(s): org.jboss.ws.WSException: Invalid wsdlFile 'vfszip:/C:/Architecture_POC/jboss-5.1.0.GA/server/default/deploy/NewHelloEAR.ear/NewHelloWebRouter.war/META-INF/wsdl/HelloService.wsdl', expected in: WEB-INF/wsdl/

       

          at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:993)
          at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:939)
          at org.jboss.deployers.plugins.main.MainDeployerImpl.checkComplete(MainDeployerImpl.java:873)
          at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.checkComplete(MainDeployerAdapter.java:128)
          at org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDScanner.java:369)
          at org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java:255)
          at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:417)
          at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:280)
          at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:135)
          at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:65)
          at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:146)
          at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:170)
          at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:651)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:676)
          at java.lang.Thread.run(Thread.java:595)

       

      Did anyone faced the same problem?

      I tried to place the wsdls in WEB-INF directory as mentioned in above exception stack trace, but no success.

      How do we put a common wsdl across EJB and Web project (as defined in wsdlLocation)?

       

      Thanks,

      Sagar

        • 1. Re: Jboss Native - EJB based Webservice top down approach

          Yes, I have the same issue as you mentioned below. As an alternative, I tried keeping the wsdl in WEB-INF and changed the wsdlLocation in endpoint interface and deployed the EAR. The below error I am getting.

           

          Caused by: org.jboss.ws.WSException: Cannot build meta data: Could not find META-INF/wsdl/HelloWorld.wsdl in the additional metadatafiles!

                      at org.jboss.ws.WSException.rethrow(WSException.java:60)

                      at org.jboss.ws.metadata.builder.jaxws.JAXWSWebServiceMetaDataBuilder.buildWebServiceMetaData(JAXWSWebServiceMetaDataBuilder.java:226)

                      at org.jboss.ws.metadata.builder.jaxws.JAXWSServerMetaDataBuilder.setupProviderOrWebService(JAXWSServerMetaDataBuilder.java:50)

                      at org.jboss.ws.metadata.builder.jaxws.JAXWSMetaDataBuilderJSE.buildMetaData(JAXWSMetaDataBuilderJSE.java:62)

                      at org.jboss.wsf.stack.jbws.UnifiedMetaDataDeploymentAspect.start(UnifiedMetaDataDeploymentAspect.java:64)

                      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)

           

           

           

          Would be appreciated if any guidance on this issue?

           

          Regards

          Shashidhar Reddy

          • 2. Jboss Native - EJB based Webservice top down approach
            jshepher

            If you are top-down development of a web service, from an existing WSDL, you should use the documentation [0], to generate the webservice. Then if you are trying to deploy that webservice as a war file, you should use the webservice annotations on your web service implementation like below [1].

             

            Some people have had trouble getting their namespaces to work without specifying the "wsdlLocation" attribute of the WebSerivce annotation. In that case you will need to place the generated WSDL in /WEB-INF/wsdl/ and reference it like this:


            @WebService( name="ExampleService",      targetNamespace="http://www.jboss.com/exampe/ws",      wsdlLocation="/WEB-INF/wsdl/generated.wsdl")

             

             

            [0] http://docs.jboss.org/jbossas/docs/Administration_And_Configuration_Guide/5/html_single/index.html#d0e1664

             

            [1]

            import javax.jws.WebMethod;
            import javax.jws.WebParam;
            import javax.jws.WebService;

             


            @WebService(name = "ExampleService", targetNamespace = "http://www.jboss.com/example/ws",
                    wsdlLocation="/WEB-INF/wsdl/generated.wsdl")
            public class Echo {

             

                @WebMethod
                public String echo(
                    @WebParam(name = "msg")
                    String msg){
                        return msg;
                }

             

            }