openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "laudio.info" <laudio.i...@gmail.com>
Subject openjpa, maven and persistence.xml. help me please
Date Mon, 18 Feb 2013 16:37:32 GMT
Hello
i am trying to make my fisrt openjpa project.
i am using maven.
i have create the persistence.xml file (bellow) but when i try to compile
my projects appears one error:
[INFO] [openjpa:test-enhance {execution: enhancer}]
[INFO]
------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO]
------------------------------------------------------------------------
[INFO] MetaDataFactory could not be configured
(conf.newMetaDataFactoryInstance() returned null). This might mean that no
configuration properties were found. Ensure that you have a
META-INF/persistence.xml file, that it is available in your classpath, or
that the properties file you are using for configuration is available. If
you are using Ant, please see the <properties> or <propertiesFile>
attributes of the task's nested <config> element. This can also occur if
your OpenJPA distribution jars are corrupt, or if your security policy is
overly strict.
[INFO]
------------------------------------------------------------------------
[INFO] Trace
<openjpa-2.1.1-r422266:1148538 fatal user error>
org.apache.openjpa.util.MetaDataException: MetaDataFactory could not be
configured (conf.newMetaDataFactoryInstance() returned null). This might
mean that no configuration properties were found. Ensure that you have a
META-INF/persistence.xml file, that it is available in your classpath, or
that the properties file you are using for configuration is available. If
you are using Ant, please see the <properties> or <propertiesFile>
attributes of the task's nested <config> element. This can also occur if
your OpenJPA distribution jars are corrupt, or if your security policy is
overly strict.
 at
org.apache.openjpa.meta.MetaDataRepository.initializeMetaDataFactory(MetaDataRepository.java:1904)
 at
org.apache.openjpa.meta.MetaDataRepository.endConfiguration(MetaDataRepository.java:1885)
 at
org.apache.openjpa.lib.conf.Configurations.configureInstance(Configurations.java:518)
 at
org.apache.openjpa.lib.conf.Configurations.configureInstance(Configurations.java:443)

My persistence.xml file is into the META-INF directory and has this:
<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence" version="2.0">
  <persistence-unit name="example" transaction-type="RESOURCE_LOCAL">

<provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>
    <class>com.caf.db.jpa.entities.Myrequest</class>
    <class>com.caf.db.jpa.entities.Myresponse</class>
    <properties>
     <property name="openjpa.jdbc.SynchronizeMappings" value="buildSchema"
/>
  <property name="openjpa.ConnectionDriverName"
value="org.apache.derby.jdbc.EmbeddedDriver" />
  <property name="openjpa.ConnectionURL"
value="jdbc:derby:C:\Curro\My\prototipoWorkspace\MyDB\MyDB" />
  <property name="openjpa.ConnectionUserName" value="" />
  <property name="openjpa.ConnectionPassword" value="" />
    </properties>
  </persistence-unit>
</persistence>

thanks

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message