Link to home
Start Free TrialLog in
Avatar of DrWarezz
DrWarezz

asked on

Server problem (Tomcat 5.5)

Yup, me again :-)

Basically, I've installed Tomcat 5.5 on my local machine, and have started the service.

In the following directory:
C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\ROOT\WEB-INF\classes

I've placed the following file:
HelloWorld.java
I then compiled it in this same directory, with no errors :-)

Now, when I load up IE, and type: http://localhost:8080/servlet/HelloWorld

The title of the IE window says: "Cannot find server", and the page displays "The page cannot be displayed, etc....".

I don't know what I've done wrong, but.. any ideas? :-\
Have I 'installed' the HelloWorld files to the right directory?

Thanks in advance,
[r.D]
ASKER CERTIFIED SOLUTION
Avatar of Nick_72
Nick_72

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Nick_72
Nick_72

The default applikation doesn't seem to load the invoker servlet which is used if the servlet is not defined in the web.xml file, so the easiest way is to do as above.
Avatar of DrWarezz

ASKER

:o\ Thanks Nick.
However, I'm getting the same problem. :o(

?

cheers,
[r.D]
Although it says that the server is started, is there anyway that I can verify that the server is running properly, and has created a Server socket?? :o\
SOLUTION
Avatar of TimYates
TimYates
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
> Although it says that the server is started, is there anyway that I can verify that the server is running properly, and has created a Server socket?? :o\

Go to

http://localhost:8080

you should see a welcome page :-)
>"you should see a welcome page :-)"
Nope -- no webpage loads :'(    lol

This would appear to be the problem then, right??

thanks,
[r.D]
Just a note:

The servlet does not have to be in a package.
If you would create a Java bean, however, the package is mandatory.

/Nick
DrWarezz, maybe you installed Tomcat as a service?
Go to Control Panel -> Administrative Tools -> Services.

Check for Apache Tomcat, if it is not started, rightclick and choose Start.

/Nick
Okay, according to the Services area, it hadn't been started. I started it, but no "Welcome" page is displayed when I go to: http://localhost:8080/

:-\
did you put 8080 as the default port?
Yup.
hmm...another thing (though which I believe the installer would have told you about in that case) is that the java runtime is not sufficient for running Tomcat. You need to install the Java SDK. Have you got the SDK installed?
and check there is an "index.jsp" inside webapps/ROOT
a good thing to do is also to check the logs:

C:\Program Files\Apache Software Foundation\Tomcat 5.5\logs
Oh, okay.

>"Have you got the SDK installed"
Yes. However, when I installed Tomcat, it automatically located  'what is ment to be the JRE', in a directory other than my SDK dir. :o\
Maybe that's the problem...?

>"and check there is an "index.jsp" inside webapps/ROOT"
Yeah, it's there.

>"a good thing to do is also to check the logs:"
Is this what you refer to...?

file:
jakarta_service_20041028.txt

content:
[2004-10-28 11:52:02] [info] Service Tomcat5 name Apache Tomcat
[2004-10-28 11:52:03] [info] Service Tomcat5 installed
[2004-10-28 11:52:03] [info] Procrun finished.
[2004-10-28 11:52:31] [info] Updating service...
[2004-10-28 11:52:31] [info] Service Tomcat5 updated
[2004-10-28 11:52:31] [info] Update service finished.
[2004-10-28 11:52:31] [info] Procrun finished.
[2004-10-28 11:52:32] [info] Updating service...
[2004-10-28 11:52:32] [info] Service Tomcat5 updated
[2004-10-28 11:52:32] [info] Update service finished.
[2004-10-28 11:52:32] [info] Procrun finished.
[2004-10-28 11:52:59] [info] Running Service...
[2004-10-28 11:52:59] [info] Starting service...
[2004-10-28 11:53:01] [info] Service started in 1687 ms.
[2004-10-28 11:53:05] [info] Run service finished.
[2004-10-28 11:53:05] [info] Procrun finished.
[2004-10-28 11:53:17] [info] Running Service...
[2004-10-28 11:53:17] [info] Starting service...
[2004-10-28 11:53:18] [info] Service started in 1421 ms.
[2004-10-28 11:53:22] [info] Run service finished.
[2004-10-28 11:53:22] [info] Procrun finished.


