LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Tomcat issues in Fedora Core 4 (https://www.linuxquestions.org/questions/linux-software-2/tomcat-issues-in-fedora-core-4-a-421243/)

mharris45 03-03-2006 08:55 AM

Tomcat issues in Fedora Core 4
 
Hello all,
First off, I'm a linux newbie here, so this very well may be to blame.

Anyways, I've recently installed FC4 along with Sun's J2EE 1.4 suite. The installation went fine and I installed it to, /usr/java/j2ee. Now, I need to install tomcat to get going on my project. So, I go to apache.org and download Tomcat 5.X and follow their installation instructions. Everything seems to go fine until I try to start or stop Tomcat.

During the startup process, with my $JAVA_HOME set to /usr/java/j2ee, I get an error that Tomcat can't find my java VM. So, I switch my $JAVA_HOME to /usr/java/jre and that works great. I am able to test and run depoyed war files. However, more problems occur during stutdown.

When I run the shutdown.sh script, I get the following error:
SEVERE: Catalina.stop:
java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(Unknown Source)
at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at org.apache.catalina.startup.Catalina.stopServer(Catalina.java:394)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)


At this point, I have no idea what to do, but am willing to try anything.

Also, when I run the command java -version, I get back 1.4.2. However, it's supposed to be using JDK1.5 that is installed with J2EE 1.4.

Any help would be greatly appreciated, as you can see I'm completely lost.

Basel 03-04-2006 04:48 AM

You do not have to install Java EE (J2EE) if all that you need is simple web development using JSP. Tomcat has a jar file that you can use to develop web applications using Servlet and JSP. The Java EE SDK that you downloaded has a Java EE certified Application Server unlike Tomcat which is a Servlet container.
From your post it looks like you downloaded Java EE 1.4 bundle that has Java SE 5.0 (J2SE 1.5). In order to use the bundled Java SE you need to override the default value of JAVA_HOME set by Fedora. You can do so by adding the following line of code to ~/.bashrc or ~/.bash_profile
Code:

export JAVA_HOME=/location_to_your_bundled_java_home
The bundled Java SE should be in a directory under /usr/java/j2ee in your case.

If you want to know which java and javac are used issue the following command
Code:

which javac
Please note that changes to one of .bashrc and .bash_profile takes place only when you start a new session. Sorry but I cannot recall which one is that.

BTW, which version of Tomcat do you have? If you want to use Java SE 5.0 you need to download Tomcat 5.5.x. Tomcat 5.0.x works with Java SE 1.4.

mharris45 03-06-2006 09:52 AM

Thank you for the reply.

I'm using tomcat 5.5.x, the latest one of the apache site.
I changed my Java home to use the sdk 1.5 and that worked great.

Also, I was unaware the that tomcat came with the required jar files, so that pretty much means I don't need J2EE.

Thanks for the help.

PTrenholme 03-06-2006 10:29 AM

There is a version of Tomcat available in the standard Fedora repositories which has, I believe, been "tuned" to work correctly in Fedora.

Rather than installing from apache.org, you might have been better off just trying a simple yum install tomcat. Under the "many hands make light work" policy, I think its usually better to try a yum install for a new package before looking for the generic package from the developers.

ikiini 03-07-2007 01:34 PM

hey I am having the exact same problem. when i shut down my TC i get that same error. I know every thing works and is installed correclty. I have been using this install for a while with no problems. The only change i remember making of recent is that i added a file to the shared folder. (aspectjweaver.jar) and i updated my jvm with the DSTupdater from the java site. this thing is really kicking my A#$...need some serious help here. Thanks

-B


All times are GMT -5. The time now is 01:43 PM.