My Oracle Support Banner

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

Last updated on JUNE 20, 2023

Applies to:

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


Prior to the upgrade from to, 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 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(
    at weblogic.application.internal.flow.ScopedModuleDriver.prepare(
    at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(
    at weblogic.application.internal.flow.DeploymentCallbackFlow$
    at weblogic.application.utils.StateMachineDriver.nextState(
    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(
    at java.lang.reflect.Proxy.newProxyInstance(
    at weblogic.deployment.BasePersistenceUnitInfoImpl.initializeEntityManagerFactory(
    at weblogic.deployment.BasePersistenceUnitInfoImpl.initializeEntityManagerFactory(
    at weblogic.deployment.BasePersistenceUnitInfoImpl.<init>(
    Truncated. see log file for complete stacktrace




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.