Hello,

I use OpenJPA as my persistence tool to access database, without using EJB.

And if I use it as common java apllication started by main method, it works ok, and when I use it in web apllication in resin there's exception. I also tested it in Tomcat, everything works OK.

When program goes to "EntityManagerFactory emf = Persistence.createEntityManagerFactory("infosys");", the EntityManagerFactory is always null. And there are no specail configuration.

Version of resin: resin-pro-3.0.28
Version of openjpa: openjpa:-1.2.0


The code of /META-INF/persistence.xml
 
 
<?xml version="1.0" encoding="UTF-8"?>
 <persistence-unit name="infosys" transaction-type="RESOURCE_LOCAL">
  <provider>
   org.apache.openjpa.persistence.PersistenceProviderImpl
  </provider>
  <class>
   com.bs.infosys.model.Category
  </class>
  <class>
   com.bs.infosys.model.Article
  </class>
  <class>
   com.bs.infosys.model.Property
  </class>
  <properties>
   <property name="openjpa.ConnectionURL"
    value="jdbc:mysql://localhost/infosys?autoReconnect=true&amp;useUnicode=true&amp;characterEncoding=utf-8&amp;mysqlEncoding=utf8" />
   <property name="openjpa.ConnectionDriverName" value="com.mysql.jdbc.Driver" />
   <property name="openjpa.ConnectionUserName" value="root" />
   <property name="openjpa.ConnectionPassword" value="" />
 
  </properties>
   
  
 </persistence-unit>
</persistence>

  



_______________________________________________
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest

Reply via email to