Return-Path: Delivered-To: apmail-xml-cocoon-dev-archive@xml.apache.org Received: (qmail 89545 invoked by uid 500); 25 Jun 2002 09:50:00 -0000 Mailing-List: contact cocoon-dev-help@xml.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: cocoon-dev@xml.apache.org Delivered-To: mailing list cocoon-dev@xml.apache.org Received: (qmail 89511 invoked from network); 25 Jun 2002 09:49:57 -0000 Message-ID: <002101c21c2d$398f64c0$9b00a8c0@reinhp.nl> From: "Jeroen ter Voorde" To: References: <001201c21b7d$63665cf0$0a00a8c0@vgritsenkopc> <000701c21c16$62552280$9b00a8c0@reinhp.nl> Subject: Re: Servlet initializing twice Date: Tue, 25 Jun 2002 11:46:48 +0200 MIME-Version: 1.0 X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.00.2919.6600 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600 X-MIMETrack: Itemize by SMTP Server on InternetHost/TwenteNetWWW(Release 5.0.8 |June 18, 2001) at 25-06-2002 11:49:52, Serialize by Router on InternetHost/TwenteNetWWW(Release 5.0.8 |June 18, 2001) at 25-06-2002 11:50:17, Serialize complete at 25-06-2002 11:50:17 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="iso-8859-1" X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N > > ----- Original Message ----- > From: "Vadim Gritsenko" > To: > Sent: Monday, June 24, 2002 2:48 PM > Subject: RE: Servlet initializing twice > > > > > From: Jeroen ter Voorde [mailto:j.tervoorde@home.nl] > > > > > > Hi, > > > > > > I read this problem was fixed in the latest tomcat versions. But i > > still got > > > the problem with 4.0.4. > > > It seems it has something to do with the classloader I'm using a > > singleton > > > server class which also gets initialized > > > twice making me think there are two instances of the same class. With > > > > You have some classloading issues, but not the issue in subject of your > > mail. If you would have multiple servlet initializations, Cocoon will > > try to initialize twice, including HSQLDB which binds to the port and > > second instance fails to do so. In tomcat 4.0.4, this does not happen, > > and this issue is solved. > > > > > > > previous excalibur jars moving all jars from WEB-INF/lib to > > > tomcat/common/lib fixed the problem. > > > The latest excalibur jars broke the above solution so my problem is > > back > > > again :( > > > > > > Any ideas? > > > > Make your class Avalon component or make a wrapper around your class. > > Then Cocoon will be able to manage lifecycle of your class. > > > > Vadim > > > > I just made a testcomponent which only prints a line to the console. > I added the component to cocoon.xconf. I also removed the parent component > manager from web.xml > The component is initialized twice and the classes itself are also loaded > twice. > I tested this using com.myorg.MyClass.class.hashCode() which prints two > different values. > > I'm not really into the classloader stuff but i understand a class will > never be loaded twice by > the same classloader. I didn't configure the classloader with cocoon in > web.xml. > Update: Now copied all jars to tomcat/lib. Components are still initialized twice but classes are only loaded once so the singleton stuff works. Removing the tag from web.xml fixed the initialization problem but is not really an option for me. At least my biggest problem is solved. Jeroen > > > > > > > Thanks, > > > Jeroen > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org > > For additional commands, email: cocoon-dev-help@xml.apache.org > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org > For additional commands, email: cocoon-dev-help@xml.apache.org > --------------------------------------------------------------------- To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org For additional commands, email: cocoon-dev-help@xml.apache.org