1 Reply Latest reply on Feb 10, 2009 8:46 AM by andrewarc

    Classloading possible?

    andrewarc

      To briefly outline the problem: I've got an application packaged as .ear, properly deployed and within one of the POJOs I'm trying to do the following:
      Use a ClassLoader to load a .class file from my file-system.

      ClassLoader oldLoader = Thread.currentThread().getContextClassLoader();
      URLClassLoader classLoader = new URLClassLoader(
      new URL[] {fClazz.toURL()},oldLoader);
       Thread.currentThread().setContextClassLoader(classLoader);
      
      classLoader.loadClass(QName);
      Class.forName(QName,true,classLoader).getCanonicalName()
      


      I've already
      Although the File Object fClazz exists and is accessible by the appserver, I get

        • 1. Re: Classloading possible?
          andrewarc

          Sorry, I incidentally submitted the last post...

          The code above fails with a ava.lang.ClassNotFoundException
          Is this the proper way of doing classloading within the JBoss appserver?

          Thanks for your help
          kr A.