Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

J2EE, J2C and classpath... and perhaps WebSphere  RSS feed

 
Brice Laurencin
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A contractor delivered us a JCA adaptor, configured against some environment variables. I hate that, so we refactored a bit of code to use a prety XML file instead. The file is parsed using Digester. So Digester and all its requiered libraries are packed in the connector's RAR file.

Problem: on our WAS, other applications are using Digester (because they are Struts based), but in an other version. And Bang! the version in the RAR is used, and not the one packed in the EAR of the application. Therefore: exceptions (NoClassDefFound). The libraries are availiable as they if were in the lib/ext folder.

I'm guessing that configuring the application's ClassPath in 'Parent Last', it might work, but I do not want to configure each and every app that way, there are too many.

I tried to find if this is a recommendation in the J2EE spec, but I couldn't find what I want.

Does anybody have a slightest idea ?
 
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Posts: 4968
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, you have some major classloader issues going on.

I'm guessing the other code was placed in the lib, or lib\app directory? That stinks.

PARENT_LAST in the EAR files will work, but again, you have to remember that you did that, and it can mess things up. When an app is expected to work one way, but behaves another way, people can get confused. Plus, you don't know what other problems that might cause.

If you've got time over Christmas, you could always write your own custom classloader. That's always fun.

For more information on Demystifying WebSphere Classloaders, especially for WAS 5 and WAS 6, check out this link:

Let's Get LOADED!!! Understanding and Configuring WebSphere and J2EE Classloaders

Happy Loading!

-Cameron McKenzie
 
Brice Laurencin
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks a lot, I wasn't aware of all the subtilities of web servers' class loading issues. The article was really helpful.
[ January 03, 2007: Message edited by: Brice Laurencin ]
 
Brice Laurencin
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok, I found a way out off this mess.

Our applications are deployed to prod with a 'Parent_LAST' ClassLoader configuration. I moved the JCA connector from the server's root to the EAR.
So now libraries are loaded correctly. It still stinks, but it works.

sweet :-/
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!