Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Tomcat StartupItems

Tomcat StartupItems
Thread Tools
Mac Elite
Join Date: Sep 2000
Location: in front of the keyboard
Status: Offline
Reply With Quote
Jan 19, 2001, 12:46 AM
 
I got Tomcat up and running using mod_jk.
Now I am trying to get it to come up at boot time.
It comes up until the splash screen goes away, then it goes away too.
Here's how I launch it in the StartupItems\Tomcat folder:

./etc/rc.common
nohup ${TOMCAT_HOME}/bin/tomcat.sh start &
sleep 20


Like I said, using NMap, I was able to verify that it does indeed come up and start listening on 8080 until the splash screen goes away, then the process dies. How can I get the process to stick around?
I thought the nohup and the '&' would take care of that.
signatures are a waste of bandwidth
especially ones with political tripe in them.
     
powert
Guest
Status:
Reply With Quote
Jan 23, 2001, 08:06 AM
 
I have the same problem, and it has been bugging me for some time. It seems I have the same problem with any java process. I actually changed the order preference in the startupparameters.plist to 'Late' and it worked a couple of times but not all the time. I use nohup also, but something is shutting it down, I don't know what.

I thought we weren't able to compile mod_jk on osx, I was reading threads here before saying it was not possible... How u do it?

     
Mac Elite
Join Date: Sep 2000
Location: in front of the keyboard
Status: Offline
Reply With Quote
Jan 23, 2001, 03:43 PM
 
Originally posted by powert:


I thought we weren't able to compile mod_jk on osx, I was reading threads here before saying it was not possible... How u do it?

Hacking the code, of course!

I found some code mods on an old omni group email list archive that tells what code mods to make.
signatures are a waste of bandwidth
especially ones with political tripe in them.
     
powert
Guest
Status:
Reply With Quote
Feb 4, 2001, 06:48 PM
 
Originally posted by Kristoff:
Hacking the code, of course!

I found some code mods on an old omni group email list archive that tells what code mods to make.
You going to post those modifications???

How about telling Apache, so that they make the changes...
     
powert
Guest
Status:
Reply With Quote
Feb 4, 2001, 06:50 PM
 
I really need to know how to get the startup items working... has anyone found a solution???

Java just won't startup for me.
     
Fresh-Faced Recruit
Join Date: Apr 2001
Status: Offline
Reply With Quote
Apr 3, 2001, 03:43 PM
 
It's been almost two months, but even if you guys have gotten it, maybe this will help someone else.

I hacked a Tomcat startup item together using the Apache StartupItem and the tomcat.sh script from the tomcat/bin folder...

If you don't know how to create a startup item, rtfm. P
This note is to just help with the contents of the StartupParameters.plist and Tomcat executable.

<file name="StartupParameters.plist">
{
Description = "Tomcat Servlet Engine";
Provides = ("Tomcat");
Requires = ("Disks", "Resolver");
Uses = ("NFS", "Network Time");
OrderPreference = "Late";
Messages =
{
start = "Starting tomcat servlet engine";
stop = "Stopping tomcat servlet engine";
};
}
</file>


<file name="Tomcat">
#!/bin/sh

. /etc/rc.common

if [ -f $HOME/.tomcatrc ] ; then
. $HOME/.tomcatrc
fi

if [ "${TOMCAT_HOME:=}" = "" ] ; then
# try to find tomcat
if [ -d /usr/local/jakarta-tomcat-3.2.1/conf ] ; then
TOMCAT_HOME=/usr/local/etc/jakarta-tomcat-3.2.1
echo "Defaulting TOMCAT_HOME to $TOMCAT_HOME"
else
echo TOMCAT_HOME not set or found at /usr/local/etc/jakarta-tomcat-3.2.1/conf
exit 1
fi

fi

if [ -z "${JAVA_HOME:=}" ] ; then
JAVA=`which java`
if [ -z "$JAVA" ] ; then
echo "Cannot find JAVA. Please set your PATH."
exit 1
fi
JAVA_BINDIR=`dirname $JAVA`
JAVA_HOME=$JAVA_BINDIR/..
fi

if [ "${JAVACMD:=}" = "" ] ; then
# it may be defined in env - including flags!!
JAVACMD=$JAVA_HOME/bin/java
fi

oldCP=${CLASSPATH:=}

CLASSPATH=""
for i in ${TOMCAT_HOME}/lib/* ; do
if [ "$CLASSPATH" != "" ]; then
CLASSPATH=${CLASSPATH}:$i
else
CLASSPATH=$i
fi
done

if [ -f ${JAVA_HOME}/lib/tools.jar ] ; then
# We are probably in a JDK1.2 environment
CLASSPATH=${CLASSPATH}:${JAVA_HOME}/lib/tools.jar
fi

# Backdoor classpath setting for development purposes when all classes
# are compiled into a /classes dir and are not yet jarred.
if [ -d ${TOMCAT_HOME}/classes ]; then
CLASSPATH=${TOMCAT_HOME}/classes:${CLASSPATH}
fi

if [ "$oldCP" != "" ]; then
CLASSPATH=${CLASSPATH}:${oldCP}
fi

export CLASSPATH

# We start the server up in the background for a couple of reasons:
# 1) It frees up your command window
# 2) You should use `stop` option instead of ^C to bring down the server
cd $TOMCAT_HOME/bin
$JAVACMD -Dtomcat.home=${TOMCAT_HOME} org.apache.tomcat.startup.Tomcat 1>>$TOMCAT_HOME/logs/tomcat.log 2>&1 &

if [ "$oldCP" != "" ]; then
CLASSPATH=${oldCP}
export CLASSPATH
else
unset CLASSPATH
fi
</file>


Again, this is a HACK!! I'm sure there's a better way to get this running, but this'll get you started.

hth,
-k

     
Fresh-Faced Recruit
Join Date: Mar 2001
Location: Plymouth, MI 48170
Status: Offline
Reply With Quote
Apr 8, 2001, 05:56 PM
 
I've tried this and I cannot get it to work. I have tried many variations on this, including calling the original startup.sh from Tomcat. I even included the JAVA_HOME and TOMCAT_HOME settings in the tomcat.sh script to ensure that they were set.

I can see that "Tomcat starting up" is shown during login, but the Java process is not running once the startup is complete. How can I keep the Java process running and therefore Tomcat?


Any ideas?
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 03:17 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2