Home » Language IDEs » ServerTools (WTP) » Tomcat 404 Resource not found(Tomcat and Eclipse)
Tomcat 404 Resource not found [message #502857] |
Wed, 09 December 2009 19:39  |
Eclipse User |
|
|
|
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 #503069 is a reply to message #502857] |
Thu, 10 December 2009 13:40   |
Eclipse User |
|
|
|
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 09:46   |
Eclipse User |
|
|
|
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 #654306 is a reply to message #654251] |
Mon, 14 February 2011 21:04   |
Eclipse User |
|
|
|
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 09:08   |
Eclipse User |
|
|
|
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] |
Tue, 15 February 2011 19:41  |
Eclipse User |
|
|
|
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
|
|
|
Goto Forum:
Current Time: Fri Jul 04 19:31:49 EDT 2025
Powered by FUDForum. Page generated in 0.07930 seconds
|