openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "roger.keays" <>
Subject Shared classloader and subclasses
Date Tue, 20 Mar 2007 03:26:17 GMT

Hi there,

I'm trying to move my openjpa libs from WEB-INF/lib to Tomcat's shared/lib,
but it seems I have a border case which makes this difficult.

The situation is that each instance of the webapp loads between 5 - 10
subclasses of an abstract Entity. Which classes are loaded is specified by
that instance's configuration file. This is done with some custom
bootstrapping code which ignores the normal JPA persistence.xml mechanisms.
Everything works fine when one instance is loaded, but when another is
loaded with a different set of subclasses, things get a bit hairy.

AFIACT, the problem is that the openjpa.enhance.PCRegistry class uses static
fields to store Meta information. When the second instance is loaded, the
PCRegistry has been initialized, but doesn't contain that instance's
subclasses and an exception is thrown. This is not a problem using the
WEB-INF/lib classloader of course because each instance has their own
PCRegistry class.

I'm wondering if anybody might be able to suggest a workaround. I'd be happy
if there was a way to load all the subclass metadata into the PCRegistry,
but I still need each instance of the webapp to only be aware of their own


View this message in context:
Sent from the open-jpa-dev mailing list archive at

View raw message