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

PersistenceUnitMetaData mbean id's are not container name specific.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Obsolete
    • Icon: Major Major
    • TBD EAP 5
    • EAP 5.0.0, EAP 5.0.1, EAP_EWP 5.1.0
    • EJB, System
    • Fedora 12 32b, Sun/Oracle JDK1.6, JBossEAP 5.1

    • Hide

      1. Create a jar containing a META-INF/persistence.xml file.
      2. Set the persistence-unit@name attribute to 'test'.
      3. Wrap the jar inside an ear archive -> 'foo.ear'
      4. Deploy the ear to jBoss -> works ok.
      5. Rename the ear to 'bar.ear'
      6. Deploy to jBoss -> javax.management.InstanceAlreadyExistsException is thrown, stack trace follows:

      16:29:05,285 WARN [AbstractDeploymentContext] Unable to register deployment mbean org.jboss.metadata.jpa.spec.PersistenceUnitMetaData.test
      javax.management.InstanceAlreadyExistsException: jboss.deployment:id="org.jboss.metadata.jpa.spec.PersistenceUnitMetaData.test",type=Component already registered.
      at org.jboss.mx.server.registry.BasicMBeanRegistry.add(BasicMBeanRegistry.java:767)
      at org.jboss.mx.server.registry.BasicMBeanRegistry.registerMBean(BasicMBeanRegistry.java:236)
      at sun.reflect.GeneratedMethodAccessor90.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
      at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:138)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:90)
      at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:140)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:90)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
      at org.jboss.mx.server.MBeanServerImpl$3.run(MBeanServerImpl.java:1431)

      Show
      1. Create a jar containing a META-INF/persistence.xml file. 2. Set the persistence-unit@name attribute to 'test'. 3. Wrap the jar inside an ear archive -> 'foo.ear' 4. Deploy the ear to jBoss -> works ok. 5. Rename the ear to 'bar.ear' 6. Deploy to jBoss -> javax.management.InstanceAlreadyExistsException is thrown, stack trace follows: 16:29:05,285 WARN [AbstractDeploymentContext] Unable to register deployment mbean org.jboss.metadata.jpa.spec.PersistenceUnitMetaData.test javax.management.InstanceAlreadyExistsException: jboss.deployment:id="org.jboss.metadata.jpa.spec.PersistenceUnitMetaData.test",type=Component already registered. at org.jboss.mx.server.registry.BasicMBeanRegistry.add(BasicMBeanRegistry.java:767) at org.jboss.mx.server.registry.BasicMBeanRegistry.registerMBean(BasicMBeanRegistry.java:236) at sun.reflect.GeneratedMethodAccessor90.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157) at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96) at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:138) at org.jboss.mx.server.Invocation.invoke(Invocation.java:90) at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:140) at org.jboss.mx.server.Invocation.invoke(Invocation.java:90) at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264) at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668) at org.jboss.mx.server.MBeanServerImpl$3.run(MBeanServerImpl.java:1431)
    • Workaround Exists
    • Hide

      Make persistence unit names unique across the entire app server

      Show
      Make persistence unit names unique across the entire app server
    • Hide
      CAUSE

      CONSEQUENCE

      FIX

      RESULT
      Show
      CAUSE CONSEQUENCE FIX RESULT
    • Not Required

      JBoss EAP 5.x doesn't support multiples persistence units with same name despite being in different war/ear packages

              rhn-engineering-cdewolf Carlo de Wolf
              rhn-support-alazarot Alessandro Lazarotti
              Russell Dickenson Russell Dickenson (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: