[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Server problem (Tomcat 5.5)

Posted on 2004-10-28
34
Medium Priority
?
322 Views
Last Modified: 2010-04-01
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]
0
Comment
Question by:DrWarezz
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 15
  • 10
  • 8
  • +1
34 Comments
 
LVL 9

Accepted Solution

by:
Nick_72 earned 1000 total points
ID: 12432458
Hi,

add this to your C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\ROOT\WEB-INF\web.xml
and restart tomcat:

    <servlet>
        <servlet-name>HelloWorld</servlet-name>
        <servlet-class>HelloWorld</servlet-class>
    </servlet>

    <servlet-mapping>
        <servlet-name>HelloWorld</servlet-name>
        <url-pattern>/HelloWorld</url-pattern>
    </servlet-mapping>

Then you should be able to run:

http://localhost:8080/HelloWorld

/Nick



0
 
LVL 9

Expert Comment

by:Nick_72
ID: 12432476
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.
0
 
LVL 9

Author Comment

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

?

cheers,
[r.D]
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 9

Author Comment

by:DrWarezz
ID: 12432503
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\
0
 
LVL 35

Assisted Solution

by:TimYates
TimYates earned 1000 total points
ID: 12432507
You may need to stick your servlet in a package as well...

ie:  put:

    package test ;

at the top of your servlet java file, copy it to

    WEB-INF/classes/test

and compile it there

(and change Nick_72's config from

    <servlet>
        <servlet-name>HelloWorld</servlet-name>
        <servlet-class>HelloWorld</servlet-class>
    </servlet>

to

    <servlet>
        <servlet-name>HelloWorld</servlet-name>
        <servlet-class>test.HelloWorld</servlet-class>
    </servlet>
0
 
LVL 35

Expert Comment

by:TimYates
ID: 12432512
> 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 :-)
0
 
LVL 9

Author Comment

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

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

thanks,
[r.D]
0
 
LVL 9

Expert Comment

by:Nick_72
ID: 12432539
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
0
 
LVL 9

Expert Comment

by:Nick_72
ID: 12432550
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
0
 
LVL 9

Author Comment

by:DrWarezz
ID: 12432573
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/

:-\
0
 
LVL 9

Expert Comment

by:Nick_72
ID: 12432588
did you put 8080 as the default port?
0
 
LVL 9

Author Comment

by:DrWarezz
ID: 12432599
Yup.
0
 
LVL 9

Expert Comment

by:Nick_72
ID: 12432633
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?
0
 
LVL 35

Expert Comment

by:TimYates
ID: 12432643
and check there is an "index.jsp" inside webapps/ROOT
0
 
LVL 9

Expert Comment

by:Nick_72
ID: 12432655
a good thing to do is also to check the logs:

C:\Program Files\Apache Software Foundation\Tomcat 5.5\logs
0
 
LVL 9

Author Comment

by:DrWarezz
ID: 12432685
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.
0
 
LVL 35

Expert Comment

by:TimYates
ID: 12432701
what about /logs/catalina.out ?
0
 
LVL 35

Expert Comment

by:TimYates
ID: 12432709
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?
0
 
LVL 9

Author Comment

by:DrWarezz
ID: 12432727
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]
0
 
LVL 9

Author Comment

by:DrWarezz
ID: 12432793
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]
0
 
LVL 9

Author Comment

by:DrWarezz
ID: 12432872
Note: R-DESKTOP is my computername, and M-DESKTOP is the computername of the ICS host. :-)
0
 
LVL 35

Expert Comment

by:TimYates
ID: 12432887
does it say anything in catalina.out?
0
 
LVL 9

Author Comment

by:DrWarezz
ID: 12432904
Oh yeah -- I searched for "catalina.out", and it doesn't exist. :o\
0
 
LVL 35

Expert Comment

by:TimYates
ID: 12432915
Does tomcat work if you just run it normally?  (Not as a service)
0
 
LVL 9

Author Comment

by:DrWarezz
ID: 12432936
:o\ How would I do that?
0
 
LVL 35

Expert Comment

by:TimYates
ID: 12433001
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
0
 
LVL 2

Expert Comment

by:siliconeagle
ID: 12433178
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")
0
 
LVL 9

Author Comment

by:DrWarezz
ID: 12433218
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
0
 
LVL 9

Author Comment

by:DrWarezz
ID: 12433263
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]
0
 
LVL 35

Expert Comment

by:TimYates
ID: 12433796
Have you looked at this:

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

It may contain something that helps? :-/
0
 
LVL 9

Author Comment

by:DrWarezz
ID: 12434275
Thanks, Tim -- I'll do some reading around there  :-)
0
 
LVL 9

Author Comment

by:DrWarezz
ID: 12435205
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]
0
 
LVL 35

Expert Comment

by:TimYates
ID: 12435269
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
0
 
LVL 9

Expert Comment

by:Nick_72
ID: 12435657
Thanks :)

/Nick
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Are you looking for the options available for exporting EDB files to PST? You may be confused as they are different in different Exchange versions. Here, I will discuss some options available.
With so many activities to perform, Exchange administrators are always busy in organizations. If everything, including Exchange Servers, Outlook clients, and Office 365 accounts work without any issues, they can sit and relax. But unfortunately, it…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question