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 FEBRUARY 06, 2018

Applies to:

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



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 'PU_LOCAL_2'
  is available in scope /Web-cdi-project-ant. Available persistence units: []
  at weblogic.persistence.ModulePersistenceUnitRegistry.getPersistenceUnit(
  at weblogic.persistence.BasePersistenceContextProxyImpl.(
  at weblogic.persistence.TransactionalEntityManagerProxyImpl.(
  at weblogic.persistence.EntityManagerInvocationHandlerFactory.createTransactionalEntityManagerInvocationHandler(
  at weblogic.persistence.PersistenceManagerObjectFactory.createPersistenceContextProxy(
  at org.jboss.weld.util.Beans.injectEEFields(
  at org.jboss.weld.bean.ManagedBean$ManagedBeanInjectionTarget$1$1.proceed(


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


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

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