1 Reply Latest reply on Jul 10, 2003 1:05 PM by Matt Clark

    java.lang.IllegalAccessException / Multiple class loaders fo

    Matt Clark Newbie

      We're migrating from 3.0.4 to 3.2.1, and I'm down to what I hope is my last problem :)

      Some beans seem to be deployed correctly and are working, but one service call I'm trying to make generates this exception:

      2003-07-10 10:29:08,230 ERROR [org.jboss.ejb.plugins.LogInterceptor] Unexpected Error: java.lang.IllegalaccessError: tried to access class com.bar.Foo$1 from class com.bar.Foo
      at com.bar.Foo.(Foo.java:39)
      .
      .
      .

      When I look back in my deployment debug logs, I see this message for every bean I have:

      DEBUG org.jboss.mc.loading.UnifiedClassLoader] New jmx UCL with url file:/usr/jboss/jboss-3.2.1/server/foo/tmp/deploy/server/foo/deploy/FooEJB.jar

      DEBUG org.jboss.mx.loading.UnifiedClassLoaderRepository3] Adding org.jboss.mx.loading.UnifiedClassLoader2@234265{ url=file:/usr/jboss/jboss-3.2.1/server/foo/tmp/deploy/server/foo/deploy/FooEJB.jar/18.FooEJB.jar ,addedOrder=0}

      (This next line is repeated for every bean I have)
      DEBUG [org.jboss.mx.loading.ClassLoaderUtils] Multiple class loaders found for pkg: com.bar.ejb


      Do I have something set up wrong? Both jboss-minimal.xml and jboss-service.xml have the URLDeploymentScanner URLS set to "deploy/", and the jboss-service.xml has RecursiveSearch set to false (we ran into problems with it set to true).

      Thanks,
      Matt Clark

        • 1. Re: java.lang.IllegalAccessException / Multiple class loader
          Matt Clark Newbie

          Ok, answered my own question. Just in case it helps anyone else:

          We have a FooEJB.jar in the deploy directory that contains all of the bean classes. It's created by an ant task that specifies file filters to catch all of the bean classes. We also have a FooServer.jar class that contains all of the necessary helper classes in the lib directory. We had an anonymous inner class that was being created for one of our bean implementations (not sure why), and it was mistakenly being packaged in the server jar instead of the ejb jar. When the bean tried to access its inner class, we got the IllegalAccessException.

          As for the duplicate class loader, no answer yet...