openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Henning Storhaug <henningstorh...@yahoo.no>
Subject Standalone JPA startup problem / BUG?
Date Mon, 20 Oct 2008 10:31:01 GMT
I'm trying to run JPA standalone , but got stuck with exception on call 
to: "EntityManagerFactory factory = 
Persistence.createEntityManagerFactory("blabla");"
The exception reason is the call to 
"parser.setProperty("http://java.sun.com/xml/jaxp/properties/schemaLanguage",  
"http://www.w3.org/2001/XMLSchema");" somewhere in XMLMetaDataParser.

OpenJPA seem to use an odd JAXP implementation; 
"gnu.xml.aelfred2.JAXPFactory.JaxpParser". Is this causing the problem?


Stacktrace:
Exception in thread "main" javax.persistence.PersistenceException: 
Provider error. Provider: 
org.apache.openjpa.persistence.PersistenceProviderImpl
    at javax.persistence.Persistence.createFactory(Persistence.java:175)
    at 
javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:111)
    at samplingcollector.client.JPATest.main(JPATest.java:55)
Caused by: <openjpa-1.2.0-r422266:683325 nonfatal general error> 
org.apache.openjpa.util.GeneralException: 
org.xml.sax.SAXNotRecognizedException: 
http://java.sun.com/xml/jaxp/properties/schemaLanguage
    at 
org.apache.openjpa.lib.meta.XMLMetaDataParser.parseNewResource(XMLMetaDataParser.java:379)
    at 
org.apache.openjpa.lib.meta.XMLMetaDataParser.parse(XMLMetaDataParser.java:318)
    at 
org.apache.openjpa.lib.meta.XMLMetaDataParser.parse(XMLMetaDataParser.java:295)
    at 
org.apache.openjpa.lib.meta.XMLMetaDataParser.parse(XMLMetaDataParser.java:268)
    at 
org.apache.openjpa.persistence.PersistenceProductDerivation$ConfigurationParser.parse(PersistenceProductDerivation.java:509)
    at 
org.apache.openjpa.persistence.PersistenceProductDerivation.parseResources(PersistenceProductDerivation.java:359)
    at 
org.apache.openjpa.persistence.PersistenceProductDerivation.load(PersistenceProductDerivation.java:326)
    at 
org.apache.openjpa.persistence.PersistenceProductDerivation.load(PersistenceProductDerivation.java:161)
    at 
org.apache.openjpa.persistence.PersistenceProviderImpl.createEntityManagerFactory(PersistenceProviderImpl.java:77)
    at 
org.apache.openjpa.persistence.PersistenceProviderImpl.createEntityManagerFactory(PersistenceProviderImpl.java:109)
    at 
org.apache.openjpa.persistence.PersistenceProviderImpl.createEntityManagerFactory(PersistenceProviderImpl.java:53)
    at javax.persistence.Persistence.createFactory(Persistence.java:171)
    ... 2 more

--------------

My configuration is windows xp, eclipse 3.4.1, JDK 1.6.0_10. OpenJPA 1.2.0
And my persistence.xml follows

<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    version="1.0">
    <persistence-unit name="blabla" transaction-type="RESOURCE_LOCAL">
        <!--
            The default provider can be OpenJPA, or some other product.
            This element is optional if OpenJPA is the only JPA provider
            in the current classloading environment, but can be specified
            in cases where there are multiple JPA implementations available.
        -->
        
<provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>

        <!-- We must enumerate each entity in the persistence unit -->
        <class>MyClass</class>

        <properties>
            <!--
                We can configure the default OpenJPA properties here. They
                happen to be commented out here since the provided examples
                all specify the values via System properties.
            -->
            <property name="openjpa.ConnectionURL"
                value="jdbc:derby:openjpa-database;create=true"/>
            <property name="openjpa.ConnectionDriverName"
                value="org.apache.derby.jdbc.EmbeddedDriver"/>
            <property name="openjpa.ConnectionUserName"
                value="user"/>
            <property name="openjpa.ConnectionPassword"
                value="secret"/>
        </properties>
    </persistence-unit>
</persistence>



Mime
View raw message