2 Replies Latest reply on Dec 9, 2005 1:25 AM by starksm64

    ThreadDeath when logging into web application using jaas

    hypernova

      hi

      i have a problem with a webapp running on jboss 4.0
      when i try to log into the protected area of the web app sometimes i get the following exception:

      2005-10-07 13:34:51,303 [TP-Processor12] INFO WebappClassLoader - Illegal access: this web application instance has been stopped already. Could not load org.jboss.security.auth.spi.ProxyLoginModule. The eventual following stack tra
      ce is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact.
      2005-10-07 13:34:51,303 [TP-Processor12] ERROR CoyoteAdapter - An exception or error occurred in the container during the request processing
      java.lang.ThreadDeath
      at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1221)
      at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1181)
      at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
      at java.lang.Class.forName0(Native Method)
      at java.lang.Class.forName(Class.java:242)
      at javax.security.auth.login.LoginContext.invoke(LoginContext.java:731)
      at javax.security.auth.login.LoginContext.access$000(LoginContext.java:186)
      at javax.security.auth.login.LoginContext$4.run(LoginContext.java:683)
      at java.security.AccessController.doPrivileged(Native Method)
      at javax.security.auth.login.LoginContext.invokePriv(LoginContext.java:680)
      at javax.security.auth.login.LoginContext.logout(LoginContext.java:629)
      at org.jboss.security.plugins.JaasSecurityManager$DomainInfo.destroy(JaasSecurityManager.java:85)
      at org.jboss.util.TimedCachePolicy.get(TimedCachePolicy.java:166)
      at org.jboss.security.plugins.JaasSecurityManager.getCacheInfo(JaasSecurityManager.java:591)
      at org.jboss.security.plugins.JaasSecurityManager.isValid(JaasSecurityManager.java:243)
      at org.jboss.web.tomcat.security.JBossSecurityMgrRealm.authenticate(JBossSecurityMgrRealm.java:230)
      at org.apache.catalina.authenticator.FormAuthenticator.authenticate(FormAuthenticator.java:256)
      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:391)
      at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
      at org.apache.catalina.valves.FastCommonAccessLogValve.invoke(FastCommonAccessLogValve.java:481)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
      at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:307)
      at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:385)
      at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:748)
      at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:678)
      at org.apache.jk.common.SocketConnection.runIt(ChannelSocket.java:871)
      at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
      at java.lang.Thread.run(Thread.java:595)


      actually this looks similar to another documented bug with classloading of log4j. the strange thing is that it does not happen everytime, sometimes the login works fine. i could not yet determine under which circumstances the error happens and when not.

      any ideas??

        • 1. Re: ThreadDeath when logging into web application using jaas

          I have a similar problem. I hot deploy my war file , which gets deployed. Then I access the webpage which makes a server request and during this request I get this exception:




          class org.jboss.cache.interceptors.CacheLoaderInterceptor
          class org.jboss.cache.interceptors.UnlockInterceptor
          class org.jboss.cache.interceptors.ReplicationInterceptor
          class org.jboss.cache.interceptors.CacheStoreInterceptor
          10:25:17,730 INFO [TreeCache] cache mode is REPL_ASYNC
          10:25:17,973 INFO [STDOUT]
          -------------------------------------------------------
          GMS: address is 172.16.96.28:58804
          -------------------------------------------------------
          10:25:20,022 INFO [WebappClassLoader] Illegal access: this web application instance has been stopped already. Could not load commons-logging.properties. The eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact.
          10:25:20,024 INFO [WebappClassLoader] Illegal access: this web application instance has been stopped already. Could not load META-INF/services/org.apache.commons.logging.LogFactory. The eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact.
          10:25:20,026 INFO [WebappClassLoader] Illegal access: this web application instance has been stopped already. Could not load org.apache.log4j.Logger. The eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact.
          10:25:20,027 INFO [WebappClassLoader] Illegal access: this web application instance has been stopped already. Could not load java.util.logging.Logger. The eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact.
          10:25:20,028 INFO [WebappClassLoader] Illegal access: this web application instance has been stopped already. Could not load org.apache.commons.logging.impl.SimpleLog. The eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact.
          10:25:20,031 INFO [STDOUT] java.lang.ExceptionInInitializerError
          10:25:20,032 INFO [STDOUT] at org.jgroups.protocols.UNICAST.handleDataReceived(UNICAST.java:356)
          10:25:20,033 INFO [STDOUT] at org.jgroups.protocols.UNICAST.up(UNICAST.java:166)
          10:25:20,033 INFO [STDOUT] at org.jgroups.stack.UpHandler.run(Protocol.java:59)
          10:25:20,034 INFO [STDOUT] Caused by: org.apache.commons.logging.LogConfigurationException: org.apache.commons.logging.LogConfigurationException: java.lang.ThreadDeath
          10:25:20,035 INFO [STDOUT] at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:532)
          10:25:20,035 INFO [STDOUT] at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:272)
          10:25:20,036 INFO [STDOUT] at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:246)
          10:25:20,037 INFO [STDOUT] at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:395)
          10:25:20,037 INFO [STDOUT] at org.jgroups.stack.AckReceiverWindow.(AckReceiverWindow.java:28)
          10:25:20,038 INFO [STDOUT] ... 3 more
          10:25:20,039 INFO [STDOUT] Caused by: org.apache.commons.logging.LogConfigurationException: java.lang.ThreadDeath
          10:25:20,040 INFO [STDOUT] at org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogFactoryImpl.java:416)
          10:25:20,040 INFO [STDOUT] at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:525)
          10:25:20,041 INFO [STDOUT] ... 7 more
          10:25:20,042 INFO [STDOUT] Caused by: java.lang.ThreadDeath
          10:25:20,042 INFO [STDOUT] at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1221)
          10:25:20,043 INFO [STDOUT] at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1181)
          10:25:20,044 INFO [STDOUT] at org.apache.commons.logging.impl.LogFactoryImpl$1.run(LogFactoryImpl.java:460)
          10:25:20,044 INFO [STDOUT] at java.security.AccessController.doPrivileged(Native Method)
          10:25:20,045 INFO [STDOUT] at org.apache.commons.logging.impl.LogFactoryImpl.loadClass(LogFactoryImpl.java:454)
          10:25:20,045 INFO [STDOUT] at org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogFactoryImpl.java:406)
          10:25:20,046 INFO [STDOUT] ... 8 more
          [Unloading class sun.reflect.GeneratedMethodAccessor6]
          [Unloading class sun.reflect.GeneratedSerializationConstructorAccessor5]
          [Unloading class sun.reflect.GeneratedMethodAccessor7]
          [Unloading class sun.reflect.GeneratedMethodAccessor5]

          • 2. Re: ThreadDeath when logging into web application using jaas
            starksm64

            You have a bad commons logging that is holding onto the previous deployer class loader. Get rid of the logging classes from your war.