Javax.persistence Package Class Loader Issue: "EntityManagerFactory is not visible from class loader" (Doc ID 1930027.1)

Last updated on MARCH 15, 2016

Applies to:

Oracle WebCenter Sites - Version 11.1.1.8.0 and later
Information in this document applies to any platform.

Symptoms

Prior to the upgrade from 11.1.1.6.1 to 11.1.1.8.0, our weblogic.xml file had the javax.persistence package as part of the prefer-applications-packages.

It is now throwing an exception and won't load, causing the server startup to fail. We have a fair amount of code that uses hibernate and need to use this package. What has changed in the 11.1.1.8.0 release that would cause this issue? The exception logged is:

Exception: Failed to load webapp: 'cs'.
weblogic.application.ModuleException: Failed to load webapp: 'cs'
    at weblogic.servlet.internal.WebAppModule.prepare(WebAppModule.java:395)
    at weblogic.application.internal.flow.ScopedModuleDriver.prepare(ScopedModuleDriver.java:176)
    at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:199)
    at weblogic.application.internal.flow.DeploymentCallbackFlow$1.next(DeploymentCallbackFlow.java:517)
    at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
    Truncated. see log file for complete stacktrace
Caused By: java.lang.IllegalArgumentException: interface javax.persistence.EntityManagerFactory is not visible from class loader
    at java.lang.reflect.Proxy.getProxyClass0(Proxy.java:484)
    at java.lang.reflect.Proxy.newProxyInstance(Proxy.java:713)
    at weblogic.deployment.BasePersistenceUnitInfoImpl.initializeEntityManagerFactory(BasePersistenceUnitInfoImpl.java:412)
    at weblogic.deployment.BasePersistenceUnitInfoImpl.initializeEntityManagerFactory(BasePersistenceUnitInfoImpl.java:386)
    at weblogic.deployment.BasePersistenceUnitInfoImpl.<init>(BasePersistenceUnitInfoImpl.java:158)
    Truncated. see log file for complete stacktrace


Cause

Sign In with your My Oracle Support account

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

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms