0 Replies Latest reply on Aug 15, 2003 10:50 AM by cwstanton

    Complex Classpath Question

    cwstanton

      (This is also posted in the Beginner forum. I thought maybe is was appropriate for this forum, too.)

      We have a core set of EJBs and several web applications--all currently deployed as a single EAR. We also have a few MBeans--two of which pass custom value object classes back and forth with our EJBs. Presently, I package separate instances of those classes both in the mbeans.jar and in the ejb.jar. (Which end up in the .sar and the .ear, respectively.) But I understand that this results in serialization of the classes since the .sar and the .ear have different classloaders that don't share. (Can they be taught to share?) ;-)

      For reasons of development and licensing, we'd like to split out each web application into its own deployable .war. However, this is going to mean even more classpath juggling.

      Here is my question: I know I could dump all the "common" classes into a .jar and put it in the server/xxx/lib directory, but this would prevent "hot deploys" during development--and that's not acceptable. I could also put this common.jar into server/xxx/deploy, but as far as I can tell, there is no way to control the order that .ears, .wars and .jars are deployed. (Is there?) So the .ear may be deployed before the .jar, resulting in a host of ClassNotFoundExceptions...

      So, how have others solved this? If you have a .sar, an .ear and a .war that all depend on common classes, and you DON'T want to put those common classes in the /lib directory (because you want to be able to hot deploy them), how do you make those common classes available to "everyone?"

      Ideally, how do I get the ConfigClassLoader to load a specific .jar from the /deploy directory before deploying anything else? (Considered another way--Services (.sars) can list dependencies that must be loaded first. Can .ears and .wars list such dependencies??)

      Sorry if I missed the solution to this in the forums or docs somewhere, but I really don't know where to find this...

      Thanks!

      Charles