Re: Handling Tomcat crash
In case of out of memory issues you can search for JVM options like -XX:+HeapDumpOnOutOfMemoryError and others. There is also an option for shell scripts to be executed in case of out of memory. regards Michael -Original Message- From: Tarun Gupta [mailto:tarun.gu...@digitalmountain.com] Sent: Thursday, October 14, 2010 12:41 PM To: users@tomcat.apache.org Subject: Handling Tomcat crash In the event the tomcat crashes I would like to restart tomcat automatically or better be alerted of the status that it is crashed. I'm running Tomcat on Windows server. Which version of Tomcat? JVM? Windows? Is there any script which may restart tomcat or any opensource tool which will send me an alert that it is crashed. Well there's lots of monitoring tools around. GIYF. The easiest thing would be to use the tools provided by the OS. Go into services and configure the recovery options as you desire. Restart the service is an option. But why is tomcat crashing? +1 This is a more important question. p -- Michael Knümann Senior Consultant BusinessCoDe GmbH Ollenhauerstr.1 D-53113 Bonn Geschäftsführer: Hanno Gehron, Joerg Kunze HRB 008660 - Sitz Bonn Office Phone: +49 (0) 228 / 33885-242 Mobile Phone: +49 (0) 174 / 3178178 Fax:+49 (0) 228 / 33885--225 EMail: m...@business-code.de http://www.business-code.de - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
What is the lifecycle of the apache tribes channel?
Hi, I'm using apache tribes for messaging between nodes within a cluster. My implementation bases on the quickstart example that is part of the related documentation. At the moment there is Context Listener that starts the communication during the deployment of the webapp like this: public void start(ChannelListener msgListener, MembershipListener mbrListener) throws ChannelException { myChannel = new GroupChannel(); this.msgListener = msgListener; this.mbrListener = mbrListener; //attach the listeners to the channel myChannel.addMembershipListener(mbrListener); myChannel.addChannelListener(msgListener); //start the channel myChannel.start(Channel.DEFAULT); } and in case the application is stopped the communication channel is stopped like this: public void stop() throws ChannelException { myChannel.removeChannelListener(msgListener); myChannel.removeMembershipListener(mbrListener); myChannel.stop(Channel.DEFAULT); } The sending of messages is implemented this way: public void sendMessage(ClusterCacheMessage message ) throws ChannelException, ClusterMessageCtrlException { assertStartedProperly(); //create a message to be sent, message must implement java.io.Serializable //for performance reasons you probably want them to implement java.io.Externalizable //Serializable myMsg = new MyMessage(); //retrieve my current members Member[] group = myChannel.getMembers(); logger.fine("Send message:" + message.getCacheName()); //send the message myChannel.send(group,message,Channel.SEND_OPTIONS_DEFAULT); } My question is do I need the channel started the whole time, or I can open it every time I send a message? with kind regards Michael - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
What is the lifecycle of the apache tribes channel?
Hi, I'm using apache tribes for messaging between nodes within a cluster. My implementation bases on the quickstart example that is part of the related documentation. At the moment there is Context Listener that starts the communication like this: myChannel = new GroupChannel(); this.msgListener = msgListener; this.mbrListener = mbrListener; //attach the listeners to the channel myChannel.addMembershipListener(mbrListener); myChannel.addChannelListener(msgListener); //start the channel myChannel.start(Channel.DEFAULT); This is a singleton instance and is used for sending messages the whole lifecycle of my webapplication. I don't like this singleton and I'm wondering if it is possible to start the channel everytime I need to send a message? with kind regards Michael - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Starting/Stopping Tomcat from Java program
Hi, perhaps this has the solution out of the box: http://cargo.codehaus.org/ Michael Hi. I do not really understand the issue here. If you are under Windows, with Tomcat running as a Service, then you can just run the commands "net start tomcat6" / "net stop tomcat6" to start/stop tomcat. If you are under Linux, then you can just issue the command "/etc/init.d/tomcat6 (start|stop)". Under most Unixes, the procedure is similar. So where is the problem ? Rob Gregory wrote: I call the scripts via code to both stop and start Tomcat. There is a problem with even calling these scripts via Unix unless you change (cd) into the bin directory before running startup.sh as the log paths are generated relative to the startup.sh location. String strCatalinaBin = System.getenv("CATALINA_HOME") + "\\bin\\"; File objDir = new File(strCatalinaBin); r = Runtime.getRuntime(); p = r.exec(new String[] { "cmd.exe", "/C", "start", strCatalinaBin + "catalina.bat", "start" }, null, objDir); p.waitFor(); p.destroy(); Hope this helps. Rob -Original Message- From: Karthik Nanjangude [mailto:karthik.nanjang...@xius-bcgi.com] Sent: 11 October 2010 13:26 To: Tomcat Users List Subject: RE: Starting/Stopping Tomcat from Java program Hi Probably u may need to use Embedded version of TOMCAT to do this activity... With regards karthik -Original Message- From: kshitij chandrasen [mailto:kshtjchnd...@gmail.com] Sent: Monday, October 11, 2010 2:49 PM To: users@tomcat.apache.org Subject: Starting/Stopping Tomcat from Java program Hi, I've to write methods on calling which i'd be able to start and stop the tomcat app server. I tried this - I'm using Tomcat 6.0.26. String[] command = new String[4]; command[0] = "cmd"; command[1] = "/C"; command[2] = "startup.bat"; command[3] = "C:\\"; String x[] = {"PATH=C:\\Program Files\\Apache Software Foundation\\Apache Tomcat 6.0.26\\bin","CATALINA_HOME=C:\\Program Files\\Apache Software Foundation\\Apache Tomcat 6.0.26","JAVA_HOME=C:\\Program Files\\Java\\jdk1.6.0_21","JRE_HOME=C:\\Program Files\\Java\\jre6"}; Process p = Runtime.getRuntime().exec(command,x); This gives me a strange windows error saying - The system cannot find the file -Djava.util.logging.config.file="C:\Program Files\Apache Software Foundation\Apache Tomcat 6.0.26\conf\logging.properties", while it actually exists. If instead of setting the path, I give the absolute path of startup.bat in command[3], it works fine - Process p = Runtime.getRuntime().exec("cmd /C start C:\\broadway\\bat\\startup.bat"); //I copied the startup.bat to a folder and ran it from there, it worked fine. Please give me pointers to the right direction! -- Kshitij Chandrasen Engineer, Software Engineering, Cisco Systems, CBSBU Engineering. -- Kshitij Chandrasen Engineer, Software Engineering, Cisco Systems, CBSBU Engineering. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org ----- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org -- Michael Knümann Senior Consultant BusinessCoDe GmbH Ollenhauerstr.1 D-53113 Bonn Geschäftsführer: Hanno Gehron, Joerg Kunze HRB 008660 - Sitz Bonn Office Phone: +49 (0) 228 / 33885-242 Mobile Phone: +49 (0) 174 / 3178178 Fax:+49 (0) 228 / 33885--225 EMail: m...@business-code.de http://www.business-code.de - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Is it possible to have shared JDBC resources in Tomcat 6.0 cluster?
Hi I'm currently working on migrating single server web application for deployment in a cluster. We have JDBC connection pools to talk with several databases. I'm going to divide the max db connection attribute for each by the number of nodes then. But I'm wondering if it is possible to have a cluster wide connection pool. with kind regards Michael Knümann - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org