openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From James Barnett <james.a.barn...@hp.com>
Subject Re: problems running JPA standalone (outside of container)
Date Wed, 28 Sep 2011 15:37:05 GMT
Here's the code I'm using -- it's about as basic as it gets

    public static void main(String[] args) {
    	
    	EntityManager em = null;
    	EntityManagerFactory factory = null;
    	try
    	{
           factory = Persistence.
                 createEntityManagerFactory("event",
System.getProperties());

        // Create a new EntityManager from the EntityManagerFactory. The
        // EntityManager is the main object in the persistence API, and is
        // used to create, delete, and query objects, as well as access
        // the current transaction
        em = factory.createEntityManager();


Here's the standard error output I am getting (including the SAXParser type

SAXParser class --> gnu.xml.aelfred2.JAXPFactory




An error occurred while attempting to determine the version of
"file:/C:/workspaces/new-cmc/thead-new/bin/META-INF/persistence.xml".
java.lang.NoClassDefFoundError: Could not initialize class
org.apache.openjpa.lib.xml.XMLFactory
	at
org.apache.openjpa.lib.meta.XMLMetaDataParser.parseNewResource(XMLMetaDataParser.java:369)
	at
org.apache.openjpa.lib.meta.XMLMetaDataParser.parse(XMLMetaDataParser.java:334)
	at
org.apache.openjpa.lib.meta.XMLMetaDataParser.parse(XMLMetaDataParser.java:311)
	at
org.apache.openjpa.lib.meta.XMLMetaDataParser.parse(XMLMetaDataParser.java:284)
	at
org.apache.openjpa.persistence.PersistenceProductDerivation$ConfigurationParser.parse(PersistenceProductDerivation.java:775)
	at
org.apache.openjpa.persistence.PersistenceProductDerivation.parseResources(PersistenceProductDerivation.java:559)
	at
org.apache.openjpa.persistence.PersistenceProductDerivation.load(PersistenceProductDerivation.java:525)
	at
org.apache.openjpa.persistence.PersistenceProductDerivation.load(PersistenceProductDerivation.java:339)
	at
org.apache.openjpa.persistence.PersistenceProviderImpl.createEntityManagerFactory(PersistenceProviderImpl.java:90)
	at
org.apache.openjpa.persistence.PersistenceProviderImpl.createEntityManagerFactory(PersistenceProviderImpl.java:157)
	at
org.apache.openjpa.persistence.PersistenceProviderImpl.createEntityManagerFactory(PersistenceProviderImpl.java:66)
	at
javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:152)
	at com.hp.p4000.db.DbConnect.main(DbConnect.java:31)







--
View this message in context: http://openjpa.208410.n2.nabble.com/problems-running-JPA-standalone-outside-of-container-tp6838028p6840657.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.

Mime
View raw message