• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

Problem migrating from 5.5 to 7.0

 
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
 
Bartender
Posts: 20827
125
Android Eclipse IDE Tomcat Server Redhat Java 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
Bartender
Posts: 20827
125
Android Eclipse IDE Tomcat Server Redhat Java 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
Boost this thread!