java.lang.IllegalStateException: WFLYJPA0068: Persistence unit 'module2.ear/ejb.jar#module2-pu' is not available

JBoss Issue Tracker | Юрий Витковский | 2 years ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    I have two EARs: {code} module1.ear | +--ejb.jar | +--META-INF | +--persistence.xml with persistence unit "module1-pu" {code} and {code} module2.ear | +--META-INF | | | +--jboss-all.xml | +--ejb.jar | +--META-INF | +--persistence.xml with persistence unit "module2-pu" {code} module2.ear/META-INF/jboss-all.xml contains: {code:xml} <jboss xmlns="urn:jboss:1.0"> <jboss-deployment-dependencies xmlns="urn:jboss:deployment-dependencies:1.0"> <dependency name="module1.ear" /> </jboss-deployment-dependencies> </jboss> {code} When I redeploy module1.ear, module2.ear not redeployed automatically with error: *java.lang.IllegalStateException: WFLYCTL0075: Duplicate resource module2.ear/ejb.jar#module2-pu* (on wildfly 8.2.0.Final: *java.lang.IllegalStateException: JBAS014666: Duplicate resource module2.ear/ejb.jar#module2-pu*) Full redeploy log: {code} 09:11:31,425 INFO [org.jboss.as.jpa] (ServerService Thread Pool -- 63) WFLYJPA0011: Stopping Persistence Unit (phase 2 of 2) Service 'module2.ear/ejb.jar#module2-pu' 09:11:31,426 INFO [org.jboss.as.jpa] (ServerService Thread Pool -- 63) WFLYJPA0011: Stopping Persistence Unit (phase 1 of 2) Service 'module2.ear/ejb.jar#module2-pu' 09:11:31,431 INFO [org.jboss.as.jpa] (ServerService Thread Pool -- 63) WFLYJPA0011: Stopping Persistence Unit (phase 2 of 2) Service 'module1.ear/ejb.jar#module1-pu' 09:11:31,434 INFO [org.jboss.as.jpa] (ServerService Thread Pool -- 63) WFLYJPA0011: Stopping Persistence Unit (phase 1 of 2) Service 'module1.ear/ejb.jar#module1-pu' 09:11:31,437 INFO [org.jboss.as.server.deployment] (MSC service thread 1-1) WFLYSRV0208: Stopped subdeployment (runtime-name: ejb.jar) in 17ms 09:11:31,438 INFO [org.jboss.as.server.deployment] (MSC service thread 1-2) WFLYSRV0028: Stopped deployment module1.ear (runtime-name: module1.ear) in 18ms 09:11:31,495 INFO [org.jboss.as.server] (management-handler-thread - 3) WFLYSRV0009: Undeployed "module1.ear" (runtime-name: "module1.ear") 09:11:31,495 INFO [org.jboss.as.controller] (management-handler-thread - 3) WFLYCTL0183: Service status report WFLYCTL0184: New missing/unsatisfied dependencies: service jboss.deployment.unit."module1.ear".deploymentCompleteService (missing) dependents: [service jboss.deployment.unit."module2.ear".PARSE, service jboss.deployment.subunit."module2.ear"."ejb.jar".PARSE] 09:11:31,558 INFO [org.jboss.as.repository] (management-handler-thread - 1) WFLYDR0002: Content removed from location /opt/wildfly/standalone/data/content/69/baf0eeab47c006bc1f3d99b21b4355fac62d13/content 09:11:43,170 INFO [org.jboss.as.repository] (management-handler-thread - 1) WFLYDR0001: Content added at location /opt/wildfly/standalone/data/content/69/baf0eeab47c006bc1f3d99b21b4355fac62d13/content 09:11:43,266 INFO [org.jboss.as.server.deployment] (MSC service thread 1-2) WFLYSRV0027: Starting deployment of "module1.ear" (runtime-name: "module1.ear") 09:11:43,268 INFO [org.jboss.as.server.deployment] (MSC service thread 1-2) WFLYSRV0207: Starting subdeployment (runtime-name: "ejb.jar") 09:11:43,273 INFO [org.jboss.as.jpa] (MSC service thread 1-1) WFLYJPA0002: Read persistence.xml for module1-pu 09:11:43,289 INFO [org.jboss.as.jpa] (ServerService Thread Pool -- 63) WFLYJPA0010: Starting Persistence Unit (phase 1 of 2) Service 'module1.ear/ejb.jar#module1-pu' 09:11:43,289 INFO [org.hibernate.jpa.internal.util.LogHelper] (ServerService Thread Pool -- 63) HHH000204: Processing PersistenceUnitInfo [ name: module1-pu ...] 09:11:43,292 INFO [org.jboss.as.jpa] (ServerService Thread Pool -- 63) WFLYJPA0010: Starting Persistence Unit (phase 2 of 2) Service 'module1.ear/ejb.jar#module1-pu' 09:11:43,293 INFO [org.hibernate.dialect.Dialect] (ServerService Thread Pool -- 63) HHH000400: Using dialect: org.hibernate.dialect.H2Dialect 09:11:43,293 WARN [org.hibernate.dialect.H2Dialect] (ServerService Thread Pool -- 63) HHH000431: Unable to determine H2 database version, certain features may not work 09:11:43,294 INFO [org.hibernate.hql.internal.ast.ASTQueryTranslatorFactory] (ServerService Thread Pool -- 63) HHH000397: Using ASTQueryTranslatorFactory 09:11:43,296 INFO [org.jboss.as.server.deployment] (MSC service thread 1-1) WFLYSRV0070: Deployment restart detected for deployment module2.ear, performing full redeploy instead. 09:11:43,296 INFO [org.jboss.as.server.deployment] (MSC service thread 1-1) WFLYSRV0070: Deployment restart detected for deployment ejb.jar, performing full redeploy instead. 09:11:43,296 INFO [org.jboss.as.server.deployment] (MSC service thread 1-1) WFLYSRV0208: Stopped subdeployment (runtime-name: ejb.jar) in 0ms 09:11:43,297 INFO [org.jboss.as.server.deployment] (MSC service thread 1-2) WFLYSRV0028: Stopped deployment module2.ear (runtime-name: module2.ear) in 1ms 09:11:43,298 INFO [org.jboss.as.server.deployment] (MSC service thread 1-2) WFLYSRV0027: Starting deployment of "module2.ear" (runtime-name: "module2.ear") 09:11:43,299 INFO [org.jboss.as.server.deployment] (MSC service thread 1-2) WFLYSRV0207: Starting subdeployment (runtime-name: "ejb.jar") 09:11:43,300 INFO [org.jboss.as.jpa] (MSC service thread 1-2) WFLYJPA0002: Read persistence.xml for module2-pu 09:11:43,307 INFO [org.jboss.as.jpa] (ServerService Thread Pool -- 63) WFLYJPA0010: Starting Persistence Unit (phase 1 of 2) Service 'module2.ear/ejb.jar#module2-pu' 09:11:43,308 INFO [org.hibernate.jpa.internal.util.LogHelper] (ServerService Thread Pool -- 63) HHH000204: Processing PersistenceUnitInfo [ name: module2-pu ...] 09:11:43,312 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-4) MSC000001: Failed to start service jboss.deployment.subunit."module2.ear"."ejb.jar".INSTALL: org.jboss.msc.service.StartException in service jboss.deployment.subunit."module2.ear"."ejb.jar".INSTALL: WFLYSRV0153: Failed to process phase INSTALL of subdeployment "ejb.jar" of deployment "module2.ear" at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:163) at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948) at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) Caused by: java.lang.IllegalStateException: WFLYCTL0075: Duplicate resource module2.ear/ejb.jar#module2-pu at org.jboss.as.controller.registry.AbstractModelResource$DefaultResourceProvider.register(AbstractModelResource.java:248) at org.jboss.as.controller.registry.AbstractModelResource.registerChild(AbstractModelResource.java:143) at org.jboss.as.jpa.processor.PersistenceUnitServiceHandler.addManagementConsole(PersistenceUnitServiceHandler.java:1128) at org.jboss.as.jpa.processor.PersistenceUnitServiceHandler.deployPersistenceUnitPhaseTwo(PersistenceUnitServiceHandler.java:704) at org.jboss.as.jpa.processor.PersistenceUnitServiceHandler.addPuService(PersistenceUnitServiceHandler.java:289) at org.jboss.as.jpa.processor.PersistenceUnitServiceHandler.handleJarDeployment(PersistenceUnitServiceHandler.java:162) at org.jboss.as.jpa.processor.PersistenceUnitServiceHandler.deploy(PersistenceUnitServiceHandler.java:133) at org.jboss.as.jpa.processor.PersistenceCompleteInstallProcessor.deploy(PersistenceCompleteInstallProcessor.java:55) at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:156) ... 5 more 09:11:43,376 INFO [org.jboss.as.server] (management-handler-thread - 2) WFLYSRV0010: Deployed "module1.ear" (runtime-name : "module1.ear") 09:11:43,376 INFO [org.jboss.as.controller] (management-handler-thread - 2) WFLYCTL0183: Service status report WFLYCTL0184: New missing/unsatisfied dependencies: service jboss.deployment.subunit."module2.ear"."ejb.jar" (unavailable) dependents: [service jboss.deployment.unit."module2.ear".PARSE] service jboss.deployment.subunit."module2.ear"."ejb.jar".STRUCTURE (unavailable) dependents: [service jboss.deployment.unit."module2.ear".PARSE] service jboss.deployment.subunit."module2.ear"."ejb.jar".deploymentCompleteService (missing) dependents: [service jboss.deployment.unit."module2.ear".deploymentCompleteService] WFLYCTL0185: Newly corrected services: service jboss.deployment.unit."module1.ear".deploymentCompleteService (new available) WFLYCTL0186: Services which failed to start: service jboss.deployment.subunit."module2.ear"."ejb.jar".INSTALL: org.jboss.msc.service.StartException in service jboss.deployment.subunit."module2.ear"."ejb.jar".INSTALL: WFLYSRV0153: Failed to process phase INSTALL of subdeployment "ejb.jar" of deployment "module2.ear" {code}

    JBoss Issue Tracker | 2 years ago | Юрий Витковский
    java.lang.IllegalStateException: WFLYJPA0068: Persistence unit 'module2.ear/ejb.jar#module2-pu' is not available
  2. 0

    JBossWildFly Unexpected gathering statistics:persistence unit is not available

    Stack Overflow | 1 month ago | slomilll
    java.lang.IllegalStateException: WFLYJPA0068: Persistence unit 'ChatAppAGENTIEAR.ear/ChatAppAGENTI.war#WebShop' is not available
  3. 0

    com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 'day0_.calendar_id' in 'field list'

    Stack Overflow | 2 years ago | Flojoe
    java.lang.IllegalStateException: JBAS011477: Persistence unit 'Calendar-2dv012.war#Calendar-2dv012' is not available
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Hibernate error when add @Entity

    Stack Overflow | 3 years ago | user3284660
    java.lang.IllegalStateException: JBAS011477: Persistence unit 'Projeto01.war#cartorio' is not available
  6. 0

    Criando uma aplicação corporativa em Java – Parte 1

    com.br | 9 months ago
    java.lang.IllegalStateException: JBAS011477: Persistence unit 'gerenciador-de-biblioteca.war#bibliotecaPersistence' is not available
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. java.lang.IllegalStateException

    WFLYJPA0068: Persistence unit 'module2.ear/ejb.jar#module2-pu' is not available

    at org.jboss.as.jpa.management.EntityManagerFactoryLookup.entityManagerFactory()
  2. JPA
    EntityManagerFactoryLookup.entityManagerFactory
    1. org.jboss.as.jpa.management.EntityManagerFactoryLookup.entityManagerFactory(EntityManagerFactoryLookup.java:43)
    1 frame
  3. org.jboss.as
    HibernateAbstractStatistics.getValue
    1. org.jboss.as.jpa.hibernate5.management.HibernateAbstractStatistics.getEntityManagerFactory(HibernateAbstractStatistics.java:66)
    2. org.jboss.as.jpa.hibernate5.management.HibernateStatistics$16.invoke(HibernateStatistics.java:359)
    3. org.jboss.as.jpa.hibernate5.management.HibernateAbstractStatistics.getValue(HibernateAbstractStatistics.java:99)
    3 frames
  4. JPA
    ManagementResourceDefinition$AbstractMetricsHandler.executeRuntimeStep
    1. org.jboss.as.jpa.management.ManagementResourceDefinition$1.handle(ManagementResourceDefinition.java:130)
    2. org.jboss.as.jpa.management.ManagementResourceDefinition$AbstractMetricsHandler.executeRuntimeStep(ManagementResourceDefinition.java:268)
    2 frames
  5. JBoss Application Server: Controller Core
    ModelControllerImpl.execute
    1. org.jboss.as.controller.AbstractRuntimeOnlyHandler$1.execute(AbstractRuntimeOnlyHandler.java:53)
    2. org.jboss.as.controller.AbstractOperationContext.executeStep(AbstractOperationContext.java:890)
    3. org.jboss.as.controller.AbstractOperationContext.processStages(AbstractOperationContext.java:659)
    4. org.jboss.as.controller.AbstractOperationContext.executeOperation(AbstractOperationContext.java:370)
    5. org.jboss.as.controller.OperationContextImpl.executeOperation(OperationContextImpl.java:1344)
    6. org.jboss.as.controller.ModelControllerImpl.internalExecute(ModelControllerImpl.java:392)
    7. org.jboss.as.controller.ModelControllerImpl.execute(ModelControllerImpl.java:217)
    7 frames
  6. JBoss Application Server: Domain HTTP Interface
    DomainApiHandler.handleRequest
    1. org.jboss.as.domain.http.server.DomainApiHandler.handleRequest(DomainApiHandler.java:212)
    1 frame
  7. Undertow Core
    EncodingHandler.handleRequest
    1. io.undertow.server.handlers.encoding.EncodingHandler.handleRequest(EncodingHandler.java:72)
    1 frame
  8. JBoss Application Server: Domain HTTP Interface
    SubjectDoAsHandler$1.run
    1. org.jboss.as.domain.http.server.security.SubjectDoAsHandler$1.run(SubjectDoAsHandler.java:72)
    2. org.jboss.as.domain.http.server.security.SubjectDoAsHandler$1.run(SubjectDoAsHandler.java:68)
    2 frames
  9. Java RT
    Subject.doAs
    1. java.security.AccessController.doPrivileged(Native Method)
    2. javax.security.auth.Subject.doAs(Subject.java:422)
    2 frames
  10. JBoss Application Server: Controller Core
    AccessAuditContext.doAs
    1. org.jboss.as.controller.AccessAuditContext.doAs(AccessAuditContext.java:92)
    1 frame
  11. JBoss Application Server: Domain HTTP Interface
    SubjectDoAsHandler.handleRequest
    1. org.jboss.as.domain.http.server.security.SubjectDoAsHandler.handleRequest(SubjectDoAsHandler.java:68)
    2. org.jboss.as.domain.http.server.security.SubjectDoAsHandler.handleRequest(SubjectDoAsHandler.java:63)
    2 frames
  12. Undertow Core
    BlockingHandler.handleRequest
    1. io.undertow.server.handlers.BlockingHandler.handleRequest(BlockingHandler.java:56)
    1 frame
  13. JBoss Application Server: Domain HTTP Interface
    DomainApiCheckHandler.handleRequest
    1. org.jboss.as.domain.http.server.DomainApiCheckHandler.handleRequest(DomainApiCheckHandler.java:95)
    1 frame
  14. Undertow Core
    HttpServerExchange$1.run
    1. io.undertow.security.handlers.AuthenticationCallHandler.handleRequest(AuthenticationCallHandler.java:52)
    2. io.undertow.server.Connectors.executeRootHandler(Connectors.java:202)
    3. io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:793)
    3 frames
  15. Java RT
    Thread.run
    1. java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    2. java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    3. java.lang.Thread.run(Thread.java:745)
    3 frames