This week's book giveaway is in the Reactive Progamming forum.
We're giving away four copies of Reactive Streams in Java: Concurrency with RxJava, Reactor, and Akka Streams and have Adam Davis on-line!
See this thread for details.
Win a copy of Reactive Streams in Java: Concurrency with RxJava, Reactor, and Akka Streams this week in the Reactive Progamming forum!
  • 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 ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

Tomcat6 help on CentOS VM

Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm having trouble getting a webapp to run on Tomcat6 and through many google searches, asking people around me, and emailing the person who initially set the webapp up I can't find a solution.

After a VM failure I had to transfer everything to a new CentOS VM and get everything set up. When I try to get on http://IP:8080 it returns the old "Error Status 404 - The requested resource () is unavailable" This webapp came in an exploded .WAR file and took the place of tomcat6/webapps/ROOT (I was told it should automatically take me to a login screen). Fiddling around I added the default tomcat index/web.xml to the ROOT just to see if any response would happen and sure enough it worked and it displayed the "If you are seeing this page via a web browser ... Congrats!" page. I went back to the setup that was given to me and restarted tomcat.

# service tomcat6 status
tomcat6 (pid 31989) is running... [ OK ]

Still had the same problems of course when trying to get access through a browser. I checked log4j and got nothing then checked the catalina log:

The person who set the webapp up initially on the old VM said they could come in on a later date and set it up on the new VM (but where is the fun in that?)

Any help would be greatly appreciated!
Posts: 10445
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jack, welcome to the forums!

The first stacktrace that you see in there:

I would ignore that one for the moment since it says it's a WARNING instead of an ERROR.

The second stacktrace:

is more relevant since it says that there's an ERROR deploying the application at ROOT (i.e. your application). The exception itself isn't telling much as to what might have gone wrong, but the stacktrace does have a useful enough hint. Notice the "" in brackets, wherever there's a reference to a Java runtime class in that stacktrace. That's an indication that the server is using the Java runtime which comes packaged as part of the *nix operating systems. This implementation is known to have problems and from what I remember isn't certified.

So you'll need to point JAVA_HOME environment variable to a location which is home to a Java installation which is certified and known to work on that operating system. Typically it's the Sun/Oracle runtime environment which you download and install from the Sun/Oracle site. If you look at the older installation where this was working, then you might figure out which one was in use. Once you have set that environment variable, you will have to restart Tomcat for the changes to take effect.

Saloon Keeper
Posts: 21127
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'd be worried about the webapp itself, however. A URI of "file:./" for the TLDs is a relative URI and not something I'd expect to see used as part of a webapp resource path for stuff like that. So I'd look at the web.xml file and dissect any custom taglib jars that may be in the WEB-INF/lib directories and look for questionable constructs.

Beyond that, as Jakiran has indicated, it has only been relatively recently that the open-source JVM bundled with Red Hat Linux and its relatives has been functional enough to run webapp servers. So it's still safer to use an Oracle JVM at the moment.
Jack Phill
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Jaikiran and Tim you guys are awesome! Sorry for the lateness of my reply I was out of town for the weekend, I was running the usual yum java 1.5 install and it needed 1.6. Installed newer version, restarted Tomcat, and all the SEVERE: ERROR(s) are gone! Now I just have to deal with some springframework errors in the log4j that have come up but this seems to be discussed in other threads.

It will give me the powers of the gods. Not bad for a tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!