Hi Eddy,

can you please confirm that for these last tests you put the jpox libraries outside the web application WEB-INF/lib dir?

You told me yesterday that you got an exception using regular JSP too, is that not the case anymore?

Best regards,

Geert

On 12 Apr 2006, at 11:13, Eddy Young wrote:

Geert Bevin wrote:
Hi Eddy,
not that I recall. Care to expand on this?
Best regards,
Geert

Geert,

After our online conversation yesterday, I did some more tests to try and pinpoint the exact source of the problem. I think I've managed to establish that the problem is related to the RIFE classloader in some way.

But first, here is some background information for the others on the mailing list.

I am using JPOX, a JDO implementation, to persist objects to a database. In JDO, JDOHelper.getPersistenceManagerFactory(Properties properties) is used to instantiate the PersistenceManagerFactory implementation that is specified in the properties (that is, introspection is used to locate and instantiate the correct class).

In my tests, when that method is called from a console application or a JSP page (RIFE not involved), no exception is thrown; all classes are loaded and instantiated successfully. However, when the same method is called from a RIFE Element, a LinkageError exception is thrown for the Level class from the Log4j package. That exception triggers a chain of other exceptions that prevent the PersistenceManagerFactory from being instantiated.

After much fiddling around (until 2am to be exact), I tried instantiating the PersistenceManagerFactory class with a classloader specified. I called the variant method JDOHelper.getPersistenceManagerFactory(<properties>, <classloader>), passing 1) the current thread context classloader and 2) the parent classloader of the current thread context classloader.

In case 1) the classloader is the RIFE classloader. That caused the LinkageError exception to be thrown.

In case 2) the classloader is the Catalina WebappClassloader (I am using Tomcat), and with that, the PersistenceManagerFactory class was instantiated successfully.

This is as far as I reached in my investigation. I wanted to share this here in order to get your feedback on it. If you have encountered this problem in a differnet scenario, please let me know. As you rightly pointed out, such conflict errors are very hard to trace, so I would be very grateful if you could help in any way.

If my analysis is wrong (again!), I apologise; as I said, I stayed up until quite late to try and sort this out.

Regards,
Eddy

--
http://coding.mu
http://priscimon.com/blog
_______________________________________________
Rife-users mailing list
[email protected]
http://lists.uwyn.com/mailman/listinfo/rife-users


--
Geert Bevin             Uwyn bvba               GTalk: [EMAIL PROTECTED]
"Use what you need"     Avenue de Scailmont 34  Skype: gbevin
http://www.uwyn.com     7170 Manage, Belgium      AIM: geertbevin
gbevin at uwyn dot com  Tel: +32 64 84 80 03   Mobile: +32 477 302 599

PGP Fingerprint : 4E21 6399 CD9E A384 6619  719A C8F4 D40D 309F D6A9
Public PGP key  : available at servers pgp.mit.edu, wwwkeys.pgp.net


_______________________________________________
Rife-users mailing list
[email protected]
http://lists.uwyn.com/mailman/listinfo/rife-users

Reply via email to