5 Replies Latest reply on Aug 18, 2011 4:25 AM by Jeremy Whiting

    WebService endpoint and WAR module causes DuplicateServiceException

    Jeremy Whiting Expert

      Hi,

       

      I am migrating an EAR used for benchmarking from AS6 to AS7. The EAR contains an ejb3 JAR and a WAR archive amongst other things. There is one EJB annotated to present a webservice endpoint named WorkOrderSessionService. The contents of the EAR looks like this

       

      $ jar -tf target/jar/specj.ear
      META-INF/
      META-INF/MANIFEST.MF
      specj.jar
      lib/
      META-INF/application.xml
      lib/generated-ws-buyer.jar
      specj.war
      supplier.war

       

      When deployed using the CLI to AS7.1 based on the master branch (as of 16 Aug 2011) in Git the deployment fails. It appears the specj.war is being deployed with a context root of /specj which is identical to the web service context root. The AS7 console output is

       

      .....
      06:48:15,084 INFO  [org.jboss.wsf.stack.cxf.deployment.aspect.DescriptorDeploymentAspect] (MSC service thread 1-31) Spring not available, skipping check for user provided jbossws-cxf.xml / cxf.xml configuration files.
      06:48:15,088 INFO  [org.jboss.wsf.stack.cxf.metadata.MetadataBuilder] (MSC service thread 1-31) Add Service
      id=WorkOrderSession
      address=http://localhost:8080/specj/WorkOrderSessionService/WorkOrderSession
      implementor=org.spec.jent.ejb.mfg.session.WorkOrderSession
      invoker=org.jboss.wsf.stack.cxf.JBossWSInvoker
      serviceName={http://session.mfg.ejb.jent.spec.org/}WorkOrderSessionService
      portName={http://session.mfg.ejb.jent.spec.org/}WorkOrderSessionPort
      wsdlLocation=META-INF/wsdl/WorkOrderSessionService.wsdl
      mtomEnabled=false
      06:48:15,089 INFO  [org.jboss.ws.common.management.DefaultEndpointRegistry] (MSC service thread 1-31) register: jboss.ws:context=specj,endpoint=WorkOrderSession
      06:48:15,214 INFO  [org.apache.cxf.service.factory.ReflectionServiceFactoryBean] (MSC service thread 1-31) Creating Service {http://session.mfg.ejb.jent.spec.org/}WorkOrderSessionService from WSDL: META-INF/wsdl/WorkOrderSessionService.wsdl
      06:48:15,288 WARN  [org.jboss.wsf.stack.cxf.resolver.JBossWSResourceResolver] (MSC service thread 1-31) Cannot resolve resource: cxf
      06:48:15,600 INFO  [org.apache.cxf.endpoint.ServerImpl] (MSC service thread 1-31) Setting the server's publish address to be http://localhost:8080/specj/WorkOrderSessionService/WorkOrderSession
      06:48:15,606 WARN  [org.jboss.wsf.stack.cxf.resolver.JBossWSResourceResolver] (MSC service thread 1-31) Cannot resolve resource: cxf
      06:48:15,625 INFO  [org.jboss.wsf.stack.cxf.deployment.WSDLFilePublisher] (MSC service thread 1-31) WSDL published to: file:/home/benchuser/java/jboss/jboss-as-7.1.0.Alpha1-SNAPSHOT-full/standalone/data/wsdl/specj.ear/specj.jar/WorkOrderSessionService.wsdl
      06:48:15,916 WARN  [org.jboss.wsf.stack.cxf.resolver.JBossWSResourceResolver] (MSC service thread 1-31) Cannot resolve resource: org.apache.cxf.ws.rm.RMManager/bus
      06:48:15,922 INFO  [org.jboss.ws.common.management.DefaultEndpointRegistry] (MSC service thread 1-31) remove: jboss.ws:context=specj,endpoint=WorkOrderSession
      06:48:15,923 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-31) MSC00001: Failed to start service jboss.deployment.subunit."specj.ear"."specj.jar".INSTALL: org.jboss.msc.service.StartException in service jboss.deployment.subunit."specj.ear"."specj.jar".INSTALL: Failed to process phase INSTALL of subdeployment "specj.jar" of deployment "specj.ear"
          at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:121)
          at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1765)
          at org.jboss.msc.service.ServiceControllerImpl$ClearTCCLTask.run(ServiceControllerImpl.java:2291)
          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [:1.6.0_20]
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [:1.6.0_20]
          at java.lang.Thread.run(Thread.java:636) [:1.6.0_20]
      Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: Failed to add JBoss web deployment service
          at org.jboss.as.web.deployment.WarDeploymentProcessor.processDeployment(WarDeploymentProcessor.java:247)
          at org.jboss.as.web.deployment.WarDeploymentProcessor.deploy(WarDeploymentProcessor.java:110)
          at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:115)
          ... 5 more
      Caused by: org.jboss.msc.service.DuplicateServiceException: Service jboss.web.deployment.default-host./specj.realm is already registered
          at org.jboss.msc.service.ServiceRegistrationImpl.setInstance(ServiceRegistrationImpl.java:154)
          at org.jboss.msc.service.ServiceControllerImpl.startInstallation(ServiceControllerImpl.java:226)
          at org.jboss.msc.service.ServiceContainerImpl.install(ServiceContainerImpl.java:560)
          at org.jboss.msc.service.ServiceTargetImpl.install(ServiceTargetImpl.java:201)
          at org.jboss.msc.service.ServiceControllerImpl$ChildServiceTarget.install(ServiceControllerImpl.java:2194)
          at org.jboss.msc.service.ServiceTargetImpl.install(ServiceTargetImpl.java:201)
          at org.jboss.msc.service.ServiceControllerImpl$ChildServiceTarget.install(ServiceControllerImpl.java:2194)
          at org.jboss.msc.service.ServiceBuilderImpl.install(ServiceBuilderImpl.java:307)
          at org.jboss.as.web.deployment.WarDeploymentProcessor.processDeployment(WarDeploymentProcessor.java:215)
          ... 7 more

       

      06:48:16,161 INFO  [org.jboss.as.server.controller] (pool-2-thread-5) Deployment of "specj.ear" was rolled back with failure message {"Failed services" => {" ..... etc
      06:48:16,174 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-14) Stopped deployment specj.jar in 16ms
      06:48:16,174 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-12) Stopped deployment supplier.war in 16ms
      06:48:16,178 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-9) Stopped deployment specj.war in 19ms
      06:48:16,179 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-9) Stopped deployment specj.ear in 21ms

       


      By comparing it with AS6 console output for the same app you will notice the webservice is deployed with a context root of /specj-specj allowing the WAR to complete deployment.

       


      2011-02-22 12:21:18,198 INFO  [org.jboss.wsf.stack.cxf.metadata.MetadataBuilder] (HDScanner) Add Service
      id=WorkOrderSession
      address=http://localhost:8080/specj-specj/WorkOrderSession
      implementor=org.spec.jent.ejb.mfg.session.WorkOrderSession
      invoker=org.jboss.wsf.stack.cxf.InvokerEJB3
      serviceName={http://session.mfg.ejb.jent.spec.org/}WorkOrderSessionService
      portName={http://session.mfg.ejb.jent.spec.org/}WorkOrderSessionPort
      wsdlLocation=META-INF/wsdl/WorkOrderSessionService.wsdl
      mtomEnabled=false
      2011-02-22 12:21:18,357 INFO  [org.apache.cxf.service.factory.ReflectionServiceFactoryBean] (HDScanner) Creating Service {http://session.mfg.ejb.jent.spec.org/}WorkOrderSessionService from WSDL: META-INF/wsdl/WorkOrderSessionService.wsdl
      2011-02-22 12:21:18,601 INFO  [org.jboss.wsf.stack.cxf.transport.AddressRewritingEndpointInfo] (HDScanner) Setting new service endpoint address in wsdl: REPLACE_WITH_ACTUAL_URL
      2011-02-22 12:21:18,991 INFO  [org.jboss.wsf.stack.cxf.transport.AddressRewritingEndpointInfo] (HDScanner) Setting new service endpoint address in wsdl: http://localhost:8080/specj-specj/WorkOrderSession
      2011-02-22 12:21:19,045 INFO  [org.apache.cxf.endpoint.ServerImpl] (HDScanner) Setting the server's publish address to be http://localhost:8080/specj-specj/WorkOrderSession
      2011-02-22 12:21:19,134 INFO  [org.jboss.wsf.stack.cxf.deployment.WSDLFilePublisher] (HDScanner) WSDL published to: file:/opt/jboss-6.0.0.Final/server/all/data/wsdl/specj.ear/specj.jar/WorkOrderSessionService.wsdl

       

      Should the web service deployer in AS7 be detecting when a deployment web context is not unique ?

       

      Regards,
      Jeremy