Load WARs Via The Manager App
Hi All, I have some questions about deploying WARs using Tomcat's built in manager. It seems that some of the times when we use the manager via a web browser to deploy a new WAR file it will only partially install. Meaning that the manager will return a list of the installed applications and it will show our new application installed but the 'Display Name' is blank, even though there is a Display Name set in the application's web.xml. Also, at this point, if I try to hit the application it will return an error and if I go and look at the expanded WAR on the file system it will be missing files. If I then undeploy and reploy the same WAR it will usually get installed correctly, though I've had times where I've had to reinstall again to get everything done correctly. Does anyone know why this is? Or, does anyone have a better way if deploying applications? What are the recommendations for deployment in production environments? My guess is that Tomcat is trying to deploy the WAR file before it's fully been copied over. In our server.xml we have autoDeploy set to true (as well as unpackWARs) Here's a run down of our environment: Our dev and test boxes are Suse Linux 8 (2.4 kernel, I know, we're working towards upgrading to the 2.6 kernel) with Apache 2.0.55 talking to Tomcat 5.5.9 via mod_jk 1.2.12. I should note that when I'm using the manager, I bypass Apache and mod_jk and go directly to tomcat via the 8080 port. Our production environment is Suse Linux 8 with two apaches talking to two clustered tomcats via mod_jk. All versions are the same as dev/test. Thanks, Scott
RE: Load WARs Via The Manager App
Yeah I stop the webapp and undeploy it before doing the redeploy so I don't think this is the issue. Unless the sessions are still persistent even after I've undeployed, which I don't think is the case. -Original Message- From: Martin Gainty [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 20, 2006 9:37 AM To: Tomcat Users List Subject: Re: Load WARs Via The Manager App I know you cant deploy a webapp (when there are active sessions on the original webapp) so If you stop the webapp then re-deploy the webapp you should be abe to redeploy correctly M- * This email message and any files transmitted with it contain confidential information intended only for the person(s) to whom this email message is addressed. If you have received this email message in error, please notify the sender immediately by telephone or email and destroy the original message without making a copy. Thank you. - Original Message - From: <[EMAIL PROTECTED]> To: Sent: Wednesday, September 20, 2006 11:28 AM Subject: Load WARs Via The Manager App Hi All, I have some questions about deploying WARs using Tomcat's built in manager. It seems that some of the times when we use the manager via a web browser to deploy a new WAR file it will only partially install. Meaning that the manager will return a list of the installed applications and it will show our new application installed but the 'Display Name' is blank, even though there is a Display Name set in the application's web.xml. Also, at this point, if I try to hit the application it will return an error and if I go and look at the expanded WAR on the file system it will be missing files. If I then undeploy and reploy the same WAR it will usually get installed correctly, though I've had times where I've had to reinstall again to get everything done correctly. Does anyone know why this is? Or, does anyone have a better way if deploying applications? What are the recommendations for deployment in production environments? My guess is that Tomcat is trying to deploy the WAR file before it's fully been copied over. In our server.xml we have autoDeploy set to true (as well as unpackWARs) Here's a run down of our environment: Our dev and test boxes are Suse Linux 8 (2.4 kernel, I know, we're working towards upgrading to the 2.6 kernel) with Apache 2.0.55 talking to Tomcat 5.5.9 via mod_jk 1.2.12. I should note that when I'm using the manager, I bypass Apache and mod_jk and go directly to tomcat via the 8080 port. Our production environment is Suse Linux 8 with two apaches talking to two clustered tomcats via mod_jk. All versions are the same as dev/test. Thanks, Scott - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: tomcat external property file
You can pass it as a variable in tomcat's startup.sh (unix, linux) or startup.bat (windows) in the bin directory. Modify that file and add something like this right before the last line: #Added link to external property file JAVA_OPTS='-Dmy.props.dir=/opt/tomcat/properties' export JAVA_OPTS -Original Message- From: yaliu07 [mailto:[EMAIL PROTECTED] Sent: Monday, October 02, 2006 11:44 AM To: users@tomcat.apache.org Subject: tomcat external property file hi. i like to have tomcat to load an external property file that i can declare some variable only local to the machine, such as image path. can anybody give me any help how to load an external property file when tomcat starts?? thanks -- View this message in context: http://www.nabble.com/tomcat-external-property-file-tf2371317.html#a6606 189 Sent from the Tomcat - User mailing list archive at Nabble.com. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Question
Hi Miriam, We had the same problem here. Our LDAP authentication was working up to version 5.5.12 but broke on anything above it. I finally got it fixed and I'll show you what we had previously and what we have now. WORKED WITH 5.5.12 AND BELOW: ldap://ldap.bc.com"; roleBase="" roleName="cn" roleSearch="(uniqueMember={0})" roleSubtree="true" userPattern="uid={0},ou=users,dc=bc,dc=com" userSearch="(uid={0})" userSubtree="true" /> WORKS WITH LATEST TOMCAT: ldap://ldap.bc.com"; roleBase="ou=roleBase,dc=bc,dc=com" roleName="cn" roleSearch="(uniqueMember={0})" roleSubtree="true" userBase="ou=Users,dc=bc,dc=com" userSearch="(uid={0})" /> From: Miriam Keating [mailto:[EMAIL PROTECTED] Sent: Thursday, October 05, 2006 10:03 AM To: users@tomcat.apache.org Subject: FW: Question Importance: High QUMAS is the only global compliance company offering a complete solution to regulated industries. Recognized as the world leader in Enterprise Compliance Management. * Website: www.qumas.com http://www.qumas.com/> * Address: Cleve Business Park, Monahan Road, Cork, Ireland * Office: +353-21-491 5100 +177 * Fax: +353-21-432 0394 From: Miriam Keating Sent: 05 October 2006 17:02 To: 'users@tomcat.apache.org' Subject: FW: Question Importance: High QUMAS is the only global compliance company offering a complete solution to regulated industries. Recognized as the world leader in Enterprise Compliance Management. * Website: www.qumas.com http://www.qumas.com/> * Address: Cleve Business Park, Monahan Road, Cork, Ireland * Office: +353-21-491 5100 +177 * Fax: +353-21-432 0394 From: Miriam Keating Sent: 05 October 2006 16:59 To: 'users@tomcat.apache.org' Subject: Question Importance: High To whom it may concern, I am connecting to LDAP using Tomcat 5.5.12 and everything is fine. However, when I change over to Tomcat 5.5.16, I can no longer connect to LDAP because of a binding error. The error I see is included in this email. The cause of my problem is due to a change made to the JNDIRealm class, the getUserByPattern(). The change made ( I don't think) has not been documented in the change log html. Two lines of code have been removed from the above class and method. Basically, can you tell me why the change was made and also can you tell me is there a complimentary change I need to make to my code, to get the LDAP to work. Any help you can give me would be really appreciated. Regards Miriam QUMAS is the only global compliance company offering a complete solution to regulated industries. Recognized as the world leader in Enterprise Compliance Management. * Website: www.qumas.com http://www.qumas.com/> * Address: Cleve Business Park, Monahan Road, Cork, Ireland * Office: +353-21-491 5100 +177 * Fax: +353-21-432 0394
RE: how to install php on tomcat?
A better idea would be to put Apache in from of Tomcat and compile PHP into that. There are instructions on the PHP site on how to do that: http://www.php.net/manual/en/install.php -Original Message- From: Hassan Schroeder [mailto:[EMAIL PROTECTED] Sent: Friday, June 09, 2006 3:16 PM To: Tomcat Users List Subject: Re: how to install php on tomcat? On 6/9/06, Nikita Tovstoles <[EMAIL PROTECTED]> wrote: > I know nothing about php, so this may be a dumb question, but how do I > add php support to tomcat? A PHP servlet can be built from source in PHP4; last time I looked that feature wasn't in PHP5. But I haven't looked in quite a while :-) The PHP4 servlet worked, but wasn't all that stable, in my limited experience. And when it crashed it took the whole JVM with it, so I didn't think it suitable for production. YMMV. HTH! -- Hassan Schroeder [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Monitoring of Tomcat process
If you just want to check that the process is running on the machine, here's a sample bash script that I worked up: #!/bin/bash # This script makes sure certain processes are running and emails support if they aren't # What process to check for PROCESS=tomcat # The command to run COMMAND=$(ps -ef| grep $PROCESS| grep -v grep| wc -l) OUTPUT=$COMMAND # Set the most number of messages we want sent before we stop sending them ATMOST=3 EMAILFILE=/path/to/wherever/scripts/emailsSent.txt # Lets check to see if that file exists and if not, create it if [ ! -f $EMAILFILE ] then # The file does not exist, we better create it echo 0 > $EMAILFILE fi if [ $OUTPUT == 0 ] then # Lets see if we already sent messages NUMBER=$(cat $EMAILFILE) if [ "$NUMBER" != 3 ] then # Go ahead and send the email # The message that will go in the email MESSAGE="The $PROCESS process doesn't seem to be running on $HOSTNAME on $(date +"%x %r %Z") number is $NUMBER" echo $MESSAGE | mail -s "$PROCESS process not running on $HOSTNAME" [EMAIL PROTECTED] # Now increment the number in the EMAILFILE file NEWNUMBER=$(expr $NUMBER + 1) echo $NEWNUMBER > $EMAILFILE fi else # So the process is running, let's make sure the email messages increment number is 0 if [ "$NUMBER" != 0 ] then echo 0 > $EMAILFILE fi fi -Original Message- From: Jean-Sebastien Pilon [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 20, 2007 7:17 AM To: Tomcat Users List Subject: RE: Monitoring of Tomcat process You could write a script that wget's the applications home page for a few iterations and that checks that the process is running and restart it if no answer. You could also use nagios with the check_http or with nrpe to check the processes on the app server. See nagios.org on this one, this is quite a bigger thing than the 1st solution if you do not have a monitoring infrastructure with nagios already setup. > -Original Message- > From: Virgo Rustianto [mailto:[EMAIL PROTECTED] > Sent: Tuesday, February 20, 2007 6:51 AM > To: users@tomcat.apache.org > Subject: Monitoring of Tomcat process > > Hi there, > > Currently I am using Tomcat webserver 4.1.2, does any one know how to > monitoring Tomcat webserver ? The reason is I facing problem > almost everyday > Tomcat was down, currently I don't know how to see does > tomcat running or > down. > Normally after startup I can't see anything except customer > care complaining > our aplication doesn't works then we know tomcat must startup again. > > regards, > Virgo Rustianto > NOTICE: This email contains privileged and confidential information and is intended only for the individual to whom it is addressed. If you are not the named addressee, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this transmission by mistake and delete this communication from your system. E-mail transmission cannot be guaranteed to be secured or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. AVIS: Le présent courriel contient des renseignements de nature privilégiée et confidentielle et n'est destiné qu'à la personne à qui il est adressé. Si vous n'êtes pas le destinataire prévu, vous êtes par les présentes avisés que toute diffusion, distribution ou reproduction de cette communication est strictement interdite. Si vous avez reçu ce courriel par erreur, veuillez en aviser immédiatement l'expéditeur et le supprimer de votre système. Notez que la transmission de courriel ne peut en aucun cas être considéré comme inviolable ou exempt d'erreur puisque les informations qu'il contient pourraient être interceptés, corrompues, perdues, détruites, arrivées en retard ou incomplètes ou contenir un virus. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: AW: AW: Cannot run JVM in server mode with JSVC
An easier way to do it would be to add it in your $CATALINA_OPTS variable. So get rid of the extra stuff you added and instead add the '-server' to $CATALINA_OPTS. So it would be: CATALINA_OPTS="-server -Xmx1900m -Xms256m -XX:MaxPermSize=256m -XX:ReservedCodeCacheSize=64m -Dcom.sun.management.jmxremote " -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, March 01, 2007 7:30 AM To: Tomcat Users List Subject: Re: AW: AW: Cannot run JVM in server mode with JSVC Hi, sorry for the email junk. They make me use Outlook which sometimes adds the list and the recepient to the repsonse. :o( I didn't notice when I hit reply. I don't know why this does not work but jsvc give me this again: jsvc error: Invalid option -server jsvc error: Cannot parse command line arguments I added the option like you said in your mail. :o( cheers, Pete Original-Nachricht Datum: Thu, 01 Mar 2007 13:37:24 + Von: Pid <[EMAIL PROTECTED]> An: Tomcat Users List CC: Betreff: Re: AW: AW: Cannot run JVM in server mode with JSVC > OK, > > 1) Please ONLY reply to the list, you do not need to add my address as > well - you're joining the merry band of new listers who seem to insist > on sending me the same message twice. > > 2) "-server", just "-server", not "java "-server"" and > > 3) definitely not "jvm anything" or "-jvm "-server"" > > Note that I have added quotes to indicate where attributes start and > end. To start a java program in server mode, you would type: > > java -server ... > > > Like so: > > case "$1" in > start) > $DAEMON_BIN \ > -server \ > -user $TOMCAT_USER \ > -home $JAVA_HOME1 \ > -Dcatalina.home=$CATALINA_HOME \ > -Djava.io.tmpdir=$TMP_DIR \ > -outfile $CATALINA_HOME/logs/catalina.out \ > -errfile '&1' \ > $CATALINA_OPTS \ > -cp $CLASSPATH \ >org.apache.catalina.startup.Bootstrap \ > > > > > Peter Neu wrote: > > Hi, > > > > if I put his in the shell script > > > > case "$1" in > > start) > > $DAEMON_BIN \ > > -java "-server" > > -user $TOMCAT_USER \ > > -home $JAVA_HOME1 \ > > -Dcatalina.home=$CATALINA_HOME \ > > -Djava.io.tmpdir=$TMP_DIR \ > > -outfile $CATALINA_HOME/logs/catalina.out \ > > -errfile '&1' \ > > $CATALINA_OPTS \ > > -cp $CLASSPATH \ > > org.apache.catalina.startup.Bootstrap \ > > > > > > I get this error: > > > > > > jsvc error: Invalid option -java > > jsvc error: Cannot parse command line arguments > > /etc/init.d/tomcat5: line 67: -user: command not found > > > > If I put this -jvm "-server" Instead of -java "-server" I get the > following > > Error message: > > > > /etc/init.d/tomcat5 start > > jsvc error: Invalid Java VM name specified > > jsvc error: Cannot parse command line arguments > > /etc/init.d/tomcat5: line 67: -user: command not found > > > > I don't get this. Server starts normally without server parameter but in > > client mode. :o( > > > > Cheers, > > Pete > > > >> -Ursprüngliche Nachricht- > >> Von: Pid [mailto:[EMAIL PROTECTED] > >> Gesendet: Donnerstag, 1. März 2007 11:09 > >> An: Tomcat Users List > >> Betreff: Re: AW: Cannot run JVM in server mode with JSVC > >> > >> java "-server" is the switch you need, not "-jvm server" > >> > >> > >> > >> Peter Neu wrote: > >>> Hello, > >>> > >>> is this question better asked in the dev mailing list or where should > I > >> ask? > >>> Cheers, > >>> Pete > >>> > -Ursprüngliche Nachricht- > Von: Peter Neu [mailto:[EMAIL PROTECTED] > Gesendet: Mittwoch, 28. Februar 2007 08:01 > An: 'Tomcat Users List' > Betreff: AW: Cannot run JVM in server mode with JSVC > > Hello, > > can somebody please help don't know how to solve this. > > Cheers, > Pete > > > -Ursprüngliche Nachricht- > > Von: Peter Neu [mailto:[EMAIL PROTECTED] > > Gesendet: Dienstag, 27. Februar 2007 12:43 > > An: users@tomcat.apache.org > > Betreff: Cannot run JVM in server mode with JSVC > > > > > > > > Hello, > > > > > > > > I need to run the JVM in server mode but jsvc does not switch to the > > server > > mode despite the configuration below. > > > > > > > > There aren't even any error messages. Can somebody please tell me > >> what's > > wrong? > > > > > > > > Cheers, > > > > Pete > > > > > > > > JAVA_HOME1=/usr/local/jdk1.5.0_06 > > > > CATALINA_HOME=/usr/local/jakarta-tomcat-5.5.9 > > > > DAEMON_BIN=/usr/local/jakarta-tomcat-5.5.9/bin/jsvc > > > > TOMCAT_USER=loew > > > > TMP_DIR=/var/tmp > > > > CATALINA_OPTS="-Xmx1900m -Xms256m -XX:MaxPermSize=256m > > -XX:ReservedCodeCacheSize=64m -Dcom.sun.management.jmxremote " > > > > CLASSPATH=/usr/local/jdk1.5.0_06/lib/tools.jar:\ > > > > $CATALINA_HOME/bin/commons-daemon.jar:\ > > > > $CATALINA_HOME/bin/bootstrap.jar > > >
RE: Question on setting up LDAP...
Yeah we use it successfully. We've got the following in our server.xml in the tag: ldap://ldapname.bc.com"; roleBase="ou=xxx,dc=bc,dc=com" roleName="cn" roleSearch="(uniqueMember={0})" roleSubtree="true" userBase="ou=xxx,dc=bc,dc=com" userSearch="(uid={0})" /> -Original Message- From: Smith, Corey [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 11, 2007 7:48 AM To: users@tomcat.apache.org Subject: Question on setting up LDAP... Hello and how is it? I was wondering if anyone has had success in setting up LDAP to work with their Tomcat Web applications? Thanks :) C CONFIDENTIALITY NOTICE: If you have received this e-mail in error, please immediately notify the sender by e-mail at the address shown. This e-mail transmission may contain confidential information. This information is only for the use of the individual(s) or entity to whom it is intended even if addressed incorrectly. Please delete it from your files if you are not the intended recipient. Thank you for your compliance. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Data Sources Overwritten
Chris, Using your method of including the context within the application how do you adjust for different environments (dev vs production)? Different WARs? How we do it now is have a context.xml.default included in the conf/Catalina/NameOfYourHostInServer.xml/ directory where the JNDI datasource is defined. That way we can take the exact same WAR that was deployed on dev and deploy it to production (since they point to different DBs and thus have different datasources). Scott -Original Message- From: Christopher Schultz [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 19, 2007 10:35 AM To: Tomcat Users List Subject: Re: Data Sources Overwritten -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Jeff, You have not followed my suggestions: 1. Remove all JNDI datasource information from server.xml and never put it back in. 2. Use a META-INF/context.xml file and bundle it into your WAR file for deployment. context.xml should include 100% of the JNDI data source configuration that you need for your app. Consider using and specifying everything instead of trying to use /and/ . 3. Stop using the Manager to do anything at all. This will allow your application to setup its own data source instead of relying on the server to have it ready to go before deployment. Re-deployments will re-setup the connection, just as it was intended. This is all documented (poorly, I might add), on this page: http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.h tml Under "MySQL DBCP Example / 2. server.xml configuration", replace the direction to put the configuration "into server.xml inside your element" with "into context.xml inside your element". - -chris Jeffrey C. Baldwin wrote: > Also, here is a copy of my server.xml. > > > > > className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"/ > > > > type="org.apache.catalina.UserDatabase"/> > > > factory > org.apache.catalina.users.MemoryUserDatabaseFactory > > > pathname > conf/tomcat-users.xml > > > > > disableUploadTimeout="true" port="8080" redirectPort="8443" > maxSpareThreads="75" maxThreads="150" > minSpareThreads="25"> > > protocolHandlerClassName="org.apache.jk.server.JkCoyoteHandler" > redirectPort="8443"> > > > autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false"> > directory="logs" prefix="localhost_access_log." suffix=".txt" > pattern="common" resolveHosts="fal > se" /> > directory="logs" prefix="localhost_log." suffix=".txt" timestamp="true" /> > > prefix="localhost_mrs2_log." suffix=".txt" timestamp="true"/> > type="javax.sql.DataSource"> > > >factory > > org.apache.commons.dbcp.BasicDataSourceFactory > > >maxActive >5 > > >maxIdle >1 > > >maxWait >1 > > >username >TS59MRS > > >password >password > > >driverClassName >com.ibm.db2.jcc.DB2Driver > > >url > > jdbc:db2://123.456.789.120:5019/NETSNDB01 > > > type="javax.sql.DataSource"> > > >factory > > org.apache.commons.dbcp.BasicDataSourceFactory > > >maxActive >10 > > >maxIdle >1 > > >maxWait >1 > > >username >rreddy > > >password >password > > >driverClassName > net.sourceforge.jtds.jdbc.Driver > > >url > > jdbc:jtds:sqlserver://123.456.789.96/mrs;user=rreddy;password=pv1 23ankita > > >