This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Tomcat and the fly likes Tomcat manager problems Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Tomcat manager problems" Watch "Tomcat manager problems" New topic
Author

Tomcat manager problems

Jenn Person
Ranch Hand

Joined: Jan 16, 2005
Posts: 89
Hi,

I'm using Tomcat 5.0.28 and I started a webapp that was working without problems. I added a few servlets and JSP pages. Then after restarting Tomcat to allow for a new servlet to work, I got this error:



I went into Tomcat Manager and found my application was stopped. I clicked on Start, but keep getting this message:

FAIL - Application at context path /myapp could not be started

What happened? I can start, stop and restart all the examples that came with Tomcat, but not my own. I'm at a loss for what I can do to make things work again.

Any advice would be great!
Jenn
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

The manager isn't the problem.

Check the Tomcat logs to see what is going wrong with your app at startup.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12769
    
    5
If I was going to bet, I would say the most likely cause is your web.xml is no longer valid and readable. Messages during startup should say something.

Bill
Jenn Person
Ranch Hand

Joined: Jan 16, 2005
Posts: 89
Using Tomcat 5, there are no messages to be seen at any point... so I guess that means I'll look into the logs and see what they tell me.

I'll post them later this evening if I can't make sense of them, along with my web.xml file.

Thanks guys!
Jenn
Jenn Person
Ranch Hand

Joined: Jan 16, 2005
Posts: 89
Ok I've checked the log and I can't see what the problem is.

Here is my current web.xml file



Here is the simple test servlet I wanted to run, which compiles:



If posting a log will help, please let me know.

Jenn
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Originally posted by Jenn Person:
...
If posting a log will help, please let me know.


Yes, do that.

Stop Tomcat,
Delete all the logs in the tomcat/logs directory,
Start tomcat,
If your app doesn't come up, post any logs that aren't empty.

This way, you're not posting tons of irrelevant stuff.
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Here it is:
Jenn Person
Ranch Hand

Joined: Jan 16, 2005
Posts: 89
Oh wow, you're right Ben. I checked the log and it reported an xml error. I kept looking over the web.xml and couldn't see it.

Nice catch, thank you so much! It works now.

Jenn
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12769
    
    5
I never regretted buying a copy of XML Spy years ago - a quick load of web.xml or server.xml after editing gives me confidence that I have not created a hard to find tyop.

Im sure that these days XML validation is built into lots of IDEs...
Bill
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Tomcat manager problems