Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

InstanceAlreadyExistsException when deploying multiple versions of the same persistence unit  RSS feed

Nick Stolwijk
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to deploy 2 war files to the same JBoss instance, but each one uses the same domain jar file (included in the war file) and thus the same persistence unit.

JBoss fails to deploy these two war files together with the following:

2010-04-28 15:41:15,199 WARN [org.jboss.deployers.structure.spi.helpers.AbstractDeploymentContext] (main) Unable to register deployment mbean org.jboss.metadata.jpa.spec.PersistenceUnitMetaData.MyPersistenceUnit jboss.deployment:id="org.jboss.metadata.jpa.spec.PersistenceUnitMetaData.MyPersistenceUnit",type=Component already registered.

2010-04-28 15:41:15,206 WARN [org.jboss.deployers.structure.spi.helpers.AbstractDeploymentContext] (main) Unable to register deployment mbean persistence.unit:unitName=#MyPersistenceUnit jboss.deployment:id="persistence.unit:unitName=#MyPersistenceUnit",type=Component already registered.

2010-04-28 15:41:15,225 ERROR [org.jboss.kernel.plugins.dependency.AbstractKernelController] (main) Error installing to Real: name=vfszip:/opt/jboss-5.1.0.GA/server/myserver/deploy/my-second-war-2.2.0-SNAPSHOT.war/ state=PreReal mode=Manual requiredState=Real
org.jboss.deployers.spi.DeploymentException: Error deploying: persistence.unit:unitName=#MyPersistenceUnit

According to this thread the warnings can be ignored and the app should deploy regardless. However, in my instance, this warning also results in an error and the second war isn't deployed.

Is it somehow possible to deploy two war files with the same persistence unit in one JBoss instance?
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!