Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » ServerTools (WTP) » Tomcat 404 Resource not found(Tomcat and Eclipse)
Tomcat 404 Resource not found [message #502857] Thu, 10 December 2009 00:39 Go to next message
designing woman is currently offline designing womanFriend
Messages: 10
Registered: December 2009
Junior Member
Hi,

I have been using Eclipse with ZK and have created a couple of successful projects. However, one of my projects is now broken.
Whenever I try to run it under Tomcat, I get a 404. Resource is not available.

It is similar to this error logged in 2006!
http://dev.eclipse.org/newslists/news.eclipse.webtools/msg10 106.html

I've looked at the configuration screen of Eclipse. There are NO catalina.home or cataline.base entries in the config:
*** System properties:
J2EEcache=
awt.toolkit=sun.awt.windows.WToolkit
eclipse.application=org.eclipse.ui.ide.workbench
eclipse.buildId=I20090611-1540
eclipse.commands=-os
win32
-ws
win32
.............................
I've tried setting the two as VM arguments in the Edit configuration panel. They are changed back to what they were after I try and apply changes. And they never show up in the config.

So my questions:
How can I set these variables? What are some example settings for them?
And will that solve the 404 error I have?????


Re: Tomcat 404 Resource not found [message #502979 is a reply to message #502857] Thu, 10 December 2009 14:13 Go to previous messageGo to next message
Larry Isaacs is currently offline Larry IsaacsFriend
Messages: 1354
Registered: July 2009
Senior Member
designing woman wrote:
> Hi,
>
> I have been using Eclipse with ZK and have created a couple of
> successful projects. However, one of my projects is now broken.
> Whenever I try to run it under Tomcat, I get a 404. Resource is not
> available.
>
> It is similar to this error logged in 2006!
> http://dev.eclipse.org/newslists/news.eclipse.webtools/msg10 106.html
>
> I've looked at the configuration screen of Eclipse. There are NO
> catalina.home or cataline.base entries in the config:
> *** System properties:
> J2EEcache=
> awt.toolkit=sun.awt.windows.WToolkit
> eclipse.application=org.eclipse.ui.ide.workbench
> eclipse.buildId=I20090611-1540
> eclipse.commands=-os
> win32
> -ws
> win32
> ............................
> I've tried setting the two as VM arguments in the Edit configuration
> panel. They are changed back to what they were after I try and apply
> changes. And they never show up in the config.
>
> So my questions:
> How can I set these variables? What are some example settings for them?
> And will that solve the 404 error I have?????
>
>
>

See the Tomcat FAQ (http://wiki.eclipse.org/WTP_Tomcat_FAQ) for
information about the Tomcat support in WTP. For security reasons, 404
errors are often the "generic" error that occurs when something goes
wrong with a request. You might start with checking the Console view
for the server to see if any problems are reported there.

Cheers,
Larry
Re: Tomcat 404 Resource not found [message #503069 is a reply to message #502857] Thu, 10 December 2009 18:40 Go to previous messageGo to next message
designing woman is currently offline designing womanFriend
Messages: 10
Registered: December 2009
Junior Member
Larry,

Thank you for the response. I was hoping I would hear from you as I have seen many of your insightful posts.

I fixed it. The root cause was XML related. And since ZK and Eclipse have done ALL my xml file updates, one of them caused the problem, IMHO.

However, the debugging was made very difficult, because the 404 is a generic error. It masks the real problem. I did not have the admin or manager part of tomcat installed, because it is no longer loaded by default. THAT is ridiculous - and just causes more work.

I noticed the following:
1) Eclipse does not allow me to change the server location and "take control". These options were gray. The link to launch configuration and VM arguments screen are there, but did not seem to actually update the variables.

2) The way Eclipse worked with the install of Tomcat did not allow manager access i.e. http://localhost:8080/manager
It should. I had to fix that manually.

3. The xml files that are used in Eclipse, Tomcat, and ZK are highly problematic. There are a lot of variables that are set, and it is confusing who is setting what. Some documentation of what is "normal" would be useful.

4. I am not sure whether ZK or Eclipse caused the XML problem. I just know I didn't.

My solution from now on is to use a small project for testing. Then I will gradually migrate what works to a tested project. That way, if one file causes a problem in one project, it won't destroy the larger work.

Re: Tomcat 404 Resource not found [message #503083 is a reply to message #503069] Thu, 10 December 2009 14:46 Go to previous messageGo to next message
Larry Isaacs is currently offline Larry IsaacsFriend
Messages: 1354
Registered: July 2009
Senior Member
designing woman wrote:
> Larry,
>
> Thank you for the response. I was hoping I would hear from you as I have
> seen many of your insightful posts.
> I fixed it. The root cause was XML related. And since ZK and Eclipse
> have done ALL my xml file updates, one of them caused the problem, IMHO.
> However, the debugging was made very difficult, because the 404 is a
> generic error. It masks the real problem.

I know the Tomcat philosophy is that error details should appear in a
log and not disclosed to the client for security reasons. I don't know
if clues should have appeared in the Console view.

> I did not have the admin or
> manager part of tomcat installed, because it is no longer loaded by
> default. THAT is ridiculous - and just causes more work.
> I noticed the following: 1) Eclipse does not allow me to change the
> server location and "take control". These options were gray.

Switching the location with added projects wasn't practical to support.
This is what the text immediately under the "Server Locations" section
is trying to say. You have to remove all projects from the server,
publish the server so the projects are actually removed, then the
ability to change the location will be enabled. After changing the
location, re-add the projects.

> The link
> to launch configuration and VM arguments screen are there, but did not
> seem to actually update the variables.

You can add VM arguments, but the ones there by default are "owned" by
the WTP Tomcat support and get regenerated from the server configuration
on each launch.

> 2) The way Eclipse worked with the install of Tomcat did not allow
> manager access i.e. http://localhost:8080/manager It should. I had to
> fix that manually.

I assume switching the location would address this issue.

>
> 3. The xml files that are used in Eclipse, Tomcat, and ZK are highly
> problematic. There are a lot of variables that are set, and it is
> confusing who is setting what. Some documentation of what is "normal"
> would be useful.

What we have for WTP is in the Tomcat FAQ. I'm not at all familiar with
ZK to say how that impacts things.

>
> 4. I am not sure whether ZK or Eclipse caused the XML problem. I just
> know I didn't.
> My solution from now on is to use a small project for testing. Then I
> will gradually migrate what works to a tested project. That way, if one
> file causes a problem in one project, it won't destroy the larger work.
>

I would hope some improved logging would provide better information when
a problem occurs. However, there are number of ways to add logging to
Tomcat, i.e. one log for all of Tomcat, independent logging per content,
etc. Because of the complexity of addressing this across the various
Tomcat versions, there isn't any special logging configuration provided
by default. The benefit of this is that any logging you may have
enabled in your webapp won't be interfered with. As far as what might
help, it's hard to speculate beyond this without knowing more about the
nature of the problem.

Cheers,
Larry
Re: Tomcat 404 Resource not found [message #653963 is a reply to message #503069] Sat, 12 February 2011 04:38 Go to previous messageGo to next message
yoichi takayama is currently offline yoichi takayamaFriend
Messages: 3
Registered: February 2011
Junior Member
Hi

I am having the same problem with Tomcat 6.0.30 and Eclipse Helios.

http://localhost:8080/manager (or even the default page http://localhost:8080/ although I have not disabled it) cannot be found, but only if I start the server from Eclipse. It works perfectly normal if I start the Tomcat normally.

The webapps has the /ROOT and /manager directories. I wonder whether this is because the Eclipse is limiting the access only to an Web application I am running on it.

You mention that you manually "fixed" it. I am curious how you did it. Can you let me know?

Thanks.
Yoichi
Re: Tomcat 404 Resource not found [message #654251 is a reply to message #653963] Mon, 14 February 2011 17:46 Go to previous messageGo to next message
Larry Isaacs is currently offline Larry IsaacsFriend
Messages: 1354
Registered: July 2009
Senior Member
On 2/11/2011 11:38 PM, yoichi takayama wrote:
> Hi
>
> I am having the same problem with Tomcat 6.0.30 and Eclipse Helios.
>
> http://localhost:8080/manager (or even the default page
> http://localhost:8080/ although I have not disabled it) cannot be found,
> but only if I start the server from Eclipse. It works perfectly normal
> if I start the Tomcat normally.
>
> The webapps has the /ROOT and /manager directories. I wonder whether
> this is because the Eclipse is limiting the access only to an Web
> application I am running on it.
>
> You mention that you manually "fixed" it. I am curious how you did it.
> Can you let me know?
>
> Thanks.
> Yoichi
>

See the WTP Tomcat FAQ[1], especially question 4.5.

Cheers,
Larry

[1] http://wiki.eclipse.org/WTP_Tomcat_FAQ
Re: Tomcat 404 Resource not found [message #654306 is a reply to message #654251] Tue, 15 February 2011 02:04 Go to previous messageGo to next message
yoichi takayama is currently offline yoichi takayamaFriend
Messages: 3
Registered: February 2011
Junior Member
That answers the question superbly by explaining that it is because Eclipse makes another copy of Tomcat by using the CATALINA_BASE mechanism and runs it. The concept is very familiar with Tomcat regular users. Although in this copy, ROOT, manager, etc. are all disabled.

It also answers how to change this behaviour to rather use the copy at the CATALINA_HOME, if it is desired.

However, more often than not, we need to change server.xml, etc. and the location of this CATALINA_BASE is important, since it was critical to realise to modify these in the CATALINA_BASE, not CATALINA_HOME.

Some other article showed me that this information can be found as follows:

1. Go to Java Perspective
2. Go to services View
3. Double-click the Tomcat instance
4. Click on Open launch configuration
5. Select Arguments tab
6. VM arguments column shows -Dcatalina.base="...."

That is the value of the CATALINA_BASE.

Thanks,
Yoichi
Re: Tomcat 404 Resource not found [message #654389 is a reply to message #654306] Tue, 15 February 2011 14:08 Go to previous messageGo to next message
Larry Isaacs is currently offline Larry IsaacsFriend
Messages: 1354
Registered: July 2009
Senior Member
On 2/14/2011 9:04 PM, yoichi takayama wrote:
> That answers the question superbly by explaining that it is because
> Eclipse makes another copy of Tomcat by using the CATALINA_BASE
> mechanism and runs it. The concept is very familiar with Tomcat regular
> users. Although in this copy, ROOT, manager, etc. are all disabled.
>
> It also answers how to change this behaviour to rather use the copy at
> the CATALINA_HOME, if it is desired.
>
> However, more often than not, we need to change server.xml, etc. and the
> location of this CATALINA_BASE is important, since it was critical to
> realise to modify these in the CATALINA_BASE, not CATALINA_HOME.
>
> Some other article showed me that this information can be found as follows:
>
> 1. Go to Java Perspective
> 2. Go to services View
> 3. Double-click the Tomcat instance
> 4. Click on Open launch configuration
> 5. Select Arguments tab
> 6. VM arguments column shows -Dcatalina.base="...."
>
> That is the value of the CATALINA_BASE.
>
> Thanks,
> Yoichi

If you are going to change server.xml, it's the one under the Servers
project in your workspace you would want to change if you want the
change to persist. That one is the "master" copy. The one under
CATALINA_BASE will get overwritten whenever the Tomcat server is published.

Cheers,
Larry
Re: Tomcat 404 Resource not found [message #654486 is a reply to message #654389] Wed, 16 February 2011 00:41 Go to previous message
yoichi takayama is currently offline yoichi takayamaFriend
Messages: 3
Registered: February 2011
Junior Member
Indeed! That is a much better way!!!

I knew that .matadata location would be overwritten every time a server is published, but I forgot about Servers on the Project View and did not realise that it keeps the master configuration files there.

Thanks!
Yoichi
Previous Topic:Where can I get org.eclipse.wst.jsdt.debug.crossfire?
Next Topic:Java EE Modules Dependencies.
Goto Forum:
  


Current Time: Thu Apr 25 23:21:31 GMT 2024

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

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

Back to the top