1 Reply Latest reply on Mar 12, 2012 9:49 PM by jaikiran

    DuplicateServiceException, Service jboss.security.jacc.... is already registered

    lafr

      I'm using JBoss AS 7.1.1.Final.

       

      I deployed my application packed as an ear file a second time with different name.

      I need for instance to deploy a prod.ear and a test.ear. Same content and modules, different database in persistence.xml.

       

      But the second deploy fails with DuplicateServiceException for each web-module in the ear.

      Example stack trace further down below.

       

      The war-modules contains only the webservice classes and a web.xml file like this one:

      <web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

          xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">        

              <servlet>                                                                                                    

                      <servlet-name>StockManagementWS</servlet-name>                                                       

                      <servlet-class>biz.mbisoftware.fn.ws.inventory.StockManagementWS</servlet-class>                     

              </servlet>                                                                                                   

              <servlet-mapping>                                                                                            

                      <servlet-name>StockManagementWS</servlet-name>                                                       

                      <url-pattern>/StockManagementWS</url-pattern>                                                        

              </servlet-mapping>                                                                                           

      </web-app>                                                                                                          

       

      Why this name collision?

      Why does the ear-name not appear in the name to make it unique?

      Did not have this problems with version <= 6.1.1.

       

      18:43:00,518 ERROR [org.jboss.msc.service.fail#startFailed] MSC00001: Failed to start service jboss.deployment.subunit."fmw2e-ifx115.ear"."ws-core.war".INSTALL: org.jboss.msc.service.StartException in service jboss.deployment.subunit."fmw2e-ifx115.ear"."ws-core.war".INSTALL: Failed to process phase INSTALL of subdeployment "ws-core.war" of deployment "fmw2e-ifx115.ear"                        

          at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:119) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]                                                                                                              

          at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]                                                                                                                           

          at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

          at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_27]                       

          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_27]                           

          at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_27]                                                                     

      Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS018027: Failed to add JBoss Web deployment service

          at org.jboss.as.web.deployment.WarDeploymentProcessor.processDeployment(WarDeploymentProcessor.java:320)                       

          at org.jboss.as.web.deployment.WarDeploymentProcessor.deploy(WarDeploymentProcessor.java:114)                                  

          at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:113) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]                                                                                                              

          ... 5 more                                                                                                                     

      Caused by: org.jboss.msc.service.DuplicateServiceException: Service jboss.security.jacc."ws-core.war" is already registered        

          at org.jboss.msc.service.ServiceRegistrationImpl.setInstance(ServiceRegistrationImpl.java:154) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

          at org.jboss.msc.service.ServiceControllerImpl.startInstallation(ServiceControllerImpl.java:227) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]                                                                                                                                 

          at org.jboss.msc.service.ServiceContainerImpl.install(ServiceContainerImpl.java:560) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]         

          at org.jboss.msc.service.ServiceTargetImpl.install(ServiceTargetImpl.java:201) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]               

          at org.jboss.msc.service.ServiceControllerImpl$ChildServiceTarget.install(ServiceControllerImpl.java:2228) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]                                                                                                                       

          at org.jboss.msc.service.ServiceTargetImpl.install(ServiceTargetImpl.java:201) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]               

          at org.jboss.msc.service.ServiceControllerImpl$ChildServiceTarget.install(ServiceControllerImpl.java:2228) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]                                                                                                                       

          at org.jboss.msc.service.ServiceBuilderImpl.install(ServiceBuilderImpl.java:307) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]             

          at org.jboss.as.web.deployment.WarDeploymentProcessor.processDeployment(WarDeploymentProcessor.java:317)                       

          ... 7 more