aspose file tools*
The moose likes Tomcat and the fly likes Problems installing Tomcat/XP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Problems installing Tomcat/XP" Watch "Problems installing Tomcat/XP" New topic
Author

Problems installing Tomcat/XP

Patrick Smith
Ranch Hand

Joined: Oct 08, 2007
Posts: 35
Hi,
i want to install Tomcat 6.x on my PC so i've downloaded and installed:
a) JDK SE v1.4.2.16 and set the JAVA_HOME variable
b) Tomcat 6.0.14 and set the TOMCAT_HOME variable.
When i want startup Tomcat in Tomcat/bin/startup.bat, a Dos window pops up shortly and that's it.
When i do a "Netstat" command in the DOS Window i do not see Tomcat running and the browser on http://localhost:8080/ says "Cannot find Server".
In addition to all helping advices, i would like to know the following:
a) where can i find eventually created logs (the folder Tomcat/logs is empty)
b) how can i make shure that JDK is running correctly so that it has to be related to Tomcat or it's environment?
Thanks in advance, Patrick
toukhir mujawar
Ranch Hand

Joined: Oct 11, 2006
Posts: 70
Hi,

follow the procedure below.

go to "Tools" menu of the browser.

click on "Internet Options -- connections tab -- LAN settings"

here check the option "Bypass proxy setting for local addresses"

This should work.
Patrick Smith
Ranch Hand

Joined: Oct 08, 2007
Posts: 35
Hi, i checked your advice, but this option is available only if on that same window the option "Use a proxy Server for your LAN" is enabled, which isn't the case in my config.
I could activate it and give the proxy the adress of my own host, but it doesn't seem to make sense. What do you think?
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Originally posted by Patrick Smith:
...
a) JDK SE v1.4.2.16 and set the JAVA_HOME variable
b) Tomcat 6.0.14 and set the TOMCAT_HOME variable.
...


Patrick,
Check the documentation for Tomcat again.
Tomcat 6 requires Java 1.5 or greater.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Patrick Smith
Ranch Hand

Joined: Oct 08, 2007
Posts: 35
Perfect, it works, i'll get the Tomcat welcome page.
Now i have another issue: when calling javac from my project directory (i'm doing Head First JSP/Servlets) to compile a Servlet, javac tella me it can't find the servlet classes:

src\Ch1Servlet.java:1: package javax.servlet does not exist
import javax.servlet.*;
^
src\Ch1Servlet.java:2: package javax.servlet.http does not exist
import javax.servlet.http.*;
^
src\Ch1Servlet.java:5: cannot find symbol
symbol: class HttpServlet
public class Ch1Servlet extends HttpServlet {
^
src\Ch1Servlet.java:6: cannot find symbol
symbol : class HttpServletRequest
location: class Ch1Servlet
public void doGet (HttpServletRequest request,HttpServletResponse response) throws IOException
^
src\Ch1Servlet.java:6: cannot find symbol
symbol : class HttpServletResponse
location: class Ch1Servlet
public void doGet (HttpServletRequest request,HttpServletResponse response) throws IOException
^
5 errors

What can i do? Tomcat should include these classes as they are part of the servlets. Btw.: I've installed Tomcat with the Zip version for Windows.
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14345
    
  22

You need to put the Servlet API classes in your classpath, because those classes are not part of Java SE. See: http://faq.javaranch.com/java/CompilingServlets

Have a look again in your Head First Servlets book because it most likely explains how you should compile servlets and that you need to set your classpath correctly.

So, did you install Java 5 or 6 instead of Java 1.4.2? If you're still using Java 1.4.2 with Tomcat 6, you might run into unexpected problems, because Tomcat 6 really needs Java 5 or newer.
[ November 28, 2007: Message edited by: Jesper Young ]

Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
Patrick Smith
Ranch Hand

Joined: Oct 08, 2007
Posts: 35
Yes, i had upgraded to JDK6U3 before i tested.
In the HeadFirst Servlets book, it says to set 2 variables: JAVA_HOME & TOMCAT_HOME. I've set both in XP:
JAVA_HOME=C:\Program Files\Java\jdk1.6.0_03
TOMCAT_HOME=C:\Program Files\apache-tomcat-6.0.14
Now, may be the TOMCAT_HOME needs to be extended, as servlet-api.jar is in TOMCAT_HOME\bin.
Other info: when i try to compile my servlet, i would enter, according to the book:
"javac -classpath C:\ProgramFiles\apache-tomcat-6.0.14\common\lib\servlet-api.jar -d classes src/Ch1Servlet.java".
But the common subdirectory doesn't exist in my deployment of Tomcat 6.0.14!
So, i need to enter:
"javac -classpath C:\ProgramFiles\apache-tomcat-6.0.14\lib\servlet-api.jar -d classes src/Ch1Servlet.java".
But javac still doesn't know about the servlet classes.
I've added then to the end of the classpath the directory of the servlet-api.jar:
"C:\Program Files\apache-tomcat-6.0.14\lib".
Then i reboot -> no change!
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

This really isn't a Tomcat issue anymore.
There are several people in Java In General (Beginner) who are having similar classpath issues this week.

You might want to skim that forum and see if someone has already answered your question.

Also, see:
http://faq.javaranch.com/java/CompilingServlets
It's got some links to FAQ entries that should be helpful to you.
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14345
    
  22

Originally posted by Patrick Smith:
I've added then to the end of the classpath the directory of the servlet-api.jar:
"C:\Program Files\apache-tomcat-6.0.14\lib".
Then i reboot -> no change!

That doesn't work. You need to add the JAR file itself to the classpath, not the directory that contains the JAR.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problems installing Tomcat/XP