Operating System - HP-UX
1748280 Members
3837 Online
108761 Solutions
New Discussion

Am Unable To Start Tomcat Using The Startup.sh Script

 
Rob Sandifer58
Frequent Advisor

Am Unable To Start Tomcat Using The Startup.sh Script

Background:     $ uname -a HP-UX testserver B.11.23 U ia64 3735928559 unlimited-user license $

 

$ swlist | grep -i tomcat

hpuxws22Tomcat             B.5.5.35.01    HP-UX Tomcat-based Servlet Engine

hpuxwsTomcat                 B.5.5.9.04     HP-UX Tomcat-based Servlet Engine

 

$ swlist | grep -i java

JAVAOOB                        2.03.07        Java2 Out-of-box for HP-UX

Java70                             1.7.0.01.00    Java 7.0 for HP-UX

T1456AA                          1.4.2.10.05    Java2 1.4 SDK for HP-UX

 

Problem:

 

When I attempt to start tomcat using the startup.sh script,  I get the following:

 

$ whoami

www

$ pwd

/opt/hpws/tomcat/bin

$  ./startup.sh

Neither the JAVA_HOME nor the JRE_HOME environment variable is defined

At least one of these environment variable is needed to run this program

 

 

Previously, I defined  JAVA_HOME in  /etc/rc.config.d/hpws_tomcatconf as follows:

 

# cat hpws_tomcatconf

# Tomcat Servlet Container configuration file

 

# Set HPWS_TOMCAT_START to 1 to have the Tomcat servlet-container started

# by the init process. HPWS_TOMCAT_START=0

HPWS_TOMCAT_START=1

 

# Set HPWS_TOMCAT_HOME to the location of the Tomcat servlet-container.

Default is /opt/hpws/tomcat HPWS_TOMCAT_HOME=/opt/hpws/tomcat

HPWS_TOMCAT_HOME=/opt/hpws/tomcat

 

# Set JAVA_HOME to the location of the java installation.

# It is required by Tomcat.

# Default is /opt/java1.5

# Set it to /opt/java1.4 when using the compatibility package to run Tomcat

# with JDK 1.4

JAVA_HOME=/opt/java7

 

When looking at the currently running java process,  I did notice that the currently running java environment seems to be

java1.4 and NOT the desired version which should be running,  java7

 

$ ps -ef | grep java

root  1829     1  0  Dec 20  ?        713:55 /opt/java1.4/jre/bin/IA64N/java -DRunnerValuePairFile=/var/opt/runner/data/valuePairs -cp /opt/runner/java/runner.jar: com.hp.m

 

So if my thinking is correct,  do I need to kill the current process and then invoke the desired  java7 environment  and then tomcat should be able to start running from the startup.sh script?   By the way,  the only tomcat file that I have configured thus far, is the one I mentioned above,   /etc/rc.config.d/hpws_tomcatconf.  Are there any more configuration files that need to be configured or anymore variables which need to be declared/assigned?  Thanks ahead of time!

 

Regards,

 

Rob S.

 

 

 

 

 

 

 

 

 

 

 

 

Rob Sandifer
6 REPLIES 6
Ken Grabowski
Respected Contributor

Re: Am Unable To Start Tomcat Using The Startup.sh Script

I would suggest you use /sbin/init.d/hpws_tomcat [start or stop] to bring up that process.  You can also take a look inside that script to get an idea of what needs to be setup before calling the startup.sh by itself.  

 

You can change the version of Java you use by editing the configuration file at: /etc/rc.config.d/hpws_tomcatconf 

Rob Sandifer58
Frequent Advisor

Re: Am Unable To Start Tomcat Using The Startup.sh Script

Hello Ken and thank you very much for the reply!

 

I started, or at least I  think  I started the tomcat service:

 

 

testserver.rsn.hp.com:/sbin/init.d

# ./hpws_tomcat start

Tomcat Started.

 

testserver.rsn.hp.com:/sbin/init.d

# ps -ef | grep -i tomcat     root  6508  5509  0 15:29:51 pts/7     0:00 grep -i tomcat

 

Please note that the ps command is indicating that its not seeing any active tomcat processes,  even though

the start message listed above  "Tomcat started"  seems to indicate otherwise.

 

Am not understanding what's happening here.... I'm nost sure whether tomcat is running or not...

 

Rob S.

Rob Sandifer
Dennis Handly
Acclaimed Contributor

Re: Am unable to start Tomcat using the startup.sh script

>I'm not sure whether tomcat is running or not...

 

Take a look at hpws_tomcat and see what processes it starts.

Ken Grabowski
Respected Contributor

Re: Am Unable To Start Tomcat Using The Startup.sh Script

Tomcat is not a compiled executable that can be greped from the ps commands output. It is a Java based application. The ps output would look like:

 

root 19624     1  0 08:36:43 pts/0     0:06 /opt/java6/bin/IA64N/java -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -XdoCloseWithReadPending -Djava.end

 

Of course the best way to verify its up and running is to connect to it through a web browser. If for some reason you can't do that, stop tomcat. Do a "ps" by itself. Start tomcat. Do another "ps" by itself and look for the new java process, note it's PID, then do a ps -ef and grep for the PID.

Rob Sandifer58
Frequent Advisor

Re: Am Unable To Start Tomcat Using The Startup.sh Script

Many thanks to all the replies I have received thus far!

 

Okay...

 

Apparently tomcat is now running;  I can successfully navigate to the link:

http://localhost:8081/  and view the page.  However,  it will serve up only

the plain HTML;  it does not look like the servlets are running.  Any ideas

how I can troubleshoot this?  By the way,  I am making a best effort basis

to help myself;  I am studying the tomcat admin guide,  googling, etc so didn't

want anyone to think I am trying to get them to do my work for me...

 

Regards,

 

Rob S.

Rob Sandifer
Rob Sandifer58
Frequent Advisor

Re: Am Unable To Start Tomcat Using The Startup.sh Script

Sorry...meant to post this under "Systems Administrattion" forum.... Is there any way that I can move this

thread/posting over to the  "System Administration"  group?

Rob Sandifer