hi Uma, If the same application is working fine with tomcat + windows and not working with tomcat+ linux, try out follwoing,it may solve ur problem for time being. 1)Use one more servlet and integrate with struts instead of using plug-in or extending ActionServlet.This but be nothing but workaround to the given probs. Ideally u shud go for plug-in. 2)In the plugin class,apply some checks if the db connections are already created dont create it again.
sachin xorant, mumbai -----Original Message----- From: Uma Yarakaraju [mailto:[EMAIL PROTECTED] Sent: Monday, September 13, 2004 11:58 AM To: [EMAIL PROTECTED] Subject: PlugIn/ ActionServlet init() method called 2 times in Linux Hi, Can anyone pl help on my below mail? Some more things I noticed are: I downloaded the latest struts-1.2.2 zip. To the struts-blank.war I added a simple plugin class (that prints system.out.println in the constructor, init, and destroy methods) called MyPlugIn.java. I deployed the struts-blank in tomcat-4.1.18 on WIN 2k. Works fine where the print statements are printed once. Whereas in tomcat-4.1.18 on Linux they are printed 2 times each. I tried using an extended ActionServlet class for initialization. Even in this constructor, init() and destroy() methods are called 2 times on Linux and once on windows. I did really appreciate any help as our application has to go live and this could affect the performance of our application (as the DB connections are created multiple times). Can anyone pl suggest ways to initialize a struts webapp other than plugIn and extended ActionServlet. Thanks & Regards, Uma. -----Original Message----- From: Uma Yarakaraju [mailto:[EMAIL PROTECTED] Sent: Thursday, September 09, 2004 7:04 PM To: [EMAIL PROTECTED] Subject: PlugIn's init(...) method is called multiple times in Linux Hi, I have 3 struts based applications running in Tomcat 4.1.18. I have deployed them in Red Hat Linux Advanced Server 3.0 platform. In all my 3 apps, I have implemented the Struts's PlugIn interface for doing the initialization tasks and configured them in the struts-config.xml as shown below (for one of the apps): <plug-in className="org.apache.struts.validator.ValidatorPlugIn"> <set-property property="pathnames" value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml"/> </plug-in> <plug-in className="com.a.b.c.d.e.InitPlugIn"> <set-property property="filepath" value="/config/app.properties" /> </plug-in> In the init(ActionServlet servlet, ModuleConfig config) method of these plugin classes I create DB connections. On Windows (2k) platform it works fine. That is the init(.) method is called once for each app/plugin and the configured number of connections are created. But when I deploy them on our target Linux platform the init(.) method of 2 apps is called 2 times and the other app is called 4 times. I had some debug statements in the init(.) method of PlugIn class and they show it is called multiple times. Pl give your ideas on how I can resolve this. Any help will be highly appreciated. Thanks in advance, Uma. Confidentiality Notice The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain confidential or privileged information. If you are not the intended recipient, please notify the sender at Wipro or [EMAIL PROTECTED] immediately and destroy all copies of this message and any attachments.