Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » Export to Runnable JAR(How to create a runnable JAR with JPA and EclipseLink)
Export to Runnable JAR [message #721771] Fri, 02 September 2011 20:11 Go to next message
Matthias Wegner is currently offline Matthias Wegner
Messages: 8
Registered: September 2011
Junior Member
Hi All,

i am using Eclipse Java EE IDE for Web Developers(Version: Indigo Release; Build id: 20110615-0604) which includes EclipseLink.

My Poject is working just fine in Eclipse, but i am not able to export it to a runnable jar. I always get Exceptions. Which JAR-Files i have to add to the classpath?

I dont understand the source of the problem. Could you give me a hint?

Regards,
Matthias

The Exception is:
EntityManagerFactory creation failed.Exception [EclipseLink-30005] (Eclipse Persistence Services - 2.3.0.v20110604-r9504
): org.eclipse.persistence.exceptions.PersistenceUnitLoadingException
Exception Description: An exception was thrown while searching for persistence archives with ClassLoader: java.net.URLCl
assLoader@d0a5d9
Internal Exception: Exception [EclipseLink-30009] (Eclipse Persistence Services - 2.3.0.v20110604-r9504): org.eclipse.pe
rsistence.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.3.0.v20110604-r9504): org.eclipse.pe
rsistence.exceptions.PersistenceUnitLoadingException
Exception Description: An exception was thrown while processing persistence.xml from URL: rsrc:../
Internal Exception: java.net.MalformedURLException
Exception in thread "main" java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:58)
Caused by: java.lang.ExceptionInInitializerError
at org.rogatio.database.PersistenceUtil.<clinit>(PersistenceUtil.java:30)
at org.rogatio.database.QuestionsDao.findQuestionIds(QuestionsDao.java:33)
at org.rogatio.wiki.WikiParser.removeQuestions(WikiParser.java:409)
at org.rogatio.wiki.WikiParser.parsePage(WikiParser.java:219)
at org.rogatio.model.Wiki.parse(Wiki.java:491)
at org.rogatio.main.PortableWiki.main(PortableWiki.java:246)
... 5 more
Caused by: Exception [EclipseLink-30005] (Eclipse Persistence Services - 2.3.0.v20110604-r9504): org.eclipse.persistence
.exceptions.PersistenceUnitLoadingException
Exception Description: An exception was thrown while searching for persistence archives with ClassLoader: java.net.URLCl
assLoader@d0a5d9
Internal Exception: Exception [EclipseLink-30009] (Eclipse Persistence Services - 2.3.0.v20110604-r9504): org.eclipse.pe
rsistence.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.3.0.v20110604-r9504): org.eclipse.pe
rsistence.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.exceptionSearchingForPersistenceResources(
PersistenceUnitLoadingException.java:126)
at org.eclipse.persistence.jpa.PersistenceProvider.createEntityManagerFactory(PersistenceProvider.java:115)
at javax.persistence.Persistence.createEntityManagerFactory(Unknown Source)
at javax.persistence.Persistence.createEntityManagerFactory(Unknown Source)
at org.rogatio.database.PersistenceUtil.<clinit>(PersistenceUtil.java:18)
... 10 more
Caused by: Exception [EclipseLink-30009] (Eclipse Persistence Services - 2.3.0.v20110604-r9504): 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.3.0.v20110604-r9504): org.eclipse.pe
rsistence.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(PersistenceUnitLoa
dingException.java:99)
at org.eclipse.persistence.internal.jpa.deployment.PersistenceUnitProcessor.processPersistenceArchive(Persistenc
eUnitProcessor.java:538)
at org.eclipse.persistence.internal.jpa.deployment.PersistenceUnitProcessor.getPersistenceUnits(PersistenceUnitP
rocessor.java:444)
at org.eclipse.persistence.internal.jpa.deployment.JPAInitializer.findPersistenceUnitInfoInArchive(JPAInitialize
r.java:172)
at org.eclipse.persistence.internal.jpa.deployment.JPAInitializer.findPersistenceUnitInfoInArchives(JPAInitializ
er.java:154)
at org.eclipse.persistence.internal.jpa.deployment.JPAInitializer.findPersistenceUnitInfo(JPAInitializer.java:13
5)
at org.eclipse.persistence.jpa.PersistenceProvider.createEntityManagerFactory(PersistenceProvider.java:73)
... 13 more
Caused by: Exception [EclipseLink-30004] (Eclipse Persistence Services - 2.3.0.v20110604-r9504): 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(Persiste
nceUnitLoadingException.java:117)
at org.eclipse.persistence.internal.jpa.deployment.PersistenceUnitProcessor.processPersistenceXML(PersistenceUni
tProcessor.java:579)
at org.eclipse.persistence.internal.jpa.deployment.PersistenceUnitProcessor.processPersistenceArchive(Persistenc
eUnitProcessor.java:536)
... 18 more
Caused by: java.net.MalformedURLException
at java.net.URL.<init>(Unknown Source)
at java.net.URL.<init>(Unknown Source)
at java.net.URL.<init>(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLVersionDetector.determineDocVersion(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
at org.eclipse.persistence.internal.jpa.deployment.PersistenceUnitProcessor.processPersistenceXML(PersistenceUni
tProcessor.java:577)
... 19 more
Re: Export to Runnable JAR [message #722746 is a reply to message #721771] Tue, 06 September 2011 15:44 Go to previous messageGo to next message
James Sutherland is currently offline James Sutherland
Messages: 1939
Registered: July 2009
Location: Ottawa, Canada
Senior Member

Where are you putting your persistence.xml? Is it in your meta-inf directory?

Are you using OSGi? What environment are you using and how is your persistence.xml on your classpath?

Also include your persistence.xml, is its header valid?



James : Wiki : Book : Blog : Twitter
Re: Export to Runnable JAR [message #726189 is a reply to message #722746] Fri, 16 September 2011 18:39 Go to previous messageGo to next message
Matthias Wegner is currently offline Matthias Wegner
Messages: 8
Registered: September 2011
Junior Member
The XML is in the META-INF-Directory. I attached it.

Are you able to extract a simple HelloWorld-Class with a Derby-DB to a runnable jar?

Regards,
Matthias

Re: Export to Runnable JAR [message #727295 is a reply to message #726189] Tue, 20 September 2011 20:06 Go to previous message
Matthias Wegner is currently offline Matthias Wegner
Messages: 8
Registered: September 2011
Junior Member
Hi All, i found a solution. The Problem was that i have a 64bit PC and also use a 64bit-Eclipse. When i run Eclipse in 32bit-Mode and include additional all hibernate-librarys, then it works.
(no subject) [message #727299 is a reply to message #726189] Tue, 20 September 2011 20:06 Go to previous message
Matthias Wegner is currently offline Matthias Wegner
Messages: 8
Registered: September 2011
Junior Member
Hi All, i found a solution. The Problem was that i have a 64bit PC and also use a 64bit-Eclipse. When i run Eclipse in 32bit-Mode and include additional all hibernate-librarys, then it works.
Previous Topic:Netbeans: can't import org.eclipse.persistence.annotations.PrivateOwned
Next Topic:Managing huge amount of entities
Goto Forum:
  


Current Time: Tue Sep 30 20:09:26 GMT 2014

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

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