java - Configuration of persistence.xml while using websphere 8.5.5.1 -


i'm coding app uses servlet 3.0, jsp, , jpa 2.0 , i'm deploying websphere application server 8.5. since configured ibm websphere console, data source , jdbc driver, , j2c authentification (i'm using oracle 11g database ). dont know how persistence.xml should like, if need specify , add openjpa jars project. put persistence.xml i'm having issue :

error 500: <openjpa-2.2.3-snapshot-r422266:1764177 fatal user error> org.apache.openjpa.persistence.argumentexception 

what should ? maybe i'm missing how jpa works

thanks in advance

the openjpa jars should provided websphere , available use application. there jpa sample available here: https://developer.ibm.com/wasdev/downloads/#asset/samples-java_persistence_api_jpa_sample

in sample, can see example of persistence.xml file:

<?xml version="1.0" encoding="utf-8"?> <persistence version="2.0"              xmlns="http://java.sun.com/xml/ns/persistence"              xmlns:xsi="http://www.w3.org/2001/xmlschema-instance"              xsi:schemalocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">    <persistence-unit name="jpasamplepersistenceunit">      <jta-data-source>java:comp/env/jdbc/samplejpadatasource</jta-data-source>     <non-jta-data-source>java:comp/env/jdbc/samplejpadatasourcenonjta</non-jta-data-source>      <class>wasdev.sample.jpa.thing</class>     <exclude-unlisted-classes>true</exclude-unlisted-classes>     <properties>       <!-- these properties creating database on fly. using them avoid users having           create database run sample.            see create=true line in datasource meta data. -->       <property name="openjpa.jdbc.synchronizemappings" value="buildschema(foreignkeys=true)" />       <property name="openjpa.jdbc.dbdictionary" value="derby" />        <!-- eclipselink specific properties create database. used if using jpa-2.1 feature. -->         <property name="eclipselink.ddl-generation" value="drop-and-create-tables" />         <property name="eclipselink.ddl-generation.output-mode" value="both" />      </properties>   </persistence-unit>  </persistence> 

i think error not caused openjpa jars not being available. might because database not configured correctly. make sure persistence.xml file refers datasources properly.


Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -