Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem migrating from 5.5 to 7.0

 
Anusha Bhatnagar
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I'm not very familiar with Tomcat. I'm trying to migrate my application WAR from Tomcat 5.5.28 to 7.0.28. Tomcat 7 uses Servlet 3.0 while my version was using 2.3. My application compiles fine but it gives a runtime error when servletContext.getContext(contextName) returns null while running on Tomcat 7. I changed my web.xml to use Servelet 3.0 but the problem persists.

Can anyone please explain me what should I do to fix this? I'm not sure if I'm on the right track.

Thanks
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18098
50
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A quick check of the JavaDocs seems to indicate no changes to this method. But I did see a warning about syntax. You do need to include a leading slash on the context path you're looking up - "/app2", and not simply "app2". It's possible that wasn't enforced in Tomcat 5.5.
 
Anusha Bhatnagar
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am looking up using "/contextname" in Tomcat 5.5 as well. Is there anything I'm missing out on?
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18098
50
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could always check the Tomcat management app and ensure that a context named "/contextname" is actually running.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic