Uploaded image for project: 'JBoss Enterprise Application Platform 4 and 5'
  1. JBoss Enterprise Application Platform 4 and 5
  2. JBPAPP-7167

JBoss EAP 5.x throws javax.naming.NameAlreadyBoundException: classPathEntries

    XMLWordPrintable

Details

    • Bug
    • Resolution: Obsolete
    • Major
    • TBD EAP 5
    • EAP 5.0.0
    • Naming
    • None
    • Hide

      1). Deploy the Attached two SAR files in the same JBoss profile.
      2). Both the SAR files contains a Comman JAR file which has META-INF/MANIFEST.MF file with the attribute "Main-Class: test.TestClass"
      3). As soon as we start the JBoss instance we will be able to see the following Exception:

      09:46:54,656 ERROR [Ejb3ClientDeployer] Could not deploy vfszip:/home/someuser/jboss-eap-5.0.0/jboss-as/server/default_profile/deploy/SimpleSarTwo.sar/commonUtil.jar/
      javax.naming.NameAlreadyBoundException: classPathEntries
      at org.jnp.server.NamingServer.bind(NamingServer.java:209)
      at org.jnp.server.NamingServer.bind(NamingServer.java:167)
      at org.jnp.interfaces.NamingContext.bind(NamingContext.java:650)
      at org.jnp.interfaces.NamingContext.bind(NamingContext.java:611)
      at org.jboss.ejb3.deployers.Ejb3ClientDeployer.deploy(Ejb3ClientDeployer.java:150)
      at org.jboss.ejb3.deployers.Ejb3ClientDeployer.deploy(Ejb3ClientDeployer.java:61)
      at org.jboss.deployers.vfs.spi.deployer.AbstractSimpleVFSRealDeployer.deploy(AbstractSimpleVFSRealDeployer.java:56)

      Show
      1). Deploy the Attached two SAR files in the same JBoss profile. 2). Both the SAR files contains a Comman JAR file which has META-INF/MANIFEST.MF file with the attribute "Main-Class: test.TestClass" 3). As soon as we start the JBoss instance we will be able to see the following Exception: 09:46:54,656 ERROR [Ejb3ClientDeployer] Could not deploy vfszip:/home/someuser/jboss-eap-5.0.0/jboss-as/server/default_profile/deploy/SimpleSarTwo.sar/commonUtil.jar/ javax.naming.NameAlreadyBoundException: classPathEntries at org.jnp.server.NamingServer.bind(NamingServer.java:209) at org.jnp.server.NamingServer.bind(NamingServer.java:167) at org.jnp.interfaces.NamingContext.bind(NamingContext.java:650) at org.jnp.interfaces.NamingContext.bind(NamingContext.java:611) at org.jboss.ejb3.deployers.Ejb3ClientDeployer.deploy(Ejb3ClientDeployer.java:150) at org.jboss.ejb3.deployers.Ejb3ClientDeployer.deploy(Ejb3ClientDeployer.java:61) at org.jboss.deployers.vfs.spi.deployer.AbstractSimpleVFSRealDeployer.deploy(AbstractSimpleVFSRealDeployer.java:56)
    • Workaround Exists
    • Hide

      Option-1). Either we can remove the "Main-Class" attribute from your JAR file "CommonUtil.jar" and then deploy your SAR files.

      Option-2). If we don't want to edit the Jar file "CommonUtil.jar" to remove the Main-Class attribute from it's MANIFEST.MF file then we need to make sure that only one copy of the JAR is available to the JBoss Deployer, as a Library. It means you can place the JAR file inside "$PROFILE/lib" directory rather than putting it inside two different SAR files. So if we put JAR file inside "$PROFILE/lib" then it will be available for both the SAR files, without duplication.

      Show
      Option-1). Either we can remove the "Main-Class" attribute from your JAR file "CommonUtil.jar" and then deploy your SAR files. Option-2). If we don't want to edit the Jar file "CommonUtil.jar" to remove the Main-Class attribute from it's MANIFEST.MF file then we need to make sure that only one copy of the JAR is available to the JBoss Deployer, as a Library. It means you can place the JAR file inside "$PROFILE/lib" directory rather than putting it inside two different SAR files. So if we put JAR file inside "$PROFILE/lib" then it will be available for both the SAR files, without duplication.
    • NEW

    Description

      In EAP 5.0.0, When two SAR files are deployed in the same JBoss EAPinstance, then we get "javax.naming.NameAlreadyBoundException: classPathEntries" at the time of second SAR file deployment, If both the Jars contains the same Jar file which has META-INF/MANIFEST.MF file with "Main-Class" attribute.
      If we try to deploy these SAR files then we get following exception as soon as the second SAR deployment begins:

      09:46:54,656 ERROR [Ejb3ClientDeployer] Could not deploy vfszip:/home/someuser/jboss-eap-5.0.0/jboss-as/server/default_profile/deploy/SimpleSarTwo.sar/commonUtil.jar/
      javax.naming.NameAlreadyBoundException: classPathEntries
      at org.jnp.server.NamingServer.bind(NamingServer.java:209)
      at org.jnp.server.NamingServer.bind(NamingServer.java:167)
      at org.jnp.interfaces.NamingContext.bind(NamingContext.java:650)
      at org.jnp.interfaces.NamingContext.bind(NamingContext.java:611)
      at org.jboss.ejb3.deployers.Ejb3ClientDeployer.deploy(Ejb3ClientDeployer.java:150)
      at org.jboss.ejb3.deployers.Ejb3ClientDeployer.deploy(Ejb3ClientDeployer.java:61)
      at org.jboss.deployers.vfs.spi.deployer.AbstractSimpleVFSRealDeployer.deploy(AbstractSimpleVFSRealDeployer.java:56)

      ***NOTE*** The same SAR files gets deployed successfully on JBoss EAP 4.3.
      And there is a difference in the "Ejb3ClientDeployer.java" API of JBoss in both the versions which seems to be causing the issue:

      JBOss EAP4.3 :
      http://anonsvn.jboss.org/repos/jbossas/tags/JBPAPP_4_3_0_GA_CP08/ejb3/src/main/org/jboss/ejb3/deployers/Ejb3ClientDeployer.java

      JBoss EAP 5.0.0 :
      http://anonsvn.jboss.org/repos/jbossas/tags/JBPAPP_5_0_0_GA/ejb3/src/main/org/jboss/ejb3/deployers/Ejb3ClientDeployer.java

      Attachments

        Activity

          People

            Unassigned Unassigned
            jaysensharma Jay SenSharma (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: