My Oracle Support Banner

'java.lang.IllegalArgumentException: No persistence unit named' Exception After Using With Split Dir Deployment Feature (Doc ID 1528440.1)

Last updated on MAY 08, 2023

Applies to:

Oracle WebLogic Server - Version 12.1.1.0 to 12.1.1.0 [Release 12c]
Oracle TopLink - Version 11.1.1.6.0 and later
Information in this document applies to any platform.

Symptoms

 

A J2EE  application is composed  of a Web Module.

This  WEB module consists of :

This Web module is packaged in a WAR file as the following :

 Under WEB-INF/classes :

  1.  META-INF/persistence.xml   (eclipselink descriptor where persistence unit  (with Employee entity) is declared )
  2.  ecl.basic.mod.Employee class
  3.  ejb.TestEjb class      
  4.  web.ServletTest class

 The ServletTest servlet invokes TestEjb  EJB method  querying  JPA Employee  entity.

To deploy this application into WLS 12.1.1 ,  split development dir  feature is used.

The problem happens when invoking the servlet, the following error occurs :

java.lang.IllegalArgumentException: No persistence unit named '<Persistenceunit_name>'
  is available in scope /Web-cdi-project-ant. 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)
  at com.oracle.injection.integration.ModuleInjectionArchive.getPersistenceContext(ModuleInjectionArchive.java:200)
  at com.oracle.injection.provider.weld.WeldJpaInjectionServicesAdapter.resolvePersistenceContext(WeldJpaInjectionServicesAdapter.java:37)
  at org.jboss.weld.util.Beans.injectEEFields(Beans.java:617)
  at org.jboss.weld.bean.ManagedBean$ManagedBeanInjectionTarget$1$1.proceed(ManagedBean.java:155)
  at com.oracle.injection.provider.weld.WeldInjectionServicesAdapter.aroundInject(WeldInjectionServicesAdapter.java:88)
  at org.jboss.weld.injection.InjectionContextImpl.run(InjectionContextImpl.java:45)

 

This problem does not occur when deploying the application via the WLS console.

Changes

 

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
Changes
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.