My Oracle Support Banner

'IllegalArgumentException: No persistence unit' Error When Application Deployed From 12c OEPE (Doc ID 1400524.1)

Last updated on MARCH 01, 2024

Applies to:

Oracle WebLogic Server - Version 12.1.1.0 and later
Oracle TopLink - Version 11.1.1.6.0 and later
Information in this document applies to any platform.

Symptoms

Using  Oracle Enterprise Pack for Eclipse (10.3.x / 12c OEPE),   a J2EE application is  developed,   deployed  into 12.1.1 WLS  server.

When invoking  servlet of this application, the following exception is occuring :

java.lang.IllegalArgumentException: No persistence unit named 'laadmin' is available in scope Test. Available persistence units: []
at weblogic.persistence.ModulePersistenceUnitRegistry.getPersistenceUnit(ModulePersistenceUnitRegistry.java:130)
at weblogic.persistence.BasePersistenceContextProxyImpl.(BasePersistenceContextProxyImpl.java:40)
at weblogic.persistence.TransactionalEntityManagerProxyImpl.(TransactionalEntityManagerProxyImpl.java:31)
at weblogic.persistence.EntityManagerInvocationHandlerFactory.createTransactionalEntityManagerInvocationHandler(EntityManagerInvocationHandlerFactory.java:20)
at weblogic.persistence.PersistenceManagerObjectFactory.createPersistenceContextProxy(PersistenceManagerObjectFactory.java:66)
at com.oracle.injection.integration.ModuleInjectionArchive$DefaultPersistenceContextProxyFactory.createPersistenceContextProxy(ModuleInjectionArchive.java:245)



The servlet is invoking an EJB (TestEJB) embedded in the web application
and using JPA persistent unit (defined via @PersistenceContext(unitName="laadmin")) to get an entity as the following  :

Cause

To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!


In this Document
Symptoms
Cause
Solution
References


My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.