2 Replies Latest reply on Jan 21, 2014 3:15 AM by Shane Smith

    two ejb jar files with same name in different EAR projects conflict with each other on jboss 7.1

    Shane Smith Newbie

      I'm migrating projects from Jboss 5.1 to jboss 7.1

      I have two EARs, which run on the same Jboss. They contain ejb project inside and both ejb jar files are called  services.jar due to <finalname> tag in EJB_PROJECT/pom.xml

       

      On Jboss 5.1 it worked fine, but now i get error :

       

      18:07:16,858 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-7) MSC00001: Failed to start service jboss.deployment.subunit."my1.ear"."services.jar".INSTALL: org.jboss.msc.service.StartException in service jboss.deployment.subunit."my1.ear"."services.jar".INSTALL: Failed to process phase INSTALL of subdeployment "services.jar" of deployment "my1.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.runWorker(Unknown Source) [rt.jar:1.7.0_45]
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [rt.jar:1.7.0_45]
          at java.lang.Thread.run(Unknown Source) [rt.jar:1.7.0_45]
      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.web.deployment.default-host./services.realm 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:269)
          ... 7 more
      

       

      Is there a way to make this work without changing <finalname> value? If I change it, then url to my application changes and i don't want that.

        • 1. Re: two ejb jar files with same name in different EAR projects conflict with each other on jboss 7.1
          Wolf-Dieter Fink Master

          From the message it looks more like a web application related problem.

          Could you show the structure of your application?

          • 2. Re: Re: two ejb jar files with same name in different EAR projects conflict with each other on jboss 7.1
            Shane Smith Newbie

            If it's project related problem, then why do these projects work separately ?

            if I remove one of those projects, another one gets deployed normally. Only in case I put both,I get that error ...

             

            Also if I rename one of the ejb jar files and call it services1 for example, they both work ok.

             

            Here's pom.xml files for one of those 2 projects. They both have similar structure.

             

            outermost/pom.xml


            <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
                <modelVersion>4.0.0</modelVersion>
                <groupId>com.my</groupId>
                <version>2.0</version>
                <artifactId>project</artifactId>
                <packaging>pom</packaging>
                <name>project</name>
                <modules>
                    <module>my1-ejb</module>
                    <module>my1-ear</module>
                </modules>
                <build>
                    <pluginManagement>
                        <plugins>
                            <plugin>
                                <groupId>org.apache.maven.plugins</groupId>
                                <artifactId>maven-compiler-plugin</artifactId>
                                <configuration>
                                    <source>1.7</source>
                                    <target>1.7</target>
                                </configuration>
                            </plugin>
                            <plugin>
                                <groupId>org.apache.maven.plugins</groupId>
                                <artifactId>maven-eclipse-plugin</artifactId>
                                <version>2.8</version>
                                <configuration>
                                    <projectNameTemplate>
                                        [artifactId]-[version]
                                    </projectNameTemplate>
                                    <wtpmanifest>true</wtpmanifest>
                                    <wtpapplicationxml>true</wtpapplicationxml>
                                    <wtpversion>2.0</wtpversion>
                                    <manifest>
                                        ${basedir}/src/main/resources/META-INF/MANIFEST.MF
                                    </manifest>                                            
                                </configuration>
                            </plugin>                
                        </plugins>
                    </pluginManagement>
                </build>
                <dependencies>
                    ......
                </dependencies>
                <repositories>
                    ........
                </repositories>
            </project>
            

             

            EAR/pom.xml

             

            <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
                <modelVersion>4.0.0</modelVersion>
                <groupId>com.my</groupId>
                <artifactId>my1-ear</artifactId>
                <packaging>ear</packaging>
                <version>2.0</version>   
                <build>
                    <finalName>my1</finalName>
                    <plugins>
                        <plugin>
                            <groupId>org.apache.maven.plugins</groupId>
                            <artifactId>maven-ear-plugin</artifactId>
                            <configuration>
                                <displayName>my1-ear</displayName>
                                <version>5</version>
                                <defaultLibBundleDir>lib</defaultLibBundleDir>
                                <modules>
                                    <ejbModule>
                                        <groupId>com.my</groupId>
                                        <artifactId>my1-ejb</artifactId>
                                    </ejbModule>                                               
                                </modules>
                            </configuration>
                        </plugin>
                    </plugins>
                </build>
                <parent>
                    <groupId>com.my</groupId>
                    <artifactId>project</artifactId>
                    <version>2.0</version>
                </parent>
                <dependencies>
                    <dependency>
                        <groupId>com.my</groupId>
                        <artifactId>my1-ejb</artifactId>
                        <version>${pom.version}</version>
                        <type>ejb</type>
                    </dependency>
                </dependencies>
            </project>
            

             

             

            EJB/pom.xml

             

            <?xml version="1.0" encoding="UTF-8"?>
            <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
                <parent>
                    <groupId>com.my<</groupId>
                    <artifactId>project</artifactId>
                    <version>2.0</version>
                </parent>
                <modelVersion>4.0.0</modelVersion>
                <groupId>com.my<</groupId>
                <artifactId>my1-ejb</artifactId>
                <packaging>ejb</packaging>
                <version>2.0</version>    
                <build>
                    <finalName>services</finalName>
                    <plugins>
                        <plugin>
                            <groupId>org.apache.maven.plugins</groupId>
                            <artifactId>maven-ejb-plugin</artifactId>
                            <configuration>
                                <ejbVersion>3.0</ejbVersion>
                            </configuration>
                        </plugin>
                        <plugin>
                            <groupId>org.apache.maven.plugins</groupId>
                            <artifactId>maven-surefire-plugin</artifactId>
                            <version>2.8.1</version>
                            <configuration>
                                <skipTests>true</skipTests>
                            </configuration>
                        </plugin>
                    </plugins>
                </build>
                <dependencies>
                    .......
                </dependencies>
            </project>