1 Reply Latest reply on Mar 8, 2006 3:18 AM by rino_salvade

    Dynamic Class Loading fails with base class in the ear file

    rino_salvade

      We have an application that gets dynamically extended with new classes that are placed into separate jar files. These jar files are placed in the default/lib directory. The application does not know about these classes beforehand, i.e. it has not manifest entry in any jar file to reference the newly added jars.
      The base class of these classes is located in the ear file of our application.
      The classs are instantiated with

      Thread.currentThread().getContextClassLoader().loadClass(classname)
      . We then get a ClassNotFoundException with the name of the base class in the msg field set.
      Are these kind of things possible at all? Does the jar file need a special manifest entry to find the base classe?
      We're running Jboss 4.0.2 plain out of the box under Windows XP.

      The exception we get looks like this
      java.lang.ClassNotFoundException:
      Unexpected error during load of: com.tkc.pass.batch.event.hellouniverse.HelloUniverseEventFactory, msg=com/tkc/pass/batch/processing/EventFactoryAbs
       at org.jboss.mx.loading.RepositoryClassLoader.loadClassImpl(RepositoryClassLoader.java:500)
       at org.jboss.mx.loading.RepositoryClassLoader.loadClass(RepositoryClassLoader.java:374)
       at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
       at org.jboss.util.loading.DelegatingClassLoader.loadClass(DelegatingClassLoader.java:77)
       at org.jboss.mx.loading.LoaderRepositoryClassLoader.loadClass(LoaderRepositoryClassLoader.java:78)
       at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
       at org.jboss.util.loading.DelegatingClassLoader.loadClass(DelegatingClassLoader.java:77)
       at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
       at com.tkc.pass.batch.server.service.Batch.getEventFactory(Batch.java:51)
       at com.tkc.pass.batch.server.service.Batch.generateEvent(Batch.java:87)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)