Return-Path: Delivered-To: apmail-incubator-esme-dev-archive@minotaur.apache.org Received: (qmail 61805 invoked from network); 4 Feb 2010 15:36:41 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 4 Feb 2010 15:36:41 -0000 Received: (qmail 10369 invoked by uid 500); 4 Feb 2010 15:36:41 -0000 Delivered-To: apmail-incubator-esme-dev-archive@incubator.apache.org Received: (qmail 10315 invoked by uid 500); 4 Feb 2010 15:36:40 -0000 Mailing-List: contact esme-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: esme-dev@incubator.apache.org Delivered-To: mailing list esme-dev@incubator.apache.org Received: (qmail 10305 invoked by uid 99); 4 Feb 2010 15:36:40 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 04 Feb 2010 15:36:40 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of hirsch.dick@gmail.com designates 216.239.58.184 as permitted sender) Received: from [216.239.58.184] (HELO gv-out-0910.google.com) (216.239.58.184) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 04 Feb 2010 15:36:29 +0000 Received: by gv-out-0910.google.com with SMTP id e6so41380gvc.17 for ; Thu, 04 Feb 2010 07:36:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=i5iq7f59Xix0suNInQIDTiom+wz5ZTvKLy8Pp4ro/jQ=; b=rdXkfLJK3UKz6AplwYwjyYbKPf9gaDxKUykVL4C/RPXxwdzPmbKayJtwY6E8Y46kjk FgCjyMw9lLSr+bEA6MYYJddr2nY5EaRD/7CVv7A6v1OkZDT+kVj1fGXYp11AorWqA0Xz UGMUKOfQvLmBEp6f5xDyy0aI8VCGSRD58YIXo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=W/dVLsoMOlWnsDhVq+jp3hOgcqsPd9Wj22xEzsXqjPdyiuVo3e4x51aj8gMQ9tJ/YX Zkep2xpFPs6SujGqn2tK6gryG6YWbjvp/DMxVVm8c48MX7jwTBWEuR2sZ5fCJYhexSPz XZJK/XWm0k/5U9bmmH5/kT6AfV7sZej0m4uEo= MIME-Version: 1.0 Received: by 10.102.107.2 with SMTP id f2mr818589muc.49.1265297763933; Thu, 04 Feb 2010 07:36:03 -0800 (PST) In-Reply-To: References: <94464.36641.qm@web44909.mail.sp1.yahoo.com> Date: Thu, 4 Feb 2010 16:36:03 +0100 Message-ID: Subject: Re: Tomcat/ESME: Shutdown Problems From: Richard Hirsch To: esme-dev@incubator.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org sorry. That isn't going to work. We need to use the StandardDBVendor class first. On Thu, Feb 4, 2010 at 4:34 PM, Richard Hirsch wrot= e: > LiftRules.unloadHooks.append(() =3D> dbVendor.closeAllConnections_!()) > > "dbVendor" instead of "DBVendor" > --------------- > http://wiki.liftweb.net/index.php/FAQ > > How do I execute code when my application is unloaded? > > You can define methods to be called when Lift is unloaded via the > LiftRules object in the Boot class. > > For example: > > def myUnloader(): Unit =3D { > =A0// run when Lift is being unloaded > } > > LiftRules.unloadHooks +=3D myUnloader _ > > > > On Thu, Feb 4, 2010 at 4:24 PM, Uday Subbarayan > wrote: >> I am new to Scala. I need some time to make this work. I changed this li= ne of code to, >> >> [WARNING] /home/uday/projects/M1/Prototype/esme/esme/trunk/server/src/ma= in/scala/bootstrap/liftweb/Boot.scala:300: error: value closeAllConnections= _! is not a member of object bootstrap.liftweb.DBVendor >> >> [WARNING]=A0=A0=A0=A0 LiftRules.unloadHooks.append(() =3D> DBVendor.clos= eAllConnections_!()) >> =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 ^ >> [WARNING] one error found >> >> & build FAILS. >> >> I put it under, >> >> def releaseConnection(conn: Connection): Unit =3D synchronized { >> =A0=A0=A0 pool =3D conn :: pool >> =A0=A0=A0 LiftRules.unloadHooks.append(() =3D> DBVendor.closeAllConnecti= ons_!()) >> =A0=A0=A0 notify >> =A0 } >> >> & NOT sure whether this is the right place too. >> >> Best, >> Uday. >> ------------------------- >> >> I do not blog but e-write: >> >> http://uds-web.blogspot.com >> >> --- On Thu, 2/4/10, Richard Hirsch wrote: >> >> From: Richard Hirsch >> Subject: Re: Tomcat/ESME: Shutdown Problems >> To: esme-dev@incubator.apache.org >> Date: Thursday, February 4, 2010, 3:58 AM >> >> More ideas from the lift list: >> >> "You can also add to Boot.scala (given that the StandardDBVendor is >> called dbVendor): >> >> LiftRules.unloadHooks.append(() =3D> dbVendor.closeAllConnections_!()) >> >> What this will do is close all the DB connections when the context is un= loaded. >> >> Additionally, you can switch to H2 which is generally more stable than D= erby >> in my experience." >> >> Why don't you try adding the line above to Boot.scala to see if it helps= . >> >> I've also added a Jira item to deal with the problem: >> https://issues.apache.org/jira/browse/ESME-155 >> >> D. >> >> >> >> On Wed, Feb 3, 2010 at 11:05 PM, Uday Subbarayan >> wrote: >>> Tomcat didn't shutdown. I did kill -9 on the process. >>> >>> Uday. >>> >>> ------------------------- >>> >>> I do not blog but e-write: >>> >>> http://uds-web.blogspot.com >>> >>> --- On Wed, 2/3/10, Richard Hirsch wrote: >>> >>> From: Richard Hirsch >>> Subject: Re: Tomcat/ESME: Shutdown Problems >>> To: esme-dev@incubator.apache.org >>> Date: Wednesday, February 3, 2010, 8:00 PM >>> >>> I got a comment back from David Pollack on the lift list: >>> >>> http://groups.google.com/group/liftweb/browse_thread/thread/bf498414b18= d4226/4299ce36a03749f0?show_docid=3D4299ce36a03749f0 >>> >>> Was the tomcat process really shutdown or did it hang and you had to ki= ll it. >>> >>> D. >>> >>> On Wed, Feb 3, 2010 at 8:41 PM, Richard Hirsch = wrote: >>>> No problem in jetty but I remember having problems on occasion with >>>> derby and tomcat. If I remember correctly, I sometimes had problems >>>> during hot deploys. >>>> >>>> D. >>>> >>>> On Wed, Feb 3, 2010 at 7:54 PM, Uday Subbarayan >>>> wrote: >>>>> Thanks. Did you try to shutting down & starting your container with E= SME? Just want to make sure that it's not my local environment problem. >>>>> >>>>> Best, >>>>> Uday. >>>>> >>>>> ------------------------- >>>>> >>>>> I do not blog but e-write: >>>>> >>>>> http://uds-web.blogspot.com >>>>> >>>>> --- On Wed, 2/3/10, Richard Hirsch wrote: >>>>> >>>>> From: Richard Hirsch >>>>> Subject: Re: Tomcat/ESME: Shutdown Problems >>>>> To: esme-dev@incubator.apache.org >>>>> Date: Wednesday, February 3, 2010, 6:13 PM >>>>> >>>>> looks like a lift problem that might be occur when the container shut= s down.. >>>>> >>>>> I just posted on the issue on the Lift Google Group. I'm hopeful that >>>>> someone there has an idea. >>>>> >>>>> D. >>>>> >>>>> >>>>> On Wed, Feb 3, 2010 at 4:30 PM, Uday Subbarayan >>>>> wrote: >>>>>> After I shutdown Tomcat, i see that there is lot's of stack trace in= the log file. I also noticed that derby is not getting shutdown. Next time= , when i restart Tomcat, ESME fails to load. I get all kinds of exception i= n the browser. >>>>>> >>>>>> Once i manually kill -9 on the java process then everything works fi= ne.. Here is the (partial) stack trace from the log file. Yahoo email is no= t allowing me to post full stack. >>>>>> >>>>>> Best, >>>>>> Uday. >>>>>> >>>>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >>>>>> SEVERE: >>>>>> A web application created a ThreadLocal with key of type >>>>>> [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@13f79f7]) and = a >>>>>> value of type [org.apache.derby.iapi.services.context.ContextManager= ] >>>>>> (value [org.apache.derby.iapi.services.context.ContextManager@b52a28= ]) >>>>>> but failed to remove it when the web application was stopped. To >>>>>> prevent a memory leak, the ThreadLocal has been forcibly removed. >>>>>> Feb 3, 2010 7:04:57 AM >>>>>> =A0org.apache.coyote.http11.Http11Protocol destroy >>>>>> INFO: Stopping Coyote HTTP/1.1 on http-8080 >>>>>> Exception in thread "pool-2-thread-14" java.lang.NullPointerExceptio= n >>>>>> =A0=A0=A0 at scala.runtime.BoxesRunTime.boxToLong(Unknown Source) >>>>>> =A0=A0=A0 at net.liftweb.http.S$$anonfun$net$liftweb$http$S$$wrapQue= ry$1.apply(S.scala:972) >>>>>> =A0=A0=A0 at net.liftweb.http.S$$anonfun$net$liftweb$http$S$$wrapQue= ry$1.apply(S.scala:972) >>>>>> =A0=A0=A0 at scala.List.foreach(List.scala:841) >>>>>> =A0=A0=A0 at net.liftweb.http.S$.net$liftweb$http$S$$wrapQuery(S.sca= la:972) >>>>>> =A0=A0=A0 at net.liftweb.http.S$$anonfun$net$liftweb$http$S$$_nest2I= nnerInit$1$$anonfun$apply$25.apply(S.scala:1109) >>>>>> =A0=A0=A0 at net.liftweb.http.S$.net$liftweb$http$S$$doAround(S.scal= a:906) >>>>>> =A0=A0=A0 at net.liftweb.http.S$$anonfun$net$liftweb$http$S$$doAroun= d$1..apply(S.scala:907) >>>>>> =A0=A0=A0 at >>>>>> =A0net.liftweb.mapper.MetaProtoExtendedSession$myWrapper$.apply(Prot= oExtendedSession.scala:80) >>>>>> =A0=A0=A0 at net.liftweb.http.S$.net$liftweb$http$S$$doAround(S.scal= a:907) >>>>>> >>>>>> >>>>>> >>>>>> >>>>> >>>>> >>>>> >>>>> >>>> >>> >>> >>> >>> >> >> >> >> >