ThanQ.
what about /logs/catalina.out ?
You could also try running "netstat" in a command window, and look for port numbers that are being listened on...

Maybe it isn't running on 8080?
Okay, I ran netstat, and here's the results:

Active Connections

  Proto  Local Address          Foreign Address        State
  TCP    R-DESKTOP:1027         localhost:2794         TIME_WAIT
  TCP    R-DESKTOP:1027         localhost:2800         TIME_WAIT
  TCP    R-DESKTOP:1027         localhost:2804         TIME_WAIT
  TCP    R-DESKTOP:1027         localhost:2822         TIME_WAIT
  TCP    R-DESKTOP:1027         localhost:2823         TIME_WAIT
  TCP    R-DESKTOP:2459         localhost:1027         CLOSE_WAIT
  TCP    R-DESKTOP:1970         M-DESKTOP.mshome.net:2869  ESTABLISHED
  TCP    R-DESKTOP:1975         baym-cs335.msgr.hotmail.com:1863  ESTABLISHED
  TCP    R-DESKTOP:5000         M-DESKTOP.mshome.net:3227  ESTABLISHED

I thought that I'd try "1027", as it seemed a common port above :-), so, I attempted:
http://localhost:1027/
And the results:

Title: HTTP 403 (Forbidden)
Content: You are not authorized to view this page, etc..

:o\
[r.D]
I done netstat with the -a switch, to see all the listenning connections, and here's the results :-|

  Proto  Local Address          Foreign Address        State
  TCP    R-DESKTOP:epmap        R-DESKTOP:0            LISTENING
  TCP    R-DESKTOP:microsoft-ds  R-DESKTOP:0            LISTENING
  TCP    R-DESKTOP:1025         R-DESKTOP:0            LISTENING
  TCP    R-DESKTOP:1026         R-DESKTOP:0            LISTENING
  TCP    R-DESKTOP:1027         R-DESKTOP:0            LISTENING
  TCP    R-DESKTOP:1970         R-DESKTOP:0            LISTENING
  TCP    R-DESKTOP:1975         R-DESKTOP:0            LISTENING
  TCP    R-DESKTOP:2459         R-DESKTOP:0            LISTENING
  TCP    R-DESKTOP:2882         R-DESKTOP:0            LISTENING
  TCP    R-DESKTOP:2890         R-DESKTOP:0            LISTENING
  TCP    R-DESKTOP:2906         R-DESKTOP:0            LISTENING
  TCP    R-DESKTOP:2907         R-DESKTOP:0            LISTENING
  TCP    R-DESKTOP:3389         R-DESKTOP:0            LISTENING
  TCP    R-DESKTOP:5000         R-DESKTOP:0            LISTENING
  TCP    R-DESKTOP:5555         R-DESKTOP:0            LISTENING
  TCP    R-DESKTOP:1027         localhost:2895         TIME_WAIT
  TCP    R-DESKTOP:2459         localhost:1027         CLOSE_WAIT
  TCP    R-DESKTOP:2889         localhost:microsoft-ds  TIME_WAIT
  TCP    R-DESKTOP:netbios-ssn  R-DESKTOP:0            LISTENING
  TCP    R-DESKTOP:netbios-ssn  M-DESKTOP.mshome.net:3013  ESTABLISHED
  TCP    R-DESKTOP:1970         M-DESKTOP.mshome.net:2869  ESTABLISHED
  TCP    R-DESKTOP:1975         baym-cs335.msgr.hotmail.com:1863  ESTABLISHED
  TCP    R-DESKTOP:2882         M-DESKTOP.mshome.net:2869  CLOSE_WAIT
  TCP    R-DESKTOP:2883         M-DESKTOP.mshome.net:2869  TIME_WAIT
  TCP    R-DESKTOP:2890         a193-108-153-95.deploy.akamaitechnologies.com:http  CLOSE_WAIT
  TCP    R-DESKTOP:2906         www-level3.experts-exchange.com:http  ESTABLISHED
  TCP    R-DESKTOP:2907         www-level3.experts-exchange.com:http  ESTABLISHED
  TCP    R-DESKTOP:5000         M-DESKTOP.mshome.net:3009  ESTABLISHED
  TCP    R-DESKTOP:5000         M-DESKTOP.mshome.net:3423  ESTABLISHED
  UDP    R-DESKTOP:microsoft-ds  *:*                    
  UDP    R-DESKTOP:1037         *:*                    
  UDP    R-DESKTOP:1067         *:*                    
  UDP    R-DESKTOP:1130         *:*                    
  UDP    R-DESKTOP:1226         *:*                    
  UDP    R-DESKTOP:1251         *:*                    
  UDP    R-DESKTOP:1979         *:*                    
  UDP    R-DESKTOP:ntp          *:*                    
  UDP    R-DESKTOP:1031         *:*                    
  UDP    R-DESKTOP:1053         *:*                    
  UDP    R-DESKTOP:1900         *:*                    
  UDP    R-DESKTOP:2106         *:*                    
  UDP    R-DESKTOP:discard      *:*                    
  UDP    R-DESKTOP:ntp          *:*                    
  UDP    R-DESKTOP:netbios-ns   *:*                    
  UDP    R-DESKTOP:netbios-dgm  *:*                    
  UDP    R-DESKTOP:1900         *:*                    
  UDP    R-DESKTOP:2051         *:*                    
  UDP    R-DESKTOP:17987        *:*                    
  UDP    R-DESKTOP:48945        *:*            


I must remind you, that I'm on a network, running the internet off of another machine (the ICS host). :o)
But... isn't that weird?

[r.D]
Note: R-DESKTOP is my computername, and M-DESKTOP is the computername of the ICS host. :-)
does it say anything in catalina.out?
Oh yeah -- I searched for "catalina.out", and it doesn't exist. :o\
Does tomcat work if you just run it normally?  (Not as a service)
:o\ How would I do that?
errr...  you *should* be able to run tomcat/bin/startup.bat

I'm not sure about how to get it set up right for windows though :-(

Hmmm
lets try a basic one:-
do you have JDK installed? if so what version?

have you set a user enviroment variable for JAVA_HOME?
to do so, go to :-
MyComputer->rt clk->properties.
Advanced(tab) -> Environent variables(clk)
under user environemnt variables for <username> add an environment variable
"JAVA_HOME" , value is the path to your JDK top level dir (in my case"C:\j2sdk1.4.2_04")
Yeah, I have JDK, version 1.4.
I've added the environment variable JAVA_HOME, with the value of: C:\j2sdk1.4.1_06

>"you *should* be able to run tomcat/bin/startup.bat"
As in: Tomcat 5.5\bin\startup.bat ?
If so, startup.bat doesn't exist (and neither does startup.sh).

:o\
Ta
This is all really weird.
Would you lot recommend that I just download an earlier version of Tomcat? One that you lot are slightly more familiar with perhaps? :-)  Because, if you think it would help, then I'll be more than happy to do that.

btw; I'll be back in about 50 minutes :)

ThanQ.
[r.D]
Have you looked at this:

http://jakarta.apache.org/tomcat/tomcat-5.5-doc/windows-service-howto.html

It may contain something that helps? :-/
Thanks, Tim -- I'll do some reading around there  :-)
Okay, I decided that I'd give an earlier version of Tomcat a go. I installed the latest version of Tomcat 4, and it ALL works great! :D

So, I'll leave v5.5 for another time ;-)

I really appreciate all the help though - so I'll split the points. :-)

Thanks again,
[r.D]
Damn...that's a shame :-)  Still, hopefully when 5.5 is out of beta it will work better, and you can give it another go ;-)

It's one of those things that is really hard to fix without being there :-(

> so I'll split the points

Aww!  Thanks :-)

Good luck with it...

Tim
Thanks :)

/Nick