Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Web Tools Project (WTP) » Re: Tomcat with Eclipse (Europa) / JSP
Re: Tomcat with Eclipse (Europa) / JSP [message #209273] Fri, 29 February 2008 21:25 Go to next message
Eclipse User
Originally posted by: eclipse-news.rizzoweb.com

Ron wrote:
> I can get Tomcat 5.5 to run without errors. However, when I try to run a
> simple JSP page, nothing displays. Where do I find out the document
> root? I assume it is localhost:8080/ but there are no resources there.
> Is there a simple step by step tutorial on line showing how to make a
> simple JSP page in Eclipse and running it with Tomcat?
>

Copying this question to the eclipse.webtools newsgroup.
Re: Tomcat with Eclipse (Europa) / JSP [message #209282 is a reply to message #209273] Sun, 02 March 2008 03:53 Go to previous messageGo to next message
Russell Bateman is currently offline Russell Bateman
Messages: 3189
Registered: July 2009
Location: Provo, Utah, USA
Senior Member

Eric Rizzo wrote:
> Ron wrote:
>> I can get Tomcat 5.5 to run without errors. However, when I try to run
>> a simple JSP page, nothing displays. Where do I find out the document
>> root? I assume it is localhost:8080/ but there are no resources there.
>> Is there a simple step by step tutorial on line showing how to make a
>> simple JSP page in Eclipse and running it with Tomcat?
>>
>
> Copying this question to the eclipse.webtools newsgroup.
>

I used this one--written for Eclipse 3.1, however, I so far haven't
gotten anything but an HTTP 404 out of it (when I go to the browser with
the URL). I know Tomcat's running. I'm assuming it's my fault, but
cheesh, where to find the solution?


http://www.eclipse.org/webtools/community/tutorials/BuildJ2E EWebApp/BuildJ2EEWebApp.html
Re: Tomcat with Eclipse (Europa) / JSP [message #209353 is a reply to message #209282] Mon, 03 March 2008 15:19 Go to previous messageGo to next message
Larry Isaacs is currently offline Larry Isaacs
Messages: 1305
Registered: July 2009
Senior Member
Windofkeltia wrote:
> Eric Rizzo wrote:
>> Ron wrote:
>>> I can get Tomcat 5.5 to run without errors. However, when I try to
>>> run a simple JSP page, nothing displays. Where do I find out the
>>> document root? I assume it is localhost:8080/ but there are no
>>> resources there. Is there a simple step by step tutorial on line
>>> showing how to make a simple JSP page in Eclipse and running it with
>>> Tomcat?
>>>
>>
>> Copying this question to the eclipse.webtools newsgroup.
>>
>
> I used this one--written for Eclipse 3.1, however, I so far haven't
> gotten anything but an HTTP 404 out of it (when I go to the browser with
> the URL). I know Tomcat's running. I'm assuming it's my fault, but
> cheesh, where to find the solution?
>
>
> http://www.eclipse.org/webtools/community/tutorials/BuildJ2E EWebApp/BuildJ2EEWebApp.html
>

If the project has not already been added to the server, I would
recommend first stopping the server. Then right-click the JSP or
servlet in a navigational view or editor and execute Run As -> Run on
Server. Assuming you have not specified the default server for the
project, you will see a dialog asking which server to run on. Make your
selection and click Finish. The server will be published and started,
if necessary. Then the browser will open with the appropriate URL for
the JSP or servlet. This is the easiest way to come up with the correct
URL for a resource in your project.

I'm afraid the tutorial mentioned above is really old. I believe it
predates the WTP 1.0 release. While the concepts it describes may be
similar, the UI can be very different in places with respect to current
versions of WTP.

Cheers,
Larry

P.S. For additional info about the Tomcat support in WTP, see the Tomcat
FAQ at http://wiki.eclipse.org/WTP_Tomcat_FAQ
Re: Tomcat with Eclipse (Europa) / JSP [message #209538 is a reply to message #209353] Tue, 04 March 2008 20:19 Go to previous messageGo to next message
Russell Bateman is currently offline Russell Bateman
Messages: 3189
Registered: July 2009
Location: Provo, Utah, USA
Senior Member

Thanks, Larry.

I followed your steps which differ from the tutorial. Indeed, your
sequence brings up Eclipse's browser (I was using a separate, Firefox
browser). Again, I get the 404, but Eclipse has substituted a URL for this
that is sort of expected, but not what I was looking for given the web.xml
in the project:

http://localhost:8080/WTP-Tutorial-I/

which is the name of the Eclipse project. The tutorial wanted me to type in

http://localhost:8080/tutorial/snoop/

I'm perusing this wiki you sent me; I hadn't stumbled upon it yet. Eclipe
resources are myriad and it's sometimes challenging to pick something
useful out of so many aids.

Thanks,

Russ Bateman
Re: Tomcat with Eclipse (Europa) / JSP [message #209566 is a reply to message #209538] Tue, 04 March 2008 21:19 Go to previous messageGo to next message
Larry Isaacs is currently offline Larry Isaacs
Messages: 1305
Registered: July 2009
Senior Member
Russ Bateman wrote:
> Thanks, Larry.
>
> I followed your steps which differ from the tutorial. Indeed, your
> sequence brings up Eclipse's browser (I was using a separate, Firefox
> browser). Again, I get the 404, but Eclipse has substituted a URL for
> this that is sort of expected, but not what I was looking for given the
> web.xml in the project:
>
> http://localhost:8080/WTP-Tutorial-I/
>
> which is the name of the Eclipse project. The tutorial wanted me to type in
>
> http://localhost:8080/tutorial/snoop/
>
> I'm perusing this wiki you sent me; I hadn't stumbled upon it yet.
> Eclipe resources are myriad and it's sometimes challenging to pick
> something useful out of so many aids.
>
> Thanks,
>
> Russ Bateman
>

It is the context-root setting that determines the what immediately
follows the host and port in the URL, i.e.
http://localhost:8080/<context-root>/. The value initially defaults to
the same as the project name you specify when you create the Dynamic Web
Project. If your project name isn't suitable as the context-root, or
you simply want to change it, use the Web Project Settings page in the
project's Properties dialog. It looks like the tutorial wants the
context-root to be "tutorial".

Cheers,
Larry
Re: Tomcat with Eclipse (Europa) / JSP [message #209582 is a reply to message #209566] Wed, 05 March 2008 02:01 Go to previous messageGo to next message
³Ã?Á¦ is currently offline Â³Ã?Á¦
Messages: 3
Registered: July 2009
Junior Member
you should add the web project path in server.xml
add restart the tomcat.
Re: Tomcat with Eclipse (Europa) / JSP [message #209589 is a reply to message #209582] Wed, 05 March 2008 05:29 Go to previous messageGo to next message
Russell Bateman is currently offline Russell Bateman
Messages: 3189
Registered: July 2009
Location: Provo, Utah, USA
Senior Member

billy wrote:

> you should add the web project path in server.xml
> add restart the tomcat.

Uh, okay, could you be a little more specific? I'm doing this on Windows
now where I get the identical behavior to Linux, so I know it's not Linux:
it's ME! (Was there ever any doubt?)

"C:\russ\workspace\Web Tools Platform\Servers\Tomcat v6.0 Server at
localhost-con
fig\server.xml" is full of good stuff. Give me a hint as to what I'm
supposed to add in there. I would also like to understand, if you care to
respond,

1) why, having followed the tutorial, this must be done (i.e.: why Eclipse
didn't do it for me or why the tutorial didn't discuss the step)?

2) whether this is supposed to make it work only in the Eclipse browser or
in both that browser and Firefox?

I __really__ appreciate the help getting over this big speed bump in the
road.

Russ
Re: Tomcat with Eclipse (Europa) / JSP [message #209608 is a reply to message #209589] Wed, 05 March 2008 08:27 Go to previous messageGo to next message
Eclipse User
Originally posted by: mauro.molinari.cardinis.com

Russell Bateman ha scritto:
> 2) whether this is supposed to make it work only in the Eclipse browser
> or in both that browser and Firefox?

You can use any browser.

Cheers,
Mauro.
Re: Tomcat with Eclipse (Europa) / JSP [message #209630 is a reply to message #209589] Wed, 05 March 2008 14:40 Go to previous messageGo to next message
Larry Isaacs is currently offline Larry Isaacs
Messages: 1305
Registered: July 2009
Senior Member
Russell Bateman wrote:
> billy wrote:
>
>> you should add the web project path in server.xml
>> add restart the tomcat.
>
> Uh, okay, could you be a little more specific? I'm doing this on Windows
> now where I get the identical behavior to Linux, so I know it's not
> Linux: it's ME! (Was there ever any doubt?)
>
> "C:\russ\workspace\Web Tools Platform\Servers\Tomcat v6.0 Server at
> localhost-con
> fig\server.xml" is full of good stuff. Give me a hint as to what I'm
> supposed to add in there. I would also like to understand, if you care
> to respond,
>
> 1) why, having followed the tutorial, this must be done (i.e.: why
> Eclipse didn't do it for me or why the tutorial didn't discuss the step)?
>
> 2) whether this is supposed to make it work only in the Eclipse browser
> or in both that browser and Firefox?
>
> I __really__ appreciate the help getting over this big speed bump in the
> road.
>
> Russ
>
>

I'm not aware of any reason would need to modify server.xml at this
point. There are customizations that could have been imported when you
created the server which can cause problems, but nothing so far confirms
such a problem.

The current problem appears to be synchronizing the out-of-date tutorial
with current WTP UI. For example, the second image in the "Create a
J2EE Web Project with a web module" section shows a "Context Root" field
which differs from the project name entered above. This field no longer
exists in the current UI for this dialog. Thus, your Context Root
setting will be the same as your project name initially. You can either
account for that fact through the remainder of the tutorial, or you can
change the Context Root (also called context-root) as indicated in my
prior post to be "tutorial" so you can keep that setting in sync with
the tutorial. Once that is addressed, then we can move on to the next
problem, if things still aren't working.

Cheers,
Larry
Re: Tomcat with Eclipse (Europa) / JSP [message #209646 is a reply to message #209630] Wed, 05 March 2008 15:03 Go to previous messageGo to next message
Russell Bateman is currently offline Russell Bateman
Messages: 3189
Registered: July 2009
Location: Provo, Utah, USA
Senior Member

Larry Isaacs wrote:

> I'm not aware of any reason would need to modify server.xml at this
> point. There are customizations that could have been imported when you
> created the server which can cause problems, but nothing so far confirms
> such a problem.

> The current problem appears to be synchronizing the out-of-date tutorial
> with current WTP UI. For example, the second image in the "Create a
> J2EE Web Project with a web module" section shows a "Context Root" field
> which differs from the project name entered above. This field no longer
> exists in the current UI for this dialog. Thus, your Context Root
> setting will be the same as your project name initially. You can either
> account for that fact through the remainder of the tutorial, or you can
> change the Context Root (also called context-root) as indicated in my
> prior post to be "tutorial" so you can keep that setting in sync with
> the tutorial. Once that is addressed, then we can move on to the next
> problem, if things still aren't working.

> Cheers,
> Larry

This makes sense. So I refactored "WTP-Tutorial-I" to merely "tutorial."
Then, I right-clicked on tutorial->Properties->Server, chose Tomcat v6.0
Server at localhost, OK. Then, I right-clicked on tutorial (following
advice you gave me a response or two ago), chose Run As->Run on Server,
clicked Update context root for Web module tutorial, clicked Finish. I got
the HTTP 404 for an address line http://localhost:8080/tutorial/ with
these errors in the Console:

Mar 5, 2008 7:59:50 AM org.apache.tomcat.util.digester.SetPropertiesRule
begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting
property 'source' to 'org.eclipse.jst.jee.server:tutorial' did not find a
matching property.
Mar 5, 2008 7:59:50 AM org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal
performance in production environments was not found on the
java.library.path:
/usr/lib/jvm/jdk1.6.0_04/jre/lib/i386/client:/usr/lib/jvm/jd k1.6.0_04/jre/lib/i386:/usr/lib/jvm/jdk1.6.0_04/jre/../lib/i 386:/usr/lib/jvm/jdk1.6.0_04/jre/lib/i386/client::/usr/lib/j vm/jdk1.6.0_04/jre/lib/i386::/usr/lib/xulrunner-1.8.1b2:/usr /lib/xulrunner-1.8.1b2:/usr/java/packages/lib/i386:/lib:/usr /lib
Mar 5, 2008 7:59:50 AM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
Mar 5, 2008 7:59:50 AM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 564 ms
Mar 5, 2008 7:59:50 AM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Mar 5, 2008 7:59:50 AM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.16
Mar 5, 2008 7:59:51 AM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
Mar 5, 2008 7:59:51 AM org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
Mar 5, 2008 7:59:51 AM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/31 config=null
Mar 5, 2008 7:59:51 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 426 ms

Perhaps this will point out my disconnect?
Re: Tomcat with Eclipse (Europa) / JSP [message #209673 is a reply to message #209646] Wed, 05 March 2008 16:14 Go to previous messageGo to next message
Larry Isaacs is currently offline Larry Isaacs
Messages: 1305
Registered: July 2009
Senior Member
Russell Bateman wrote:
> Larry Isaacs wrote:
>
>> I'm not aware of any reason would need to modify server.xml at this
>> point. There are customizations that could have been imported when
>> you created the server which can cause problems, but nothing so far
>> confirms such a problem.
>
>> The current problem appears to be synchronizing the out-of-date
>> tutorial with current WTP UI. For example, the second image in the
>> "Create a J2EE Web Project with a web module" section shows a "Context
>> Root" field which differs from the project name entered above. This
>> field no longer exists in the current UI for this dialog. Thus, your
>> Context Root setting will be the same as your project name initially.
>> You can either account for that fact through the remainder of the
>> tutorial, or you can change the Context Root (also called
>> context-root) as indicated in my prior post to be "tutorial" so you
>> can keep that setting in sync with the tutorial. Once that is
>> addressed, then we can move on to the next problem, if things still
>> aren't working.
>
>> Cheers,
>> Larry
>
> This makes sense. So I refactored "WTP-Tutorial-I" to merely "tutorial."
> Then, I right-clicked on tutorial->Properties->Server, chose Tomcat v6.0
> Server at localhost, OK. Then, I right-clicked on tutorial (following
> advice you gave me a response or two ago), chose Run As->Run on Server,
> clicked Update context root for Web module tutorial, clicked Finish. I
> got the HTTP 404 for an address line http://localhost:8080/tutorial/
> with these errors in the Console:
>
> Mar 5, 2008 7:59:50 AM org.apache.tomcat.util.digester.SetPropertiesRule
> begin
> WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting
> property 'source' to 'org.eclipse.jst.jee.server:tutorial' did not find
> a matching property.
> Mar 5, 2008 7:59:50 AM org.apache.catalina.core.AprLifecycleListener init
> INFO: The APR based Apache Tomcat Native library which allows optimal
> performance in production environments was not found on the
> java.library.path:
> /usr/lib/jvm/jdk1.6.0_04/jre/lib/i386/client:/usr/lib/jvm/jd k1.6.0_04/jre/lib/i386:/usr/lib/jvm/jdk1.6.0_04/jre/../lib/i 386:/usr/lib/jvm/jdk1.6.0_04/jre/lib/i386/client::/usr/lib/j vm/jdk1.6.0_04/jre/lib/i386::/usr/lib/xulrunner-1.8.1b2:/usr /lib/xulrunner-1.8.1b2:/usr/java/packages/lib/i386:/lib:/usr /lib
>
> Mar 5, 2008 7:59:50 AM org.apache.coyote.http11.Http11Protocol init
> INFO: Initializing Coyote HTTP/1.1 on http-8080
> Mar 5, 2008 7:59:50 AM org.apache.catalina.startup.Catalina load
> INFO: Initialization processed in 564 ms
> Mar 5, 2008 7:59:50 AM org.apache.catalina.core.StandardService start
> INFO: Starting service Catalina
> Mar 5, 2008 7:59:50 AM org.apache.catalina.core.StandardEngine start
> INFO: Starting Servlet Engine: Apache Tomcat/6.0.16
> Mar 5, 2008 7:59:51 AM org.apache.coyote.http11.Http11Protocol start
> INFO: Starting Coyote HTTP/1.1 on http-8080
> Mar 5, 2008 7:59:51 AM org.apache.jk.common.ChannelSocket init
> INFO: JK: ajp13 listening on /0.0.0.0:8009
> Mar 5, 2008 7:59:51 AM org.apache.jk.server.JkMain start
> INFO: Jk running ID=0 time=0/31 config=null
> Mar 5, 2008 7:59:51 AM org.apache.catalina.startup.Catalina start
> INFO: Server startup in 426 ms
>
> Perhaps this will point out my disconnect?
>

This log shows nothing wrong. The warning is new with Tomcat 6.0.16,
but normal and may be ignored. I think the disconnect is that 404 is in
fact the expected response for "http://localhost:8080/tutorial/", which
would display the webapp's welcome file if one had been added. It looks
like the tutorial expects you to enter
"http://localhost:8080/tutorial/snoop".

Cheers,
Larry
Re: Tomcat with Eclipse (Europa) / JSP [message #209723 is a reply to message #209673] Thu, 06 March 2008 01:29 Go to previous messageGo to next message
Russell Bateman is currently offline Russell Bateman
Messages: 3189
Registered: July 2009
Location: Provo, Utah, USA
Senior Member

Larry Isaacs wrote:

> This log shows nothing wrong. The warning is new with Tomcat 6.0.16,
> but normal and may be ignored. I think the disconnect is that 404 is in
> fact the expected response for "http://localhost:8080/tutorial/", which
> would display the webapp's welcome file if one had been added. It looks
> like the tutorial expects you to enter
> "http://localhost:8080/tutorial/snoop".

> Cheers,
> Larry

That address (http://localhost:8080/tutorial/snoop) doesn't work either,
but I know roughly what the problem is now.

At noon, a friend of mine who's done a fair amount of this and I went
through a simple JSP starting from scratch on Linux (I've duplicated all
of this trouble on Windows, so it's not a host platform issue). We
installed the latest JDK 6, Tomcat 6 and Eclipse 3.3 (the J2EE flavor).
Then, similarly to the tutorial, we set up a JSP (no servlet) and tried it
out. It worked.

I pointed out to my friend that the tutorial had a radically different
web.xml (besides the servlet and also because of the existence of the
servlet) than what Eclipse set up for us when we created a new Dynamic Web
Project just then. I showed it to him and so we played around a bit and
got exactly this same problem.

What we found is that if you change the context root of the application to
something other than its name in Project Explorer, it breaks. However,
this is a legitimate thing to do. So we kept playing around until we found
a sequence of steps that, after changing the context root, would give us
the page using that new root in the address line.

It involves as you already imagine (because you talked around in the
ballpark in this thread about it) changing a line near the bottom of
server.xml (because though it set this file up, Eclipse does not
"maintain" it--it would appear--when changing the context root in
Eclipse), restarting the server, removing and re-adding the project to the
server, cleaning and re-publishing the server. Now, it might be that one
of these doesn't have to be done (specifically the last one), but I don't
know yet: our experimentation hasn't gone into that detail, but we made it
work.

I'm going to write my own tutorial on setting this stuff all up from
scratch all the way through a JSP and servlet so that if anyone out there
is as dim-witted as I, he or she won't be left to rattle around between
the eclipse forums, javaranch, etc. looking for the solution. I wonder if
Eclipse would want it once I'm finished? In the meantime, I'll publish it
from my own web server.

Thanks for the help all who responded (Larry in particular): it tipped the
balance in my favor.

Russ Bateman
Re: Tomcat with Eclipse (Europa) / JSP [message #209740 is a reply to message #209723] Thu, 06 March 2008 01:32 Go to previous messageGo to next message
Mark Dexter is currently offline Mark Dexter
Messages: 299
Registered: July 2009
Senior Member
Russell Bateman wrote:
> Larry Isaacs wrote:
>
>> This log shows nothing wrong. The warning is new with Tomcat 6.0.16,
>> but normal and may be ignored. I think the disconnect is that 404 is
>> in fact the expected response for "http://localhost:8080/tutorial/",
>> which would display the webapp's welcome file if one had been added.
>> It looks like the tutorial expects you to enter
>> "http://localhost:8080/tutorial/snoop".
>
>> Cheers,
>> Larry
>
> That address (http://localhost:8080/tutorial/snoop) doesn't work either,
> but I know roughly what the problem is now.
>
> At noon, a friend of mine who's done a fair amount of this and I went
> through a simple JSP starting from scratch on Linux (I've duplicated all
> of this trouble on Windows, so it's not a host platform issue). We
> installed the latest JDK 6, Tomcat 6 and Eclipse 3.3 (the J2EE flavor).
> Then, similarly to the tutorial, we set up a JSP (no servlet) and tried
> it out. It worked.
>
> I pointed out to my friend that the tutorial had a radically different
> web.xml (besides the servlet and also because of the existence of the
> servlet) than what Eclipse set up for us when we created a new Dynamic
> Web Project just then. I showed it to him and so we played around a bit
> and got exactly this same problem.
>
> What we found is that if you change the context root of the application
> to something other than its name in Project Explorer, it breaks.
> However, this is a legitimate thing to do. So we kept playing around
> until we found a sequence of steps that, after changing the context
> root, would give us the page using that new root in the address line.
>
> It involves as you already imagine (because you talked around in the
> ballpark in this thread about it) changing a line near the bottom of
> server.xml (because though it set this file up, Eclipse does not
> "maintain" it--it would appear--when changing the context root in
> Eclipse), restarting the server, removing and re-adding the project to
> the server, cleaning and re-publishing the server. Now, it might be that
> one of these doesn't have to be done (specifically the last one), but I
> don't know yet: our experimentation hasn't gone into that detail, but we
> made it work.
>
> I'm going to write my own tutorial on setting this stuff all up from
> scratch all the way through a JSP and servlet so that if anyone out
> there is as dim-witted as I, he or she won't be left to rattle around
> between the eclipse forums, javaranch, etc. looking for the solution. I
> wonder if Eclipse would want it once I'm finished? In the meantime, I'll
> publish it from my own web server.
>
> Thanks for the help all who responded (Larry in particular): it tipped
> the balance in my favor.
>
> Russ Bateman
>
>
>
>
>
>
>
Hi Russ. I've got a web site with (so far) 4 video tutorials for Eclipse
newcomers. If you're looking for a place to put this, that might be one
(eclipsetutorials.sourceforge.net). Also, you could e-mail Wayne Beaton
(wayne@eclipse.org) and see if he might want to list it in the Eclipse
Resources page. The more we can help new people learn from our
experience, the better. Thanks. Mark
Re: Tomcat with Eclipse (Europa) / JSP [message #209787 is a reply to message #209723] Thu, 06 March 2008 13:46 Go to previous message
Larry Isaacs is currently offline Larry Isaacs
Messages: 1305
Registered: July 2009
Senior Member
Russell Bateman wrote:
> Larry Isaacs wrote:
>
>> This log shows nothing wrong. The warning is new with Tomcat 6.0.16,
>> but normal and may be ignored. I think the disconnect is that 404 is
>> in fact the expected response for "http://localhost:8080/tutorial/",
>> which would display the webapp's welcome file if one had been added.
>> It looks like the tutorial expects you to enter
>> "http://localhost:8080/tutorial/snoop".
>
>> Cheers,
>> Larry
>
> That address (http://localhost:8080/tutorial/snoop) doesn't work either,
> but I know roughly what the problem is now.
>
> At noon, a friend of mine who's done a fair amount of this and I went
> through a simple JSP starting from scratch on Linux (I've duplicated all
> of this trouble on Windows, so it's not a host platform issue). We
> installed the latest JDK 6, Tomcat 6 and Eclipse 3.3 (the J2EE flavor).
> Then, similarly to the tutorial, we set up a JSP (no servlet) and tried
> it out. It worked.
>
> I pointed out to my friend that the tutorial had a radically different
> web.xml (besides the servlet and also because of the existence of the
> servlet) than what Eclipse set up for us when we created a new Dynamic
> Web Project just then. I showed it to him and so we played around a bit
> and got exactly this same problem.
>
> What we found is that if you change the context root of the application
> to something other than its name in Project Explorer, it breaks.
> However, this is a legitimate thing to do. So we kept playing around
> until we found a sequence of steps that, after changing the context
> root, would give us the page using that new root in the address line.
>
> It involves as you already imagine (because you talked around in the
> ballpark in this thread about it) changing a line near the bottom of
> server.xml (because though it set this file up, Eclipse does not
> "maintain" it--it would appear--when changing the context root in
> Eclipse), restarting the server, removing and re-adding the project to
> the server, cleaning and re-publishing the server. Now, it might be that
> one of these doesn't have to be done (specifically the last one), but I
> don't know yet: our experimentation hasn't gone into that detail, but we
> made it work.
>
> I'm going to write my own tutorial on setting this stuff all up from
> scratch all the way through a JSP and servlet so that if anyone out
> there is as dim-witted as I, he or she won't be left to rattle around
> between the eclipse forums, javaranch, etc. looking for the solution. I
> wonder if Eclipse would want it once I'm finished? In the meantime, I'll
> publish it from my own web server.
>
> Thanks for the help all who responded (Larry in particular): it tipped
> the balance in my favor.
>
> Russ Bateman
>

Sorry I had forgotten about that issue of changing the context-root. I
think there is already a Bug (whose number I don't remember at the
moment) for the fact that changing the context-root of a project doesn't
notify interested parties so they can react to the change. I haven't
checked lately, so I don't know where that stands in WTP 3.0. Removing
and re-adding the project on the server is the workaround. This will
fix the server.xml under the Servers project. When the server is
published, the fixed server.xml is copied to the location used by Tomcat
when it runs. If Tomcat is already running, you won't see the fix until
Tomcat is restarted so the fixed server.xml will be loaded. I'm glad
you were able to get it working.

Cheers,
Larry
Previous Topic:WTP: Populating WebService Explorer externally while WSDL Publish...
Next Topic:Re: EMF WSDL Xmlschema
Goto Forum:
  


Current Time: Tue Sep 16 17:45:49 GMT 2014

Powered by FUDForum. Page generated in 0.06362 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software