----- Original Message ----- From: "Vadim Gritsenko" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, June 24, 2002 2:48 PM Subject: RE: Servlet initializing twice
> > From: Jeroen ter Voorde [mailto:[EMAIL PROTECTED]] > > > > 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. > > > Thanks, > > Jeroen > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, email: [EMAIL PROTECTED] > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]