Problem adding managed persistence classes using the jar-file element in persistence.xml

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Problem adding managed persistence classes using the jar-file element in persistence.xml

Lars-Fredrik Smedberg
Hi!

I have a problem adding managed persistence classes using the jar-file element in persistence.xml. I can get it to work (but it looks wrong), see below.

My environment is Websphere Liberty Profile 17.0.0.3 running EclipseLink 2.6.4 (bundled). 

My application is packaged as JAR files placed in a WARs lib directory (I deploy a WAR not an EAR). The persistence.xml, mapping file etc is placed in WEB-INF/classes/META-INF

I follow example 5 section 8.2.1.6.3 Jar Files in JSR 338 JPA 2.1, it states that

    app.ear
     war2.war
     WEB-INF/lib/warEntities.jar
     WEB-INF/classes/META-INF/persistence.xml

    persistence.xml
    <jar-file>lib/warEntities.jar</jar-file>

When I use the above configuration it startup without error but blows up at runtime with the following error message in the logs (trace and message log, no ffdc)

Internal Exception: java.lang.RuntimeException: url = [jar:file:/C:/Projects/test/out/artifacts/test/test.war!/WEB-INF/classes/lib/test.jar]

BUT....

...if I change the jar-file path to: ../lib/test.jar instead of lib/test.jar I get the following during startup

CWWJP0024E: The ../lib/test.jar Java archive (JAR) file specification for the test persistence unit is incorrect.

But now it works fine in runtime...

Note: None of the examples in the JSR 338 has a <jar-file>../lib/warEntities.jar</jar-file>

Any ideas?

Regards
LF




--
Med vänlig hälsning / Best regards

Lars-Fredrik Smedberg

STATEMENT OF CONFIDENTIALITY:
The information contained in this electronic message and any
attachments to this message are intended for the exclusive use of the
address(es) and may contain confidential or privileged information. If
you are not the intended recipient, please notify Lars-Fredrik Smedberg
immediately at [hidden email], and destroy all copies of this
message and any attachments.

_______________________________________________
eclipselink-users mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/eclipselink-users
Reply | Threaded
Open this post in threaded view
|

Re: Problem adding managed persistence classes using the jar-file element in persistence.xml

Jody Grassel
Hi, Lars-Fredrik, this sounds more like an issue with WebSphere Liberty's JPA runtime integration rather than a problem with Eclipselink.  If you have a support contract with IBM my first suggestion would be to open a PMR about the problem.  If you are using Open Liberty without a support contract, then please open an issue at Open Liberty's Github at https://github.com/OpenLiberty/open-liberty 

On Thu, Dec 7, 2017 at 3:03 AM, Lars-Fredrik Smedberg <[hidden email]> wrote:
Hi!

I have a problem adding managed persistence classes using the jar-file element in persistence.xml. I can get it to work (but it looks wrong), see below.

My environment is Websphere Liberty Profile 17.0.0.3 running EclipseLink 2.6.4 (bundled). 

My application is packaged as JAR files placed in a WARs lib directory (I deploy a WAR not an EAR). The persistence.xml, mapping file etc is placed in WEB-INF/classes/META-INF

I follow example 5 section 8.2.1.6.3 Jar Files in JSR 338 JPA 2.1, it states that

    app.ear
     war2.war
     WEB-INF/lib/warEntities.jar
     WEB-INF/classes/META-INF/persistence.xml

    persistence.xml
    <jar-file>lib/warEntities.jar</jar-file>

When I use the above configuration it startup without error but blows up at runtime with the following error message in the logs (trace and message log, no ffdc)

Internal Exception: java.lang.RuntimeException: url = [jar:file:/C:/Projects/test/out/artifacts/test/test.war!/WEB-INF/classes/lib/test.jar]

BUT....

...if I change the jar-file path to: ../lib/test.jar instead of lib/test.jar I get the following during startup

CWWJP0024E: The ../lib/test.jar Java archive (JAR) file specification for the test persistence unit is incorrect.

But now it works fine in runtime...

Note: None of the examples in the JSR 338 has a <jar-file>../lib/warEntities.jar</jar-file>

Any ideas?

Regards
LF




--
Med vänlig hälsning / Best regards

Lars-Fredrik Smedberg

STATEMENT OF CONFIDENTIALITY:
The information contained in this electronic message and any
attachments to this message are intended for the exclusive use of the
address(es) and may contain confidential or privileged information. If
you are not the intended recipient, please notify Lars-Fredrik Smedberg
immediately at [hidden email], and destroy all copies of this
message and any attachments.

_______________________________________________
eclipselink-users mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/eclipselink-users


_______________________________________________
eclipselink-users mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/eclipselink-users
Reply | Threaded
Open this post in threaded view
|

Re: Problem adding managed persistence classes using the jar-file element in persistence.xml

Lars-Fredrik Smedberg
Hi

We do have a support contract with IBM so I will open a PMR... just wanted to see if I did something obviously wrong JPA/EclipseLink wise.

Thanks 

Regards 
LF

Den 7 dec. 2017 18:21 skrev "Jody Grassel" <[hidden email]>:
Hi, Lars-Fredrik, this sounds more like an issue with WebSphere Liberty's JPA runtime integration rather than a problem with Eclipselink.  If you have a support contract with IBM my first suggestion would be to open a PMR about the problem.  If you are using Open Liberty without a support contract, then please open an issue at Open Liberty's Github at https://github.com/OpenLiberty/open-liberty 

On Thu, Dec 7, 2017 at 3:03 AM, Lars-Fredrik Smedberg <[hidden email]> wrote:
Hi!

I have a problem adding managed persistence classes using the jar-file element in persistence.xml. I can get it to work (but it looks wrong), see below.

My environment is Websphere Liberty Profile 17.0.0.3 running EclipseLink 2.6.4 (bundled). 

My application is packaged as JAR files placed in a WARs lib directory (I deploy a WAR not an EAR). The persistence.xml, mapping file etc is placed in WEB-INF/classes/META-INF

I follow example 5 section 8.2.1.6.3 Jar Files in JSR 338 JPA 2.1, it states that

    app.ear
     war2.war
     WEB-INF/lib/warEntities.jar
     WEB-INF/classes/META-INF/persistence.xml

    persistence.xml
    <jar-file>lib/warEntities.jar</jar-file>

When I use the above configuration it startup without error but blows up at runtime with the following error message in the logs (trace and message log, no ffdc)

Internal Exception: java.lang.RuntimeException: url = [jar:file:/C:/Projects/test/out/artifacts/test/test.war!/WEB-INF/classes/lib/test.jar]

BUT....

...if I change the jar-file path to: ../lib/test.jar instead of lib/test.jar I get the following during startup

CWWJP0024E: The ../lib/test.jar Java archive (JAR) file specification for the test persistence unit is incorrect.

But now it works fine in runtime...

Note: None of the examples in the JSR 338 has a <jar-file>../lib/warEntities.jar</jar-file>

Any ideas?

Regards
LF




--
Med vänlig hälsning / Best regards

Lars-Fredrik Smedberg

STATEMENT OF CONFIDENTIALITY:
The information contained in this electronic message and any
attachments to this message are intended for the exclusive use of the
address(es) and may contain confidential or privileged information. If
you are not the intended recipient, please notify Lars-Fredrik Smedberg
immediately at [hidden email], and destroy all copies of this
message and any attachments.

_______________________________________________
eclipselink-users mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/eclipselink-users


_______________________________________________
eclipselink-users mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/eclipselink-users

_______________________________________________
eclipselink-users mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/eclipselink-users