1 Reply Latest reply on May 11, 2004 11:57 AM by Scott Stark

    package javax.security.auth.login: already loaded

    ksdeo Newbie

      Hi,
      I recently upgraded from 3.2.1 to 3.2.3 and I am getting the following deployment error loading a ear file.
      java.lang.NoClassDefFoundError: javax/security/auth/login/LoginException

      There are 3 ear files, say A, B, and C. Each is loaded in its own class loader. The jaas.jar file is included in all of these ear files.

      When I browsed through the class loading trace, I found this error...

      [42546,UnifiedClassLoader,main] getResourceLocally(org.jboss.mx.loading.UnifiedClassLoader3@8cb492{ url=file:/opt/jboss-3.2.3/server/all/tmp/deploy/tmp4386201PI.ear ,addedOrder=43}), name=javax/security/auth/login/LoginException.class, resURL:jar:file:/usr/java/j2sdk1.4.2_01/jre/lib/rt.jar!/javax/security/auth/login/LoginException.class
      [42546,LoadMgr3,main] Replacing UCL: org.jboss.mx.loading.HeirarchicalLoaderRepository3$CacheClassLoader@12f1eff{ url=null ,addedOrder=0} with UCL:org.jboss.mx.loading.UnifiedClassLoader3@8cb492{ url=file:/opt/jboss-3.2.3/server/all/tmp/deploy/tmp4386201PI.ear ,addedOrder=43}
      [42546,LoadMgr3,main] scheduleTask(1), created subtask: {t=Thread[main,5,jboss], ucl=org.jboss.mx.loading.UnifiedClassLoader3@8cb492{ url=file:/opt/jboss-3.2.3/server/all/tmp/deploy/tmp4386201PI.ear ,addedOrder=43}, name=javax.security.auth.login.LoginException, requestingThread=Thread[main,5,jboss], order=0, releaseInNextTask=false}
      [42546,LoadMgr3,main] End beginLoadTask, task=org.jboss.mx.loading.ClassLoadingTask@c9b619{classname: javax.security.auth.login.LoginException, requestingThread: Thread[main,5,jboss], requestingClassLoader: org.jboss.mx.loading.UnifiedClassLoader3@8cb492{ url=file:/opt/jboss-3.2.3/server/all/tmp/deploy/tmp4386201PI.ear ,addedOrder=43}, loadedClass: null, loadOrder: 2147483647, loadException: null, threadTaskCount: 1, state: 1}
      [42546,LoadMgr3,main] Continue nextTask(1), task=org.jboss.mx.loading.ClassLoadingTask@c9b619{classname: javax.security.auth.login.LoginException, requestingThread: Thread[main,5,jboss], requestingClassLoader: org.jboss.mx.loading.UnifiedClassLoader3@8cb492{ url=file:/opt/jboss-3.2.3/server/all/tmp/deploy/tmp4386201PI.ear ,addedOrder=43}, loadedClass: null, loadOrder: 2147483647, loadException: null, threadTaskCount: 1, state: 1}
      [42546,LoadMgr3,main] Begin nextTask(0), loadTask=org.jboss.mx.loading.ClassLoadingTask@c9b619{classname: javax.security.auth.login.LoginException, requestingThread: Thread[main,5,jboss], requestingClassLoader: org.jboss.mx.loading.UnifiedClassLoader3@8cb492{ url=file:/opt/jboss-3.2.3/server/all/tmp/deploy/tmp4386201PI.ear ,addedOrder=43}, loadedClass: null, loadOrder: 2147483647, loadException: null, threadTaskCount: 1, state: 1}
      [42547,LoadMgr3,main] Running threadTask={t=Thread[main,5,jboss], ucl=org.jboss.mx.loading.UnifiedClassLoader3@8cb492{ url=file:/opt/jboss-3.2.3/server/all/tmp/deploy/tmp4386201PI.ear ,addedOrder=43}, name=javax.security.auth.login.LoginException, requestingThread=Thread[main,5,jboss], order=0, releaseInNextTask=false}
      [42547,UnifiedClassLoader,main] loadClassLocally, name=javax.security.auth.login.LoginException
      [42559,ClassLoadingTask,main] setLoadedClass, theClass=null, order=0
      [42562,LoadMgr3,main] Run failed with exception
      java.lang.SecurityException: sealing violation: can't seal package javax.security.auth.login: already loaded
      at java.net.URLClassLoader.defineClass(URLClassLoader.java:234)
      at java.net.URLClassLoader.access$100(URLClassLoader.java:55)
      at java.net.URLClassLoader$1.run(URLClassLoader.java:194)


      I can see that the class is loaded previously and if I am not mistaken its in a different class loader than the above.
      Here is the log where jboss loads the class prior to the above error...



      [31008,LoadMgr3,main] Begin beginLoadTask, task=org.jboss.mx.loading.ClassLoadingTask@1ab6db4{classname: javax.security.auth.login.LoginException, requestingThread: Thread[main,5,jboss], requestingClassLoader: org.jboss.mx.loading.UnifiedClassLoader3@ff057f{ url=file:/opt/jboss-3.2.3/server/all/tmp/deploy/tmp43800jboss-service.xml ,addedOrder=2}, loadedClass: null, loadOrder: 2147483647, loadException: null, threadTaskCount: 0, state: 0}
      [31009,UnifiedClassLoader,main] getResourceLocally(org.jboss.mx.loading.UnifiedClassLoader3@ff057f{ url=file:/opt/jboss-3.2.3/server/all/tmp/deploy/tmp43800jboss-service.xml ,addedOrder=2}), name=javax/security/auth/login/LoginException.class, resURL:jar:file:/usr/java/j2sdk1.4.2_01/jre/lib/rt.jar!/javax/security/auth/login/LoginException.class
      [31009,LoadMgr3,main] scheduleTask(1), created subtask: {t=Thread[main,5,jboss], ucl=org.jboss.mx.loading.UnifiedClassLoader3@ff057f{ url=file:/opt/jboss-3.2.3/server/all/tmp/deploy/tmp43800jboss-service.xml ,addedOrder=2}, name=javax.security.auth.login.LoginException, requestingThread=Thread[main,5,jboss], order=2, releaseInNextTask=false}
      [31009,LoadMgr3,main] End beginLoadTask, task=org.jboss.mx.loading.ClassLoadingTask@1ab6db4{classname: javax.security.auth.login.LoginException, requestingThread: Thread[main,5,jboss], requestingClassLoader: org.jboss.mx.loading.UnifiedClassLoader3@ff057f{ url=file:/opt/jboss-3.2.3/server/all/tmp/deploy/tmp43800jboss-service.xml ,addedOrder=2}, loadedClass: null, loadOrder: 2147483647, loadException: null, threadTaskCount: 1, state: 1}
      [31009,LoadMgr3,main] Continue nextTask(1), task=org.jboss.mx.loading.ClassLoadingTask@1ab6db4{classname: javax.security.auth.login.LoginException, requestingThread: Thread[main,5,jboss], requestingClassLoader: org.jboss.mx.loading.UnifiedClassLoader3@ff057f{ url=file:/opt/jboss-3.2.3/server/all/tmp/deploy/tmp43800jboss-service.xml ,addedOrder=2}, loadedClass: null, loadOrder: 2147483647, loadException: null, threadTaskCount: 1, state: 1}
      [31009,LoadMgr3,main] Begin nextTask(0), loadTask=org.jboss.mx.loading.ClassLoadingTask@1ab6db4{classname: javax.security.auth.login.LoginException, requestingThread: Thread[main,5,jboss], requestingClassLoader: org.jboss.mx.loading.UnifiedClassLoader3@ff057f{ url=file:/opt/jboss-3.2.3/server/all/tmp/deploy/tmp43800jboss-service.xml ,addedOrder=2}, loadedClass: null, loadOrder: 2147483647, loadException: null, threadTaskCount: 1, state: 1}
      [31009,LoadMgr3,main] Running threadTask={t=Thread[main,5,jboss], ucl=org.jboss.mx.loading.UnifiedClassLoader3@ff057f{ url=file:/opt/jboss-3.2.3/server/all/tmp/deploy/tmp43800jboss-service.xml ,addedOrder=2}, name=javax.security.auth.login.LoginException, requestingThread=Thread[main,5,jboss], order=2, releaseInNextTask=false}
      [31009,UnifiedClassLoader,main] loadClassLocally, name=javax.security.auth.login.LoginException
      [31009,ClassLoadingTask,main] setLoadedClass, theClass=class javax.security.auth.login.LoginException, order=2
      [31009,UnifiedLoaderRepository3,main] cacheLoadedClass, classname: javax.security.auth.login.LoginException, class: class javax.security.auth.login.LoginException, ucl: null
      [31009,LoadMgr3,main] Notifying task of thread completion, loadTask:org.jboss.mx.loading.ClassLoadingTask@1ab6db4{classname: javax.security.auth.login.LoginException, requestingThread: Thread[main,5,jboss], requestingClassLoader: org.jboss.mx.loading.UnifiedClassLoader3@ff057f{ url=file:/opt/jboss-3.2.3/server/all/tmp/deploy/tmp43800jboss-service.xml ,addedOrder=2}, loadedClass: class javax.security.auth.login.LoginException@1af485b<CodeSource: null>, loadOrder: 2, loadException: null, threadTaskCount: 0, state: 1}
      [31009,LoadMgr3,main] End nextTask(0), loadTask=org.jboss.mx.loading.ClassLoadingTask@1ab6db4{classname: javax.security.auth.login.LoginException, requestingThread: Thread[main,5,jboss], requestingClassLoader: org.jboss.mx.loading.UnifiedClassLoader3@ff057f{ url=file:/opt/jboss-3.2.3/server/all/tmp/deploy/tmp43800jboss-service.xml ,addedOrder=2}, loadedClass: class javax.security.auth.login.LoginException@1af485b<CodeSource: null>, loadOrder: 2, loadException: null, threadTaskCount: 0, state: 4}
      [31010,LoadMgr3,main] Begin endLoadTask, task=org.jboss.mx.loading.ClassLoadingTask@1ab6db4{classname: javax.security.auth.login.LoginException, requestingThread: Thread[main,5,jboss], requestingClassLoader: org.jboss.mx.loading.UnifiedClassLoader3@ff057f{ url=file:/opt/jboss-3.2.3/server/all/tmp/deploy/tmp43800jboss-service.xml ,addedOrder=2}, loadedClass: class javax.security.auth.login.LoginException@1af485b<CodeSource: null>, loadOrder: 2, loadException: null, threadTaskCount: 0, state: 4}
      [31010,UnifiedClassLoader3,main] release(1) for :org.jboss.mx.loading.UnifiedClassLoader3@ff057f{ url=file:/opt/jboss-3.2.3/server/all/tmp/deploy/tmp43800jboss-service.xml ,addedOrder=2}
      [31010,UnifiedClassLoader3,main] released, holds: 0



      I am not sure what needs to be changed to make this work. One interesting thing I found out was replacing the jaas.jar file with jboss-jaas.jar file did not throw any errors, and the deployment was successfull.

      Thanks in advance,

      Kedar Deo