How to start tomcat with 2 jdk?

[LEFT]
Current platform: Sun OS 5.9 Solaris

isainfo -v
64-bit sparcv9 applications
32-bit sparc applications

Problem: Fail to start tomcat server

ps -ef | grep tomcat

nothing displays...

Steps:
Installed jakarta-tomcat-5.0.30

Installed jdk 1.6 and set path in profile

JAVA_HOME=/usr/jdk/instances/jdk1.6.0
CLASSPATH=$JAVA_HOME/bin:$JAVA_HOME/jre/lib
export JAVA_HOME CLASSPATH

This java version is used in another application.

java -version
java version "1.2.2"
Solaris VM (build Solaris_JDK_1.2.2_09, native threads, sunwjit)

How to start the tomcat with 2 java version correctly?[/LEFT]

How do you start tomcat? Maybe you have to set JAVA_HOME and CLASSPATH at another place too?

I usually start tomcat via SMF. In this case I have to set the shell variables in the SMF method script, because .profile is not evaluated.

I use the following method to start tomcat...it says it uses jdk 1.6 already.

bash-2.05# /usr/local/tomcat5/bin/startup.sh
Using CATALINA_BASE:   /usr/local/tomcat5
Using CATALINA_HOME:   /usr/local/tomcat5
Using CATALINA_TMPDIR: /usr/local/tomcat5/temp
Using JAVA_HOME:       /usr/jdk/instances/jdk1.6.0

Any other settings are required?
what's SMF script? similar to contrab?

SMF is the service management facility. It is the new way to start and control services under Solaris 10.

If you start tomcat as user root (which I would not recommend) as shown above, your grep command is not correct because tomcat is not part of the commandline. On one of my machines I have:

tomcat 14421     1   0   Feb 07 ?           5:54 /usr/jdk/instances/jdk1.5.0/bin/sparcv9/java -Djava.util.logging.manager=org.ap

The word tomcat only appears as username.

ic, I've make a new user to restart tomcat, but fail. Any idea?

$ /usr/local/tomcat5/bin/startup.sh
Using CATALINA_BASE:   /usr/local/tomcat5
Using CATALINA_HOME:   /usr/local/tomcat5
Using CATALINA_TMPDIR: /usr/local/tomcat5/temp
Using JAVA_HOME:       /usr/jdk/instances/jdk1.6.0

$ ps -ef | grep jdk
Aadmin  6646  6627  0 16:34:49 pts/3    0:00 grep jdk

Please, when posting listings or command lines, use code tags to enclose the text. You can add them using the # symbol in the icon bar above the editing box on selected text, or by manually adding

```text
```

tags.

thanks for reminder!

Hmm, could be a problem with the owner and access mode of files. You started tomcat as root earlier, so the logfiles are most likely owner by root, especially catalina.out in /usr/local/tomcat5/logs.

Are there any scripts that you can find in the /etc/rc.* directories?

you need to update your PATH so that you can find the correct version of java.

Now, my path is already set ok.

echo $PATH
/usr/sbin:/usr/bin:/usr/jdk/instances/jdk1.6.0/bin:/bin:/usr/local/tomcat5/bin:/usr/sfw/bin:/usr/ccs/bin

---------- Post updated at 11:23 PM ---------- Previous update was at 10:44 PM ----------

I find another application startup script at /etc/rc3.d. That application uses old java jre and iPlanet web server.

---------- Post updated 02-09-10 at 12:11 AM ---------- Previous update was 02-08-10 at 11:23 PM ----------

Thanks for your advice. I've changed all permission to the new user a/c under tomcat5 folder already. Not sure why tomcat cannot startup after exported the JAVA_HOME, PATH, JDK paths.

---------- Post updated at 03:02 AM ---------- Previous update was at 12:11 AM ----------

I could startup tomcat & jdk properly now.
And new port is set in server.xml (since 8080 is used by other appl.) But the page could not be displayed in The UNIX and Linux Forums - Learn UNIX and Linux from Experts

Hi

This works for me on XP Home SP2.

That it fails for you on some machines and works on others points to a
configuration issue with those machines (maybe the Java 6 install?) rather than
a Tomcat issue or an issue with the service wrapper.

The tomcat users list is the best place to get further help with this issue.

Or you can try this.

If you Google a little or browse tomcat-user mailing list you'll discover that
I'm not the only one to experience this very same problem. It is for sure a
configuration-related issue, but the fact that it involves only Tomcat and only
on jdk 1.6 (with jdk 1.5 it works fine on the same machine) and that at least a
few people who are long-time Tomcat users have not been able so far to fix it,
should suggest to keep the bug open and investigate further. Bear in mind that
not many people have started using jdk 1.6, and those who are may be using
Tomcat 6, so it may end up that many more cases show up in the next weeks.

Thanks

Hannan Saleemi