• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Tomcat 404

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello JavaRanch -

I have an issue using tomcat 7.0.52 on Ubuntu 14.04LTS

I have deployed a web application in my development environment and it runs fine there (sam specs)

I deploy it in my production environment and I get a 404 error

There is a pair of errors in catalina.out which describe how the servlet jars are not valid --- these errors appear in both production and development environments.

No other errors show up in the catalina log on the server.

Any ideas what could be going wrong?

I've read the Servlet faq and didn't find any answers there.

Thanks.
 
Saloon Keeper
Posts: 7582
176
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Post all error messages in full. The one you mentioned is unlikely to point to the problem, though.

Also post the URL you're trying to access, and describe the directory layout. Can you access any URLs in the web app, like the root?
 
Fieran Mason-Blakley
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The answer ---
On my production machine, ROOT was running with JAVA_HOME as oracle java 8 ... so was my user ... however, tomcat was being started as a service --- sudo service tomcat7. The environment of my local user did not translate to sudo without the -E flag --- even then, the environment does not translate to the service.  You either need to edit the startup script as described by Mkyong https://www.mkyong.com/tomcat/find-out-tomcat-is-using-which-jdk-or-java_home/ or, as I did and verified, you need to edit /etc/default/tomcat7 to explicitly set JAVA_HOME for the tomcat7 service. What tipped me off to this was a good tip to use ps -ef | grep tomcat7 to explore the process list to ensure that I knew without a doubt what version of JAVA tomcat was actually running. This is a particular problem with Spring Boot as I understand it. The failure is silent --- not reported in the CATALINA log. Java alternatives won't help as it reflects user configuration --- not tomcat7 service configuration. Perhaps someone  more familiar with unix sys admin can fill in more details here.

Thanks Tim for offering to help.
 
reply
    Bookmark Topic Watch Topic
  • New Topic