Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » An exception was thrown while trying to load persistence unit at url: rsrc:..(Loading persistance.xml exception)
An exception was thrown while trying to load persistence unit at url: rsrc:.. [message #1749974] Wed, 14 December 2016 15:16
Mario Misic is currently offline Mario MisicFriend
Messages: 1
Registered: December 2016
Junior Member
Hi,

I am having problem with eclipselink2.6.4 and it looks like persistance.xml is not found in exported application jar file. I checked jar file and persistance.xml file is into META-INF dir with correct content.
Just to notice that everything works fine while developing in Eclipse, but when jar file is exported to be implemented as a standalone application I am receiving this msg. OS is 64bit also as Java and Eclipse, and everything is testing on local machine where app is developed.

exception thrown:
Exception Description: An exception was thrown while trying to load persistence unit at url: rsrc:../
Internal Exception: Exception [EclipseLink-30004] (Eclipse Persistence Services - 2.6.4.v20160829-44060b6): org.eclipse.persistence.exceptions.PersistenceUnitLoadingException
Exception Description: An exception was thrown while processing persistence.xml from URL: rsrc:../
Internal Exception: java.net.MalformedURLException
org.eclipse.persistence.exceptions.PersistenceUnitLoadingException:
Exception Description: An exception was thrown while trying to load persistence unit at url: rsrc:../
Internal Exception: Exception [EclipseLink-30004] (Eclipse Persistence Services - 2.6.4.v20160829-44060b6): org.eclipse.persistence.exceptions.PersistenceUnitLoadingException
Exception Description: An exception was thrown while processing persistence.xml from URL: rsrc:../
Internal Exception: java.net.MalformedURLException
at org.eclipse.persistence.exceptions.PersistenceUnitLoadingException.exceptionLoadingFromUrl(PersistenceUnitLoadingException.java:100) ~[jar:rsrc:eclipselink.jar!/:?]
at org.eclipse.persistence.internal.jpa.deployment.PersistenceUnitProcessor.processPersistenceArchive(PersistenceUnitProcessor.java:619) ~[jar:rsrc:eclipselink.jar!/:?]
at org.eclipse.persistence.internal.jpa.deployment.PersistenceUnitProcessor.getPersistenceUnits(PersistenceUnitProcessor.java:503) ~[jar:rsrc:eclipselink.jar!/:?]
at org.eclipse.persistence.internal.jpa.deployment.JPAInitializer.findPersistenceUnitInfoInArchive(JPAInitializer.java:178) ~[jar:rsrc:eclipselink.jar!/:?]
at org.eclipse.persistence.internal.jpa.deployment.JPAInitializer.findPersistenceUnitInfoInArchives(JPAInitializer.java:160) ~[jar:rsrc:eclipselink.jar!/:?]
at org.eclipse.persistence.internal.jpa.deployment.JPAInitializer.findPersistenceUnitInfo(JPAInitializer.java:141) ~[jar:rsrc:eclipselink.jar!/:?]
at org.eclipse.persistence.jpa.PersistenceProvider.createEntityManagerFactory(PersistenceProvider.java:188) ~[jar:rsrc:eclipselink.jar!/:?]
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:79) ~[jar:rsrc:javax.persistence_2.1.1.v201509150925.jar!/:?]
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:54) ~[jar:rsrc:javax.persistence_2.1.1.v201509150925.jar!/:?]
at parser.FP_M633_header_parser.read_msg(FP_M633_header_parser.java:137) [rsrc:./:?]
at parser.FP_M633_header_parser.run(FP_M633_header_parser.java:117) [rsrc:./:?]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_111]
Caused by: org.eclipse.persistence.exceptions.PersistenceUnitLoadingException:
Exception Description: An exception was thrown while processing persistence.xml from URL: rsrc:../
Internal Exception: java.net.MalformedURLException
at org.eclipse.persistence.exceptions.PersistenceUnitLoadingException.exceptionProcessingPersistenceXML(PersistenceUnitLoadingException.java:118) ~[jar:rsrc:eclipselink.jar!/:?]
at org.eclipse.persistence.internal.jpa.deployment.PersistenceUnitProcessor.processPersistenceXML(PersistenceUnitProcessor.java:657) ~[jar:rsrc:eclipselink.jar!/:?]
at org.eclipse.persistence.internal.jpa.deployment.PersistenceUnitProcessor.processPersistenceArchive(PersistenceUnitProcessor.java:617) ~[jar:rsrc:eclipselink.jar!/:?]
... 10 more
Caused by: java.net.MalformedURLException
at java.net.URL.<init>(Unknown Source) ~[?:1.8.0_111]
at java.net.URL.<init>(Unknown Source) ~[?:1.8.0_111]
at java.net.URL.<init>(Unknown Source) ~[?:1.8.0_111]
at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity(Unknown Source) ~[?:1.8.0_111]
at com.sun.org.apache.xerces.internal.impl.XMLVersionDetector.determineDocVersion(Unknown Source) ~[?:1.8.0_111]
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source) ~[?:1.8.0_111]
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source) ~[?:1.8.0_111]
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source) ~[?:1.8.0_111]
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source) ~[?:1.8.0_111]
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source) ~[?:1.8.0_111]
at org.eclipse.persistence.internal.jpa.deployment.PersistenceUnitProcessor.processPersistenceXML(PersistenceUnitProcessor.java:655) ~[jar:rsrc:eclipselink.jar!/:?]
at org.eclipse.persistence.internal.jpa.deployment.PersistenceUnitProcessor.processPersistenceArchive(PersistenceUnitProcessor.java:617) ~[jar:rsrc:eclipselink.jar!/:?]
... 10 more
Caused by: java.lang.NullPointerException
at java.net.URL.<init>(Unknown Source) ~[?:1.8.0_111]
at java.net.URL.<init>(Unknown Source) ~[?:1.8.0_111]
at java.net.URL.<init>(Unknown Source) ~[?:1.8.0_111]
at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity(Unknown Source) ~[?:1.8.0_111]
at com.sun.org.apache.xerces.internal.impl.XMLVersionDetector.determineDocVersion(Unknown Source) ~[?:1.8.0_111]
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source) ~[?:1.8.0_111]
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source) ~[?:1.8.0_111]
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source) ~[?:1.8.0_111]
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source) ~[?:1.8.0_111]
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source) ~[?:1.8.0_111]
at org.eclipse.persistence.internal.jpa.deployment.PersistenceUnitProcessor.processPersistenceXML(PersistenceUnitProcessor.java:655) ~[jar:rsrc:eclipselink.jar!/:?]
at org.eclipse.persistence.internal.jpa.deployment.PersistenceUnitProcessor.processPersistenceArchive(PersistenceUnitProcessor.java:617) ~[jar:rsrc:eclipselink.jar!/:?]
... 10 more

Persistance.xml file:

<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.1">
<persistence-unit name="Vr_eff_processor">
<class>model.FlightPlanM633Header</class>
<class>model.FlightPlanM633HeaderPK</class>
<class>model.Remark</class>
<class>model.RemarkPK</class>
<properties>
<property name="javax.persistence.jdbc.url" value="jdbc:mysql://localhost:3306/vr"/>
<property name="javax.persistence.jdbc.user" value="vr"/>
<property name="javax.persistence.jdbc.password" value="vr"/>
<property name="eclipselink.logging.level" value="FINE"/>
<property name="javax.persistence.jdbc.driver" value="com.mysql.jdbc.Driver"/>
<property name="eclipselink.weaving" value="false"/>
</properties>
</persistence-unit>
</persistence>

Does anyone have cue what might be wrong. I tried also to adjust CLASSPATH but nothing helpped, next I will try to go backward and install older eclipselink.

Thanks for answer.
MM
Previous Topic:JPA ManyToMany relationship in Oracle NoSql - @JoinTable
Next Topic:NullPointerException when using HAVING on JPQL
Goto Forum:
  


Current Time: Tue Nov 21 02:55:24 GMT 2017

Powered by FUDForum. Page generated in 0.01408 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software