aspose file tools*
The moose likes Tomcat and the fly likes Upgrading to Tomcat6 problems Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Upgrading to Tomcat6 problems" Watch "Upgrading to Tomcat6 problems" New topic
Author

Upgrading to Tomcat6 problems

Malcolm Warren
Greenhorn

Joined: Mar 22, 2009
Posts: 12
I'm trying to upgrade to Tomcat6 from Tomcat 5.0.30 and it's a little frustrating.

However I've reached a point where I've got one of my four applications (contexts) more or less working.
However I have two problems:

1) I'm getting a message saying "The requested resource (/servlet/WriteToAccessLog) is not available". This message appears within the html on the page, but not in any logs at all, not even in the Apache logs.
Anyone got any idea why this should be happening? It's configured normally in the web.xml file where it's been all these years.

2) All my contexts are currently configured in server.xml, but in Tomcat6 they recommend moving the contexts to a context.xml file and I would rather like to move them to the META-INF folder within the application folder, which seems rather neat to me, right there in the application.
The problem is this, I don't have an application named ROOT; I didn't like the name, so years ago, when I was using Tomcat4 I renamed the ROOT application to 'main-app'.
The problem is that this new way of configuring contexts doesn't seem to envisage the lack of a named ROOT application. Because the path="" parameter, which you can use in the server.xml file is no longer used in the new context.xml files and the path is inferred from the name of the .xml file. I presumably can't name a file just ".xml" (I haven't tried), and in the docs they only seem to envisage a ROOT.xml.
I could of course rename my main-app to ROOT, but that's not going to be neat solution as there are references to 'main-app' about the place and I will have to find them and rename them and so on.
Does anyone know of a solution to the problem?

Thanks for any help.

Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61196
    
  66

Malcolm Warren wrote:IThe problem is that this new way of configuring contexts doesn't seem to envisage the lack of a named ROOT application.

Nonsense. I have no ROOT application and I can configure just fine.

The context XML files are placed in conf/Catalina/localhost/

Change localhost to whatever is appropriate if using virtual hosts.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Malcolm Warren
Greenhorn

Joined: Mar 22, 2009
Posts: 12
Thank you very much for your reply.
I realise that you can also place them in the /conf/Catalina/localhost/ directory, but what I can't work out is what to call the .xml file for the application that has a "" path to the context, because the path is inferred from the name of the file, right?

Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
Looking at the url-pattern you're apparently relying on the InvokerServlet (the /servlet/*) rather than the webapp-specific url-pattern.

Since Tomcat 5.5, the InvokerServlet is by default disabled. Fix your webapp's web.xml accordingly. If in vain, post the appropriate <servlet> and <servlet-mapping> here and we'll guide you.
Malcolm Warren
Greenhorn

Joined: Mar 22, 2009
Posts: 12
Thanks for the reply. Yes, I think I must be invoker servlet dependant.
So actually all I will have to do is to remove '/servlet' from all my URLs right?
Malcolm Warren
Greenhorn

Joined: Mar 22, 2009
Posts: 12
OR could I just add '/servlet' to the servlet names in the web.xml file?
Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
All URL's to that servlet in your whole webapp must match the url-pattern of the servlet in question in the webapp's web.xml.
Malcolm Warren
Greenhorn

Joined: Mar 22, 2009
Posts: 12
Can I do this or similar?

Malcolm Warren
Greenhorn

Joined: Mar 22, 2009
Posts: 12
Ok, the servlet-mapping hack does work, so it will be a solution until I can recode the URLs. Thanks.

However I still have the context.xml problem, I'd be grateful for any help on that.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Upgrading to Tomcat6 problems