openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pinaki Poddar" <ppod...@bea.com>
Subject RE: Classloader Question of OpenJPA.
Date Fri, 17 Aug 2007 09:47:13 GMT
Hi Gene,
  I may not have understood full import of your classloading
environment.
  So following may not be relevant to your context:
  1. The exception most likelely shows that OpenJPA is not finding any
META-INF/persistence.xml resource in your classpath. Thie
META-INF/persistence.xml is loaded by the thread'c context classloader
(Classloader.getResourceAsStream()). So placing the directory in the
classpath that has META-INF/persistence.xml relative to it may solve
your problem.
  2. You may elaborate more on the execution environment and packaging
of your OpenJPA application.
  3. Setting <property name="openjpa.Log" value="DefaultLevel=TRACE"/>
in META-INF/persistence.xml prints detailed information. If you post it,
it will help diagnose the error.  


Pinaki Poddar
972.834.2865

-----Original Message-----
From: Gene Wu [mailto:gene_wu@hotmail.com] 
Sent: Friday, August 17, 2007 2:15 AM
To: OpenJPADev
Subject: Classloader Question of OpenJPA.




Hi,I am writing a handy tools with a simple user interface. It can
verify persistence.xml and annotation setting of the classes of. Also,
it can run JPQL like the SQL browser.In this case, I implemented a basic
classloader to load those persistence entity classes from Jar files,
which were configurable from UI. Here are my initial thoughts:1.
Classloader will load OpenJPA and persistence classes.-- I tried. My
classloader is too simple to make a perfect support of every requirement
from OpenJPA. It failed when it was loading FactoryBroker. After I
inject my classload to Thread, I still have the following error:
"Caused by: <0.0.0 fatal general error>
org.apache.openjpa.persistence.PersistenceException: There was an error
when invoking the static getInstance method on the named factory class
"org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory".  See the nested
exception for details."              "Caused by:
java.util.MissingResourceException:
org.apache.openjpa.persistence.PersistenceProductDerivation:java.lang.Nu
llPointerException"2. Classloader load persistence classes only.-- I
didn't find a way to have a special class loader to load the persistence
entity class in OpenJPA. Does any one have experience on that? Maybe we
can have an entrance in OpenJPAPersistence for specified classloader by
user.Thanks,Gene.
_________________________________________________________________
Recharge--play some free games. Win cool prizes too!
http://club.live.com/home.aspx?icid=CLUB_wlmailtextlink

Notice:  This email message, together with any attachments, may contain information  of  BEA
Systems,  Inc.,  its subsidiaries  and  affiliated entities,  that may be confidential,  proprietary,
 copyrighted  and/or legally privileged, and is intended solely for the use of the individual
or entity named in this message. If you are not the intended recipient, and have received
this message in error, please immediately return this by email and then delete it.

Mime
View raw message