wood burning stoves
The moose likes Tomcat and the fly likes Tomcat Webapp launch error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Products » Tomcat
Bookmark "Tomcat Webapp launch error" Watch "Tomcat Webapp launch error" New topic

Tomcat Webapp launch error

Jeffrey Foster

Joined: Apr 12, 2012
Posts: 13
I'm trying to launch an Eclipse help webapp called help.war, which was assembled by someone I'm working with (remotely, in a different country) by modifying one we found online. It works on his Tomcat server. When he deploys help.war, I can go to the ...com/help/index.jsp address and see my Infocenter. If I take the same help.war archive and place it into my local installation of apache_tomcat, it will deploy, but I never see anything at http://localhost:8080/help/index.jsp, where it should be. I can reach the Apache Tomcat manager and launch the built-in apps, like examples and so on, and I see "help" deployed, but nothing appears when I launch it, only "servlet error, help not found". I've never been able to launch any .war file on my local installation, whether created by me or him.

The error message I see in the catalina.out log is this:

The network guy I'm working with said that when he created the help.war archive, there was a problem with certain of the Eclipse plugins being the wrong version, for example org.eclipse.help.base 3.6 instead of 3.5 and so on. He got the versions that the help.war setup wanted, and after that it worked -- on his machine. And as I say I can log in and it works for me also.

This however looks different-- or is it? And if the help.war works on his installation, doesn't that mean that help.war is internally consistent-- in which case why does this error on my installation look like something is the wrong version? Does that mean that something in my Apache Tomcat installation is trying to match this webapp_3.5.2.r36.etc plugin, rather than something inside the help.war archive?

And mainly, of course: How do I fix it? I'm not actually sure what that error message is telling me, for one thing.

A twist on the whole thing: If I also put his "work" directory from his Tomcat installation into mine, replacing my "work" directory-- then it all works. It appears at http://localhost:8080/help/index.jsp, which is partly why I know that's the correct address. However I need to be able to edit and update the help.war archive, and I can't launch help after I make any changes in the help.war file. After I try, and it fails each time, the only thing that works is if I replace both the help.war and the "work" directory with his. I need to be able to make changes to the help.war file myself however, and deploy and launch with those included so I can test the changes. I also tried just downloading his entire Tomcat installation since I know it works, but I can't get it to even start locally. I've got mine successfully installed at least.

I hope that's clear, I'm fairly new to all this, at least doing it this way. If you have any advice please make it as detailed and newbie-simple as possible.

Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17038

Welcome to the JavaRanch, Jeffrey!

My best guess is that he's doing all his testing in Eclipse and his IDE environment has become a silent partner in the WAR. That's one of the reasons why I make a policy of building all my production and Beta deployments (which are actually the same WAR) from the command line.

There seems to be a dependency on an OSGi component in the WAR. Whether this is valid or not depends on whether the WAR intentionally works with OSGi, or whether it was a case of accidentally hooking in a part of Eclipse to the WAR.

Evidently, the missing OSGi component is actually only needed to compile the JSP and not to run it, since the Tomcat Work directory contains the Java code that's generated from JSPs and the class code that's generated from that Java code.

Ideally, you should have the developer set up and test the webapp from a stand-alone Tomcat (no IDE running) before shipping the WAR to you. That way, the OSGi dependency will either have to have been removed or properly defined in the build process (whichever is applicable).

An IDE is no substitute for an Intelligent Developer.
Jeffrey Foster

Joined: Apr 12, 2012
Posts: 13
Thanks for the welcome and the response Tim,

I finally got it to work here by correctly inserting the bundle it wanted. Then my only concern was whether it would work on his, but I just uploaded and it works there also.

I actually know that he's assembling the .war the same way I am, we found a model/template .war archive on a blog online and just inserted the Eclipse standalone help plugin that I generated using Oxygen XML Editor. Then he found some dependency problems in the Tomcat log and changed the plugins out, and then it worked. (Worked on his, not on mine.) Specifically:


