aspose file tools*
The moose likes Servlets and the fly likes problem running webapp on remote server Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "problem running webapp on remote server" Watch "problem running webapp on remote server" New topic
Author

problem running webapp on remote server

Edmund Castermund
Ranch Hand

Joined: May 09, 2007
Posts: 85
I got tomcat 6 installed on my server,
so the address http://<server ip>:8080/
gives me the tomcat page, that's good.

I created a simple test app for tomcat that I run on my ubuntu desktop (tomcat is also installed on the desktop machine) so the link:

http://localhost:8080/EclipseServlet...pseFirstSevlet

gives me the proper output (note the misspelled "sevlet", whoops...)

however the link:

http://<ip address of server>:8080/EclipseServletTest/EclipseFirstSevlet

does not give me the correct output. I have the Webapp folder copied to the tomcat/webapps folder and I restarted the server...any idea what the problem might be?
bp
Vijitha Kumara
Bartender

Joined: Mar 24, 2008
Posts: 3837

Edmund Castermund wrote:http://localhost:8080/EclipseServlet...pseFirstSevlet
gives me the proper output (note the misspelled "sevlet", whoops...)
however the link:
http://<ip address of server>:8080/EclipseServletTest/EclipseFirstSevlet
does not give me the correct output. I have the Webapp folder copied to the tomcat/webapps folder and I restarted the server...any idea what the problem might be?


I don't think I understand it well, Are you talking about two machines (server & Desktop) ? If so are you able to access the index page of the Tomcat in your Desktop?


SCJP 5 | SCWCD 5
[How to ask questions] [Twitter]
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Anything in the logs? You're giving us essentially nothing to go on.
Edmund Castermund
Ranch Hand

Joined: May 09, 2007
Posts: 85
Hi,
thanks for the replies.
I first created the test webapp on my desktop with tomcat running there...it worked. I then installed tomcat on my server, and got the tomcat startup page to appear, so tomcat was installed correctly and running on my server.

I then copied the test-webapp folder from my desktop/tomcat-install-folder/webapps to my server/tomcat-install-folder/webapps and tried to run it from there....I wasn't able to.
I get the following 404 message

HTTP Status 404 - /EclipseServletTest/EclipseFirstSevlet

type Status report

message /EclipseServletTest/EclipseFirstSevlet

description The requested resource (/EclipseServletTest/EclipseFirstSevlet) is not available.

there is this in the log....


I haven't seen the "address already in use" error before...that has to do with startup, not copying the webapp folder, right?
hope that clarifies
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

That means there's already a server running on that address (port). Maybe you need to shut it down before starting it.
Edmund Castermund
Ranch Hand

Joined: May 09, 2007
Posts: 85
but why would the regular startup screen work fine, while the testapp webapp wasn't visible?
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

No clue. Maybe because the server's already running and has an index.html in the root webapp, and it's *still* running, because it was never shut down.

At least one port is in contention.
Edmund Castermund
Ranch Hand

Joined: May 09, 2007
Posts: 85
theoretically, though....
I should be able to copy some app folder from the tomcat/webapps folder on one machine to the tomcat/webapps folder on another machine and have it run, right?

I'm assuming that's how people deploy their actuall apps....
bp
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

In theory, sure, although it often requires a restart.
Edmund Castermund
Ranch Hand

Joined: May 09, 2007
Posts: 85
that's the thing....I did restart the server....I'll have to look through the web.xml more carefully, or just try a new one.
bp
Jimmy Clark
Ranch Hand

Joined: Apr 16, 2008
Posts: 2187
Java-based web applications are typically "deployed" by dropping the WAR file in the webapps folder. Copying entire folders with source code is typically not the normal course of action.

I would suggest that you create a WAR file for the web application and put that in the webapps folder. The web server should see the new WAR and "explode" it automatically.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Edmund Castermund wrote:that's the thing....I did restart the server....I'll have to look through the web.xml more carefully, or just try a new one.

It didn't restart if there was a port contention issue.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: problem running webapp on remote server