You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by "Eric Hamilton (Jira)" <ji...@apache.org> on 2022/04/11 18:45:00 UTC

[jira] [Updated] (TOMEE-3849) EclipseLink JPA provider not discoverable in TomEE Plume libraries

     [ https://issues.apache.org/jira/browse/TOMEE-3849?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Eric Hamilton updated TOMEE-3849:
---------------------------------
    Description: 
A Java web application is unable to use the default EclipseLink JPA provider that is included in the TomEE Plume distributable.  JPA is only able to discover the OpenJPA provider within the TomEE server libraries.  Attached TestWeb application to reproduce the issue.  This configuration was working in TomEE Plume 8.0.6, and behavior was changed in 8.0.7.

 

Web application persistence.xml configured with EclipseLink JPA:
{code:java}
  <persistence-unit name="TestJPA" transaction-type="RESOURCE_LOCAL">
    <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
{code}
 

JPA fails to load with error:
{code:java}
javax.persistence.PersistenceException: No persistence providers available for "TestJPA" after trying the following discovered implementations: org.apache.openjpa.persistence.PersistenceProviderImpl{code}
 

Workaround 1:

Copy the the EclipseLink library into the web application libraries.  Then JPA will discover both the OpenJPA and EclipseLink providers from the Java web application.

 

Workaround 2:

Append CATALINA_OPTS with JVM property "openejb.classloader.filterable-resources" using default value excluding "META-INF/services/javax.persistence.spi.PersistenceProvider":

 
{code:java}
-Dopenejb.classloader.filterable-resources=META-INF/services/javax.validation.spi.ValidationProvider,META-INF/services/javax.ws.rs.client.ClientBuilder,META-INF/services/javax.json.spi.JsonProvider,META-INF/services/javax.cache.spi.CachingProvider,META-INF/javamail.default.providers,META-INF/javamail.default.address.map,META-INF/javamail.charset.map,META-INF/mailcap,org/slf4j/impl/StaticLoggerBinder.class{code}
 

  was:
A Java web application is unable to use the default EclipseLink JPA provider that is included in the TomEE Plume distributable.  JPA is only able to discover the OpenJPA provider within the TomEE server libraries.  Attached TestWeb application to reproduce the issue.  This configuration was working in TomEE Plume 8.0.6, and behavior was changed in 8.0.7.

 

Web application persistence.xml configured with EclipseLink JPA:
{code:java}
  <persistence-unit name="TestJPA" transaction-type="RESOURCE_LOCAL">
    <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
{code}
 

JPA fails to load with error:
{code:java}
javax.persistence.PersistenceException: No persistence providers available for "TestJPA" after trying the following discovered implementations: org.apache.openjpa.persistence.PersistenceProviderImpl{code}
 

Workaround is to copy the the EclipseLink library into the web application libraries.  Then JPA will discover both the OpenJPA and EclipseLink providers from the Java web application.


> EclipseLink JPA provider not discoverable in TomEE Plume libraries
> ------------------------------------------------------------------
>
>                 Key: TOMEE-3849
>                 URL: https://issues.apache.org/jira/browse/TOMEE-3849
>             Project: TomEE
>          Issue Type: Bug
>          Components: TomEE Core Server
>    Affects Versions: 8.0.7, 8.0.8, 8.0.9, 8.0.10
>            Reporter: Eric Hamilton
>            Priority: Major
>              Labels: JPA, eclipselink, openjpa
>         Attachments: TestWeb.zip
>
>
> A Java web application is unable to use the default EclipseLink JPA provider that is included in the TomEE Plume distributable.  JPA is only able to discover the OpenJPA provider within the TomEE server libraries.  Attached TestWeb application to reproduce the issue.  This configuration was working in TomEE Plume 8.0.6, and behavior was changed in 8.0.7.
>  
> Web application persistence.xml configured with EclipseLink JPA:
> {code:java}
>   <persistence-unit name="TestJPA" transaction-type="RESOURCE_LOCAL">
>     <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
> {code}
>  
> JPA fails to load with error:
> {code:java}
> javax.persistence.PersistenceException: No persistence providers available for "TestJPA" after trying the following discovered implementations: org.apache.openjpa.persistence.PersistenceProviderImpl{code}
>  
> Workaround 1:
> Copy the the EclipseLink library into the web application libraries.  Then JPA will discover both the OpenJPA and EclipseLink providers from the Java web application.
>  
> Workaround 2:
> Append CATALINA_OPTS with JVM property "openejb.classloader.filterable-resources" using default value excluding "META-INF/services/javax.persistence.spi.PersistenceProvider":
>  
> {code:java}
> -Dopenejb.classloader.filterable-resources=META-INF/services/javax.validation.spi.ValidationProvider,META-INF/services/javax.ws.rs.client.ClientBuilder,META-INF/services/javax.json.spi.JsonProvider,META-INF/services/javax.cache.spi.CachingProvider,META-INF/javamail.default.providers,META-INF/javamail.default.address.map,META-INF/javamail.charset.map,META-INF/mailcap,org/slf4j/impl/StaticLoggerBinder.class{code}
>  



--
This message was sent by Atlassian Jira
(v8.20.1#820001)