> -----Original Message-----
> From: KARR, DAVID (ATTCINW)
> Sent: Thursday, December 17, 2009 5:26 PM
> To: [email protected]
> Subject: EntityManager.find() working fine, but simple queries are
> failing with odd error
> 
> I'm having no trouble with EntityManager.find() results, but when I
try
> to run a simple query, I'm getting the somewhat confusing stack traces
> that follow this.  The initial traces just say it couldn't instantiate
> "Catalog", but later ones say that there was a NPE deep in the OpenJPA
> "kernel", in PCPath.initialize(), indicating that it couldn't find the
> metadata for a variable.

I believe I understand the cause of this, and a solution for my current
environment, at least.

Some versions of WebLogic have restrictions in the webapp classloader
that prevent loading of some package spaces from WEB-INF/lib (like the
JAX-RS space).  When I discovered this a while ago when I was using
WebLogic 10MP1, that simple fact caused me to move a bunch of jars to
APP-INF/lib, but at the time I didn't have any references from that
classloader "down" to the webapp classloader, which is good, because
that won't work.  When I implemented OpenJPA in the app, I now see that
I would have had to package even my application classes into
APP-INF/lib.  At that point, as I've recently upgraded to WL 10.3.2, I
decided to see if I still needed the classloader workaround, so I moved
everything back to WEB-INF/lib, and now everything works, including this
query test case.

Reply via email to