• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Upgrading to Tomcat6 problems

 
Malcolm Warren
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64620
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Malcolm Warren
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OR could I just add '/servlet' to the servlet names in the web.xml file?
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can I do this or similar?

 
Malcolm Warren
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic