• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Tim Cooke
Sheriffs:
  • Rob Spoor
  • Liutauras Vilda
  • paul wheaton
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Mikalai Zaikin
  • Carey Brown
  • Piet Souris
Bartenders:
  • Stephan van Hulst

Problems installing Tomcat/XP

 
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
Patrick Smith
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
Patrick Smith
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
girl power ... turns out to be about a hundred watts. But they seriuosly don't like being connected to the grid. Tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic