Skip to Main Content

Java HotSpot Virtual Machine

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Dynamic class loading from JARs in web application

843829May 3 2006
Hello,

I'm working on a web project in which we would like to dynamically load plugins without server restart.

We have developed our own ClassLoader in order to load the plugins from a path or with a user interface upload function.

The class loader hierarchy should be something like this:
      Bootstrap
          |
       System
          |
       Common
      /      \
 Catalina   Shared
             /   \
        Webapp1  OurSystem
                     \
                   PluginClassLoader
The all works fine within the classes loaded in the PluginClassLoader, but classes loaded in OurSystems class loader cannot access classes loaded in PluginClassLoader. For example when Hibernate tries to load classes definied in mapping files we got a java.lang.ClassNotFoundException.

Is there a way to load classes dynamically to OurSystems class loader or notify it about PluginClassLoaders classes?

Or is this a bad way to do it?

Best regards,
Kristoffer Renholm
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 31 2006
Added on May 3 2006
0 comments
180 views