He changed to:

Now, I changed this one to:

He's also running it on a stand-alone Tomcat installation. We were both launching the Eclipse standalone help at first from the Eclipse IDE -- actually just from the command line, i.e. not starting up the Eclipse UI -- but both switched over to standalone Tomcat when we put it into a .war archive.

It remains a mystery to me but as long as it works now, if it ain't broke don't fix it, as they say.

I like your insight about how it would run, but not compile, with that dependency error, that's a good way of putting it and helps me understand what was happening, which might come in handy later.

One little tip that I think I've seen mentioned elsewhere on this forum: I found that deleting both the exploded "tomcat/webapps/help" directory (from "help.war") and the entire "tomcat/work" directory were necessary to be sure I was seeing the latest one when launched. Just dropping in a new "help.war" and restarting Tomcat wasn't enough.

Thanks again,
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17038

It's a pet peeve of mine that exploded WARs take precedence over "real" WARs, even when the WAR file is newer. My production and Beta redeploys always delete both WARs, also the work and temp directory subtrees relating to the app being redeployed. Only then can I safely assume that I have a true self-contained app and not a false sense of security coming from old stuff that's not actually part of the deployed components.

OSGi is a little trickier than most frameworks because it's so dynamic.
Jeffrey Foster

Joined: Apr 12, 2012
Posts: 13

Here's something else I'm now stuck with, trying to get the title of my Infocenter to have something in it, that is, the name that appears on the browser tab. It's my "product name" apparently that it wants, but I can't seem to get one there.

I've learned how to tweak the preferences.ini file so that it doesn't print "Help - <product name>", which on mine only output "Help - " because it's not getting the product name. So now it just defaults to "localhost:8080 etc" as the title and prints that on the tab.

After reading everything I can find, I have this:

My plugin.xml file, at this location inside a com.abc.abc.war file :


(that's with the .war exploded of course, before I war it up again)

and plugin.xml contains this:

The <!-- Name appears... > comment came with the sample I got.

I also have a config.ini file, in the .war file at this location:


and it looks like this now:

I have the feeling I'm missing parts of this, but most of the info I find pertains to using the Eclipse IDE, rather than standalone help, just editing files yourself.

I've managed to customize all of the other things I wanted: top banner, landing splash page, and so on by just inserting html files, images, and css stylesheets directly into the help.base and help.webapp jar files inside my war. I can just insert different ones for different war files I create for each infocenter. So I'm not using a "customization.ini" file in my plugin -- do I need to? The title bar is really the last thing I need to get, everything else works the way it is now.

I've seen variations in advice in which "name" and "productName" are used interchangeably, or that it should be "elcipse.product=abc.abc.abc.helpProduct" instead of just "eclipse.product=abc.abc.abc" All pretty confusing and I've tried all combinations.

The HTML page that's being generated contains an empty <title></title> tag, which is clearly where the product name needs to go.

Thanks-- I can post this as a new topic but since you seemed to understand this specific subject I thought I'd try you first.


Jeffrey Foster

Joined: Apr 12, 2012
Posts: 13
I just realized that I had <product in the wrong place in that plugin.

I put it where it looked like it should be, but then the plugin wouldn't appear in the Infocenter at all.

I had to comment out that whole extension before it would work like before.

So I'm back to this: if I keep config.ini with only the default in it:


and the same with the plugin:

<?xml version="1.0" encoding="utf-8"?>
<plugin id="org.abc.abc.abc" name="ABC Guide">
<extension point="org.eclipse.help.toc">
<toc file="ABC_Guide.xml" primary="true"/>
<extension point="org.eclipse.help.index">
<index file="index.xml"/>

Then at least the plugin appears in the Infocenter, and all my modifications are there. Just not the title in the browser tab.


Have you checked out Aspose?
subject: Tomcat Webapp launch error
It's not a secret anymore!