aspose file tools*
The moose likes Object Relational Mapping and the fly likes EclipseLink 1.1.4 - EXCEPTION_SEARCHING_FOR_PERSISTENCE_RESOURCES Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping


Carlos Conti
Ranch Hand

Joined: Apr 21, 2010
Posts: 114
Hi there,

I am trying to recycle a persistence unit I created for a web application of type JTA-TRANSACTION and turn it into a RESOURCE_LOCAL. What I am planning to do is to create a desktop application for specific sidetasks with the same database in the end. I am having problems while getting the persistence unit to work in the DesktopApplication project. I am getting the following exception:

Exception [EclipseLink-30005] (Eclipse Persistence Services - 1.1.4.v20100812-r7860): org.eclipse.persistence.exceptions.PersistenceUnitLoadingException
Exception Description: An exception was thrown while searching for persistence archives with ClassLoader: sun.misc.Launcher$AppClassLoader@28df6ccd
Internal Exception: Exception [EclipseLink-7305] (Eclipse Persistence Services - 1.1.4.v20100812-r7860): org.eclipse.persistence.exceptions.ValidationException
Exception Description: An exception was thrown while processing the mapping file from URL: [file:/C:/Users/Carlos%20Conti/Documents/Proyectos%20CuteBytes/Java/netbeans/SistemaIncidenciasDesktop/src/META-INF/orm.xml].
Internal Exception: Exception [EclipseLink-25004] (Eclipse Persistence Services - 1.1.4.v20100812-r7860): org.eclipse.persistence.exceptions.XMLMarshalException
Exception Description: An error occurred unmarshalling the document
Internal Exception: Exception [EclipseLink-27101] (Eclipse Persistence Services - 1.1.4.v20100812-r7860): org.eclipse.persistence.platform.xml.XMLPlatformException
Exception Description: An error occurred while parsing the document.
Internal Exception: org.xml.sax.SAXParseException: The markup in the document following the root element must be well-formed.
at org.eclipse.persistence.exceptions.PersistenceUnitLoadingException.exceptionSearchingForPersistenceResources(
at org.eclipse.persistence.jpa.PersistenceProvider.createEntityManagerFactory(
at org.eclipse.persistence.jpa.PersistenceProvider.createEntityManagerFactory(
at javax.persistence.Persistence.createEntityManagerFactory(
at javax.persistence.Persistence.createEntityManagerFactory(

To add some information let me add that "persistence.xml" is located under META-INF in the root package and that the relational mappings are done through an "orm.xml" file. The persistence unit is a newly created version of persistence.xml, but the orm.xml file is exactly the same as the one used for the web application.

I am not sure if there's a configuration issue, or there's really a mistake in the syntax, as the exception description states.

To clarify let me post at least the persistence.xml file. The ORM file is huge, so I won't post it, but on the other hand an identical version is working fine in the web application.

I have added only one entity for the time being, to test if the error was due to the fact of finding no entities to configure in the entityManager.

I appreciate your insights.

Many thanks,

Carlos Conti
Ranch Hand

Joined: Apr 21, 2010
Posts: 114
I had effectively a markup error. What amazes me is that exactly the same orm file is woking for another persistence unit (the one for the web app)

ONce the problem was solved the error disappeared.

Regards and hope nobody lost time with this topic.

I agree. Here's the link: