This particular issue has to do with class loading in Tomcat after Tomcat
thinks the app should be terminated.  This is a bug in Tomcat.

Specifically, Tomcat disallows class loading after it thinks an app should
be shut down.  Scala on the other hand has lots of anonymous classes that it
uses (everything inside a for comprehension is an anonymous class).  So, any
anonymous inner classes that are loaded during the shutdown process cause
this problem in Tomcat.  In the instant case:

for ((id, session) <- ses.elements) {
        session.doCometActorCleanup()
        if (now - session.lastServiceTime > session.inactivityLength ||
session.markedForTermination) {
          Log.info(" Session " + id + " expired")
          this.sendMsg(RemoveSession(id))
        } else {
          session.cleanupUnseenFuncs()
        }
      }



On Fri, Feb 26, 2010 at 3:22 PM, Cliff Zhao <zha...@gmail.com> wrote:

> But I am using Lift 2.0 snapshot, I got the following exception:
>
> INFO: Illegal access: this web application instance has been stopped
> already.  C
> ould not load
> net.liftweb.http.SessionMaster$$anonfun$1$$anonfun$apply$11$$anonf
> un$apply$12.  The eventual following stack trace is caused by an error
> thrown fo
> r debugging purposes as well as to attempt to terminate the thread which
> caused
> the illegal access, and has no functional impact.
> java.lang.IllegalStateException
>         at
> org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoa
> der.java:1370)
>         at
> org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoa
> der.java:1329)
>         at
> net.liftweb.http.SessionMaster$$anonfun$1$$anonfun$apply$11.apply(Lif
> tSession.scala:164)
>         at
> net.liftweb.http.SessionMaster$$anonfun$1$$anonfun$apply$11.apply(Lif
> tSession.scala:161)
>         at scala.collection.Iterator$class.foreach(Iterator.scala:582)
>         at
> scala.collection.IndexedSeqLike$Elements.foreach(IndexedSeqLike.scala
> :47)
>         at
> net.liftweb.http.SessionMaster$$anonfun$1.apply(LiftSession.scala:161
> )
>         at
> net.liftweb.http.SessionMaster$$anonfun$1.apply(LiftSession.scala:138
> )
>         at
> net.liftweb.actor.LiftActor$class.execTranslate(LiftActor.scala:339)
>         at
> net.liftweb.http.SessionMaster$.execTranslate(LiftSession.scala:93)
>         at net.liftweb.actor.SpecializedLiftActor$class.net
> $liftweb$actor$Specia
> lizedLiftActor$$proc2(LiftActor.scala:232)
>         at
> net.liftweb.actor.SpecializedLiftActor$$anonfun$net$liftweb$actor$Spe
> cializedLiftActor$$processMailbox$1.apply(LiftActor.scala:153)
>         at
> net.liftweb.actor.SpecializedLiftActor$$anonfun$net$liftweb$actor$Spe
> cializedLiftActor$$processMailbox$1.apply(LiftActor.scala:153)
>         at
> net.liftweb.actor.SpecializedLiftActor$class.around(LiftActor.scala:1
> 67)
>         at net.liftweb.http.SessionMaster$.around(LiftSession.scala:93)
>         at net.liftweb.actor.SpecializedLiftActor$class.net
> $liftweb$actor$Specia
> lizedLiftActor$$processMailbox(LiftActor.scala:152)
>         at
> net.liftweb.actor.SpecializedLiftActor$$anonfun$3$$anonfun$apply$1.ap
> ply(LiftActor.scala:116)
>         at
> net.liftweb.actor.SpecializedLiftActor$$anonfun$3$$anonfun$apply$1.ap
> ply(LiftActor.scala:116)
>         at
> net.liftweb.actor.LAScheduler$$anonfun$1$$anon$1$$anon$2.run(LiftActo
> r.scala:44)
>         at
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExec
> utor.java:886)
>         at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
> .java:908)
>         at java.lang.Thread.run(Thread.java:619)
> Exception in thread "pool-2-thread-7" java.lang.NoClassDefFoundError:
> net/liftwe
> b/http/SessionMaster$$anonfun$1$$anonfun$apply$11$$anonfun$apply$12
>         at
> net.liftweb.http.SessionMaster$$anonfun$1$$anonfun$apply$11.apply(Lif
> tSession.scala:164)
>         at
> net.liftweb.http.SessionMaster$$anonfun$1$$anonfun$apply$11.apply(Lif
> tSession.scala:161)
>         at scala.collection.Iterator$class.foreach(Iterator.scala:582)
>         at
> scala.collection.IndexedSeqLike$Elements.foreach(IndexedSeqLike.scala
> :47)
>         at
> net.liftweb.http.SessionMaster$$anonfun$1.apply(LiftSession.scala:161
> )
>         at
> net.liftweb.http.SessionMaster$$anonfun$1.apply(LiftSession.scala:138
> )
>         at
> net.liftweb.actor.LiftActor$class.execTranslate(LiftActor.scala:339)
>         at
> net.liftweb.http.SessionMaster$.execTranslate(LiftSession.scala:93)
>         at net.liftweb.actor.SpecializedLiftActor$class.net
> $liftweb$actor$Specia
> lizedLiftActor$$proc2(LiftActor.scala:232)
>         at
> net.liftweb.actor.SpecializedLiftActor$$anonfun$net$liftweb$actor$Spe
> cializedLiftActor$$processMailbox$1.apply(LiftActor.scala:153)
>         at
> net.liftweb.actor.SpecializedLiftActor$$anonfun$net$liftweb$actor$Spe
> cializedLiftActor$$processMailbox$1.apply(LiftActor.scala:153)
>         at
> net.liftweb.actor.SpecializedLiftActor$class.around(LiftActor.scala:1
> 67)
>         at net.liftweb.http.SessionMaster$.around(LiftSession.scala:93)
>         at net.liftweb.actor.SpecializedLiftActor$class.net
> $liftweb$actor$Specia
> lizedLiftActor$$processMailbox(LiftActor.scala:152)
>         at
> net.liftweb.actor.SpecializedLiftActor$$anonfun$3$$anonfun$apply$1.ap
> ply(LiftActor.scala:116)
>         at
> net.liftweb.actor.SpecializedLiftActor$$anonfun$3$$anonfun$apply$1.ap
> ply(LiftActor.scala:116)
>         at
> net.liftweb.actor.LAScheduler$$anonfun$1$$anon$1$$anon$2.run(LiftActo
> r.scala:44)
>         at
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExec
> utor.java:886)
>         at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
> .java:908)
>         at java.lang.Thread.run(Thread.java:619)
> Caused by: java.lang.ClassNotFoundException:
> net.liftweb.http.SessionMaster$$ano
> nfun$1$$anonfun$apply$11$$anonfun$apply$12
>         at
> org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoa
> der.java:1484)
>         at
> org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoa
> der.java:1329)
>         ... 20 more
>
> Just found on the Tomcat console. It is not the same, but I think it is
> related, it has LiftActor in the stack trace.
>
> Best Regards,
> Cliff Zhao
>
>
>
>
> On Fri, Feb 26, 2010 at 4:22 PM, David Pollak <
> feeder.of.the.be...@gmail.com> wrote:
>
>> Use Lift 1.0.3 and Scala 2.7.7
>>
>> Or even better, use Lift 2.0-M2 and Scala 2.7.7
>>
>> Scala Actors have notorious issues and we moved to our own Actor
>> implementation which avoids most of the Scala Actor issues.
>>
>>
>> On Fri, Feb 26, 2010 at 11:31 AM, Donald McLean <dmclea...@gmail.com>wrote:
>>
>>> After researching various issues, I carefully checked to insure that I
>>> am actually using Lift 1.0.2 with Scala 2.7.5.
>>>
>>> I am seeing numerous exceptions in the log. One is single error and
>>> all of the others relate to actors.
>>>
>>> Any suggestions would be greatly appreciated.
>>>
>>> Donald
>>>
>>> 1. Occurs almost immediately after deploying the web app
>>>
>>> 26 Feb 2010 13:57:37,726 - ERROR lift - Servlet destruction failure
>>> java.lang.RuntimeException: snapshot operation not supported.
>>>        at scala.Predef$.error(Predef.scala:76)
>>>        at scala.actors.Scheduler$.snapshot(Scheduler.scala:53)
>>>        at net.liftweb.http.LiftServlet.destroy(LiftServlet.scala:56)
>>>        at net.liftweb.http.LiftFilter.destroy(LiftServlet.scala:570)
>>>        at
>>> org.apache.catalina.core.ApplicationFilterConfig.release(ApplicationFilterConfig.java:332)
>>>        at
>>> org.apache.catalina.core.StandardContext.filterStop(StandardContext.java:3835)
>>>        at
>>> org.apache.catalina.core.StandardContext.stop(StandardContext.java:4567)
>>>        at
>>> org.apache.catalina.manager.ManagerServlet.undeploy(ManagerServlet.java:1363)
>>>        at
>>> org.apache.catalina.manager.HTMLManagerServlet.undeploy(HTMLManagerServlet.java:562)
>>>        at
>>> org.apache.catalina.manager.HTMLManagerServlet.doGet(HTMLManagerServlet.java:123)
>>>        at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
>>>        at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
>>>        at
>>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
>>>       at
>>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>>>       at
>>> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
>>>        at
>>> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
>>>        at
>>> org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:525)
>>>        at
>>> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
>>>        at
>>> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
>>>        at
>>> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
>>>        at
>>> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
>>>        at
>>> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
>>>        at
>>> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583
>>> )
>>>        at
>>> org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
>>>        at java.lang.Thread.run(Thread.java:619)
>>>
>>> 2. This occurs several times - one for each actor?
>>>
>>> INFO org.apache.catalina.loader.WebappClassLoader - Illegal access: this
>>> web ap
>>> plication instance has been stopped already.  Could not load
>>> scala.actors.Actor$$anonfun$9.  The eventual
>>> following stack trace is caused by an error thrown for debugging
>>> purposes as well as to attempt to termina
>>> te the thread which caused the illegal access, and has no functional
>>> impact.
>>> java.lang.IllegalStateException
>>>        at
>>> org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1273)
>>>        at
>>> org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233)
>>>        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
>>>        at scala.actors.Actor$class.exitLinked(Actor.scala:895)
>>>        at
>>> net.liftweb.http.SessionMaster$.exitLinked(LiftSession.scala:118)
>>>       at scala.actors.Actor$class.exitLinked(Actor.scala:907)
>>> at net.liftweb.http.SessionMaster$.exitLinked(LiftSession.scala:118)
>>>     at scala.actors.Reaction.run(Reaction.scala:99)        at
>>>
>>> net.liftweb.http.ActorSchedulerFixer$$anon$1$$anon$3.run(LiftServlet.scala:673)
>>>        at
>>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
>>>        at
>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>>>        at java.lang.Thread.run(Thread.java:619)
>>>
>>> --
>>> Family photographs are a critical legacy for
>>> ourselves and our descendants. Protect that
>>> legacy with a digital backup and recovery plan.
>>>
>>> Join the photo preservation advocacy Facebook group:
>>> http://www.facebook.com/home.php?ref=logo#/group.php?gid=148274709288
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "Lift" group.
>>> To post to this group, send email to lift...@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> liftweb+unsubscr...@googlegroups.com<liftweb%2bunsubscr...@googlegroups.com>
>>> .
>>> For more options, visit this group at
>>> http://groups.google.com/group/liftweb?hl=en.
>>>
>>>
>>
>>
>> --
>> Lift, the simply functional web framework http://liftweb.net
>> Beginning Scala http://www.apress.com/book/view/1430219890
>> Follow me: http://twitter.com/dpp
>> Surf the harmonics
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Lift" group.
>> To post to this group, send email to lift...@googlegroups.com.
>> To unsubscribe from this group, send email to
>> liftweb+unsubscr...@googlegroups.com<liftweb%2bunsubscr...@googlegroups.com>
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/liftweb?hl=en.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Lift" group.
> To post to this group, send email to lift...@googlegroups.com.
> To unsubscribe from this group, send email to
> liftweb+unsubscr...@googlegroups.com<liftweb%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/liftweb?hl=en.
>



-- 
Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Follow me: http://twitter.com/dpp
Surf the harmonics

-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.

Reply via email to