RE: Out of memory
> You can modify the memory settings for the windows service also in the > service.bat file itself. I've been known to uninstall the service, modify > the bat file and then service install again. Forget about a reinstall. Use regedit and go to HKEY_LOCAL_MACHINE\SOFTWARE\Apache software Foundation\Procrun 2.0\\Parameters\Java and edit the JvmMx and JvmMs settings as your deployment requires. Kind regards Wolfgang -- 5 GB Mailbox, 50 FreeSMS http://www.gmx.net/de/go/promail +++ GMX - die erste Adresse für Mail, Message, More +++ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: jsvc.exec error: syscall failed in set_caps
Georges Roux wrote: I can't start tomcat 5.5.9 as a daemon on linux on port 8080 (default configuration) nothing is running on this port and have only thi error in logs/catalina.err jsvc.exec error: syscall failed in set_caps jsvc.exec error: Service exit with a return value of 4 Try "modprobe capability". I think there is also a bug filed concerning this problem. Kind regards, Wolfgang - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Trouble with JDBC (I need a little help)
Maxime wrote: I'am asking for help because I have a problem that it's making me crazy. [Program code and logs snipped] Thank you very much for the help, it will be very appreciated ! I am not familiar with MySQL therefore just a guess: I do not see a single close() statement. Close your ResultSets and Statements after usage (read some JDBC tutorials)! If this does not help with your current problem, this might be the next problem you run into anyway. Kind regards, Wolfgang - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat 5 shutdown issue with jsvc commons daemon
Hi Bernhard! Bernard wrote: I get the following error: "jsvc.exec error: Service exit with a return value of 143" There was a Thread here in December called "Session restart replication when using jsvc". Bill Barker recommended to use CVS HEAD of the commons-daemon. Kind regards Wolfgang - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: tomcat load-balancing maintenance strategy?
Sng Wee Jim wrote: 1. Is it possible to pass the session information to TomcatA before shutting down TomcatB? For eg. we want to perform servers upgrade, so we down TomcatB, upgrade it, start TomcatB, before doing the same to TomcatA. This is what a cluster does. See http://jakarta.apache.org/tomcat/tomcat-5.0-doc/cluster-howto.html for more information. Kind regards, Wolfgang - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Migration from Tomcat 4.1 to Tomcat 5.0
Kiran Patel wrote: I have a application runing on Tomcat 4.1. I want to change to Tomcat 5.0. I already installed Tomcat 5.0.28 and configured server.xml and web.xml according to the document. But when I click startup.bat, I get the error windows can not find '-Djava.endorsed.dirs=' . I get the same error with starting startup.bat from Tomcat 4.1, but the start tomcat from Tomcat 4.1 is working fine. I am running my web apps from Tomcat 4.1 without any problem. What am I doing wrong? Please help me. I need to change to newer version due to performance issue. I will appreciate any help. Hi Kiran! Try to install your Tomcat as an operating system service by using service.bat. This script sets the parameter java.endorsed.dirs. Having Tomcat as service is more convenient as it can be started automatically after booting, you don't have an extra DOS box and so on. Kind regards, Wolfgang - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: The number of tomcat directory for multiple tomcat instances
Terry Chung wrote: I'm running APACHE 2.0.48 with Tomcat 4.1.29 on HP box/os. I'm running multiple tomcats that are connected to Apache using round-robin load balancing. All tomcat instances and apache is running on the same HP box. This configuration seems a bit strange. If you have only one machine, I see no need to balance load between instances. There is always the maximum load on this machine. The document I read states that I need a unique CATALINA_HOME for each tomcat instance. Is there a way to have one CATALINA_HOME and have multiple server.xml file in the conf directory? If I need individual catalina_home for each tomcat instance, than what is the minimum sub-directories needed for each catalina_home? i.e., do we need all of /logs, /webapps, /work, and /temp? There must only be one unique CATALINA_HOME but individual CATALINA_BASE for each instance. Please read the section "Advanced Configuration" in the file RUNNING.txt which comes with tomcat for instructions. Kind regards, Wolfgang - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Register Tomcat as a service?
Hay, Markus wrote: I have an application that requires Tomcat (4.1.30 or later) and I'd like to know how I can register Tomcat as a service if the user does not do this during the install. In my installer, I can check the registry to Hi Markus, this can be achieved with the file service.bat which comes shipped with tomcat. Kind regards, Wolfgang - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[OT] Making jsvc multiple instances enabled
Hi! I would like to discuss whether it makes sense to have the commons daemon able to work with multiple tomcat instances out of the box. Since I know of at least two jsvc commiters reading this list and I think this is of interest for tomcat users, too, I start a discussion thread here. The commons daemon ships a Tomcat5.sh script which starts Tomcat as an operating system service on UNIX-like systems. The concept which I propose is to enhance this script and add a wrapper script to the distribution of the commons daemon. The wrapper script's task is to enable customisation and to be placed in /etc/init.d (or wherever your start scripts reside). It exports an individual instance name, the CATALINA_BASE, additional CATALINA_OPTS and finally calls the Tomcat5.sh script. Please see the end of this message for full examples of these scripts. There are some shortcomings in Tomcat5.sh in terms of multiple instances that force you either to make an adapted copy of Tomcat5.sh for each instance (which is impractical for maintenance) or to adapt this script in a sophisticated way and apply your own concept to make Tomcat5.sh reusable. Following are the issues that need to be addressed: - Test whether CATALINA_BASE is set; otherwise (i.e. Tomcat5.sh is called without wrapper script on a single instance setup) set it to CATALINA_HOME - TMP_DIR: change to $CATALINA_BASE/temp - pid file: make it unique by adding the instance's name to the file name - CLASSPATH: use commons-daemon.jar from the DAEMON_HOME instead of CATALINA_HOME's - improve parameters for the jsvc call: -- specify the pidfile: -pidfile $PIDFILE \ -- specify the CATALINA_BASE: -Dcatalina.base=$CATALINA_BASE \ - in order to stop the right instance, reuse the pid file specified previously So the questions are: Does anyone agree with me and does it make sense to file a patch or a feature request to the commons daemon team? Kind regards Wolfgang --- start Wrapper Script "/etc/init.d/tomcatTest.sh" #!/bin/bash # A wrapper script to set instance dependant variables and start the tomcat as # an OS service afterwards # export INSTANCE_NAME=Test export CATALINA_BASE=/usr/local/tomcat/instances/Test export CATALINA_OPTS=" -Djava.awt.headless=true" # Call the jsvc script to launch a Tomcat instance /usr/local/tomcat/Tomcat5.sh $1 --- end Wrapper Script "/etc/init.d/tomcatTest.sh" --- start adapted "Tomcat5.sh" -- (licence snipped) --- JAVA_HOME=/usr/local/java/jdk1.5.0_01 CATALINA_HOME=/usr/local/tomcat/current # if CATALINA_BASE is not set assign the value of CATALINA_HOME to it if [ -z "CATALINA_BASE" ] then CATALINA_BASE=$CATALINA_HOME fi DAEMON_HOME=/usr/local/javalibs/jakarta-commons/daemon/ TOMCAT_USER=www-data TMP_DIR=$CATALINA_BASE/temp CATALINA_OPTS="$CATALINA_OPTS" CLASSPATH=\ $JAVA_HOME/lib/tools.jar:\ $DAEMON_HOME/dist/commons-daemon.jar:\ $CATALINA_HOME/bin/bootstrap.jar PIDFILE=/var/run/jsvc-$INSTANCE_NAME.pid case "$1" in start) # # Start Tomcat # $DAEMON_HOME/src/native/unix/jsvc \ -user $TOMCAT_USER \ -home $JAVA_HOME \ -pidfile $PIDFILE \ -Dcatalina.home=$CATALINA_HOME \ -Dcatalina.base=$CATALINA_BASE \ -Djava.io.tmpdir=$TMP_DIR \ -outfile $CATALINA_BASE/logs/catalina.out \ -errfile '&1' \ $CATALINA_OPTS \ -cp $CLASSPATH \ org.apache.catalina.startup.Bootstrap # # To get a verbose JVM #-verbose \ # To get a debug of jsvc. #-debug \ ;; stop) # # Stop Tomcat # PID=`cat $PIDFILE` if [ -n $PID ] then kill $PID rm $PIDFILE fi ;; restart) # # Restart Tomcat # $0 stop $0 start ;; *) echo "Usage $0 {start|stop|restart}" exit 1;; esac --- end adapted "Tomcat5.sh" - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: can't run tomcat with jsvc
Haluk Durmus wrote: Thanks, I had the same problem on my Debian after a distribution upgrade from Woody with kernel 2.4.18 to Sarge and kernel 2.6.8. I traced the jsvc call with strace -f. So I got the following messages: [pid 11313] capset(0x19980330, 0, {CAP_SETGID|CAP_SETUID|CAP_NET_BIND_SERVICE, CAP_SETGID|CAP_SETUID|CAP_NET_BIND_SERVICE, CAP_SETGID|CAP_SETUID|CAP_NET_BIND_SERVICE}) = -1 EPERM (Operation not permitted) [pid 11313] write(2, "jsvc.exec error: ", 17) = 17 [pid 11313] write(2, "syscall failed in set_caps", 26) = 26 It seems that some things regarding security and/or cryptography have changed in the kernels. What helped me out of my situation was: modprobe capability This solved my problem with the Error set_caps. Nice to hear. But now I have an other one! jsvc didn't bind to port 80 Error in catalino.out log: Jan 3, 2005 2:24:34 PM org.apache.coyote.http11.Http11Protocol start SEVERE: Error starting endpoint java.net.BindException: Permission denied:80 Please verify that no http server (apache, squid etc.) is running --> only one process may use a port. Wolfgang - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: can't run tomcat with jsvc
Haluk Durmus wrote: I wan't to use Tomcat 5.5.6 as our default Webserver on port 80. That's why I start it with "jsvc", that should give the chance to run on prots <1024 for nonroot-user. but get Error-Message in log file: [...] jsvc.exec error: syscall failed in set_caps jsvc.exec error: Service exit with a return value of 4 Hi Haluk, I had the same problem on my Debian after a distribution upgrade from Woody with kernel 2.4.18 to Sarge and kernel 2.6.8. I traced the jsvc call with strace -f. So I got the following messages: [pid 11313] capset(0x19980330, 0, {CAP_SETGID|CAP_SETUID|CAP_NET_BIND_SERVICE, CAP_SETGID|CAP_SETUID|CAP_NET_BIND_SERVICE, CAP_SETGID|CAP_SETUID|CAP_NET_BIND_SERVICE}) = -1 EPERM (Operation not permitted) [pid 11313] write(2, "jsvc.exec error: ", 17) = 17 [pid 11313] write(2, "syscall failed in set_caps", 26) = 26 It seems that some things regarding security and/or cryptography have changed in the kernels. What helped me out of my situation was: modprobe capability Unfortunately, you did not post furter details describing your system. I Hope this helps anyway. Wolfgang - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Session restart replication when using jsvc
Trond G. Ziarkowski wrote: I recently switched from using Tomcat 5.0.28/jk2/Apache2 to running tomcat standalone using jsvc. This works great for me except for one thing; Sessions are not replicated when I restart tomcat. To stop Tomcat I'm using 'kill -9 `cat /var/run/jsvc.pid`'. When Tomcat is stopped this way the StandardManager does not serialize the sessions to SESSIONS.ser. Can I stop Tomcat in another way, to make it serialize the sessions? Hi Trond, by using signal 9 you give Tomcat no chance to perform any further action. Maybe you omit -9 from your kill command. Kind regards, Wolfgang - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: best way to setup multiple instances of tomcat
Greg Lappen wrote: Also, I'm thinking that I probably don't want them both running off the same install directory because what if I want to test a new version of Tomcat in the test environment? The only thing I'm saving by having them both run from the same directory is a few megs of space right? Hi Greg, you might search for the file RUNNING.txt in /usr/local/tomcat for more information. There were other threads on 9th and 13th December 2004 in this list discussing the same topic. Your particular problem can be solved by specifying the appropriate parameter (-outfile) when starting your tomcats using jsvc (the java commons daemon). I wrote a script and a short description for installation of multiple tomcat instances and put it to http://miti.sourceforge.net/ . Wolfgang - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Two Tomcat installations on one server in Windows 2K3
footh wrote: [running more than one Tomcat on a single machine] First off, I want to run Tomcat as a service and that seems to talk about running multiple instances with the startup script. It is likely that you want to use one version of Tomcat to run your web sites. So, I assume you have downloaded a distribution and put it somewhere on your server. This location is called CATALINA_HOME. For a single instance CATALINA_HOME = CATALINA_BASE, i.e. no need to care about. Second, item number 4 more or less says for multiple instances "you can use CATALINA_BASE" as an argument but doesn't really explain CATALINA_BASE. Is it the install directory of Tomcat? Or is it a directory where I have another set up "webapps" and context configuration files. I can't quite visualize what it means to use CATALINA_BASE and how to set up the directories. If you want to have more than one operating system service, you must copy certain parts (mostly configuration files) from your CATALINA_HOME directory to a new location. This new directory is called CATALINA_BASE. A CATALINA_BASE is a directory containing configuration files etc. that are individual to an OS service. The executable files do not need to be copied since they will be re-used. You need to call service.bat with appropriate parameters (CATALINA_BASE is the most important one) in order to install an OS service. The init-scripts (Unix) or registry settings (for Windows look around at HKEY_LOCAL_MACHINE\System\CurrentControlSet\SERVICES\Apache Tomcat) for the service always call the same tomcat executables. The service parameters determine wich config files to use. So for each Tomcat instance, you need to change the server.xml in the specific CATALINA_BASE to have your services listening to different IP addresses and/or TCP ports (same changes for shutdown port and AJP connectors necessary). I hope this helps. If it is not sufficient, I could provide you with a screenshot of my directory layout. Wolfgang - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to start multiple Tomcats
Robert Lin wrote: We are trying to setup an automated J-Unit test from Ant using Cruise Control where we need multiple copies of tomcat servers running (by supplying different server.xml files). I suppose you want the same Tomcat binaries but different configuration per Tomcat instance. Search for the file RUNNING.txt in the root directory of your Tomcat distribution. They call this setup "Multiple Tomcat 5 Instances". Is there something I'm missing, any suggestions? Thanks in advance. What you need to do is to create a new CATALINA_BASE (i.e.: copy the files and directories specified in the file RUNNING.txt and edit the individual server.xml to avoid TCP ports collisions). Then you need to pass the "-Dcatalina.base=$CATALINA_BASE" argument to the startup command. In case your Tomcats run on Linux, you might succeed with the MITI script (http://miti.sourceforge.net/ Any feedback is welcome, because I am curious whether it is useful at all). Wolfgang - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [ANN] Multiple Instances Tomcat Installer
Peter Crowther wrote: From: Wolfgang Hackl [mailto:[EMAIL PROTECTED] To be serious, I am of the opinion that the Tomcat project can benefit from an application that helps Administrators with installation and management of multiple Tomcat instances (which is a superset of MITI's features). Yes please! We have an extra requirement - we have multiple *developers* running separate Tomcat instances on the same box. We want to ensure that they can run a Tomcat instance from their own filestore, but without the ports colliding. They may not all have root access on the box. Any thoughts as to whether MITI could help with this? Hi Peter! As a workaround you might add all developers to the same group or tune the chmod/chown/chgrp statements in the script. Please consider the TOMCAT_USER variable in the Tomcat5.sh script, too. Root access is not necessary as long as you can do without a start script and links in /etc/init.d. The start script gets generated to $CATALINA_BASE anyway and hopefully can be started with developers' privileges from there. Wolfgang - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[ANN] Multiple Instances Tomcat Installer
Hi everybody! I created a shell script for helping with the installation of multiple Tomcat instances. You may want to use it if you need to accelerate the creation of a new service. The script is called MITI - Multiple Instances Tomcat Installer. MITI performs actions analogous to the "Advanced Configuration" section in http://jakarta.apache.org/tomcat/tomcat-4.1-doc/RUNNING.txt. In addtion to that, MITI keeps track of the services' Ports for HTTP, JK2 and Shutdown. MITI automates the adaption of each server.xml since it updates these ports in server.xml with sed according to a ports database (flat file). MITI can be downloaded at http://miti.sourceforge.net/. One reason for me launching this project was that I want my effort to be useful for the public. Another reason is that I haven't found installation scripts for the UNIX-like platforms. In opposition to that, there is an installation wizard for the Windows platform and I don't like *NIX/BSD to be discriminated ;-) To be serious, I am of the opinion that the Tomcat project can benefit from an application that helps Administrators with installation and management of multiple Tomcat instances (which is a superset of MITI's features). Once I even tried to write a Java GUI to manage server.xml properties but put that software aside for various reasons. Would you consider an app like this useful? Any comments, hints and suggestions are welcome. Kind regards, Wolfgang - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Running Tomcat from jsvc
[EMAIL PROTECTED] wrote: When I start Tomcat using $CATALINA_HOME/bin/startup.sh everything works fine. But now I want to run Tomcat as a daemon under a non-root user. [...] The log (line 626)[3] is telling me that "server.xml" couldn't be loaded, but it didn't tell why. Hi Volkmar, did you check the file system permissions of your $CATALINA_HOME directory? As I can see from my installations, server.xml has read and write permissions exclusively for its owner. My conclusion is that the directory must belong to the user, will run the service (wwwrun says your Tomcat5.sh). Kind regards, Wolfgang - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]