running 2 projects without stopping tomcat [message #216772] |
Thu, 03 July 2008 21:19  |
Eclipse User |
|
|
|
Originally posted by: cuco2772.gmail.com
Hi, this may be a totally dumb question. I have 2 very simple projects
running
on Ganymede. All they are is just a couple jsps that invoke a servlet and
print
something akin to 'Hello World'. I'm right clicking on the jsp and choosing
'Run on Server', which loads the jsp and then I hit submit and that
invokes a servlet in both instances which just has a print statement.
I noticed that if I run one project and then run the other without
stopping the
server first, I get the familiar HTTP 404 error when running the second.
I guess my question is, why do I have to stop the server every time ?
Is there a way to not have to do that ? Just curious, thanks.
|
|
|
|
|
Re: running 2 projects without stopping tomcat [message #216904 is a reply to message #216824] |
Mon, 07 July 2008 08:49  |
Eclipse User |
|
|
|
Adam Posner wrote:
> Yes, you're right. If I run it externally it doesn't do that.
> On the internal browser, if I rt click on the project and run the
> server,and do that again with a second project without stopping the
> server first, I get the 404. But if I stop it and start it again, its ok.
The default behavior is to put the <Context> elements for added projects
in the server.xml for reasons explained here:
http://wiki.eclipse.org/WTP_Tomcat_FAQ#Why_are_.3CContext.3E _elements_added_to_server.xml_when_Dynamic_Web_Projects_are_ added_to_the_Tomcat_server.3F
Tomcat does not automatically pickup changes made to server.xml while it
is running, so a restart is required to have the added project seen by
Tomcat.
You could enable the "Publish module contexts to separate XML files"
option in the server editor. This causes the <Context> elements to be
placed in separate files down under the "conf/Catalina/<typically
localhost>" directory. Tomcat is able to pickup changes here so the
added project should get served. You will still likely get a 404 error
when using "Run on Server". Since the server is already running, the
browser will open immediately, before Tomcat is able to start the added
context. If you wait a moment and then refresh the browser you should
see the page.
For more detail about adding and removing projects while Tomcat is
running, see:
http://wiki.eclipse.org/WTP_Tomcat_FAQ#Can_I_add_or_remove_a _project_from_a_server.2C_or_publish_changes_for_a_project_a lready_on_a_server.2C_while_that_server_is_running.3F
Cheers,
Larry
|
|
|
Powered by
FUDForum. Page generated in 0.03659 seconds