开发者

Specifying the location of WEB-INF for a legacy Tomcat application

I am attempting to build a test setup for a legacy Apache/Tomcat application. To be honest, I am not sure if it is an 'application.' It is a collection of JSPs that happen to be in a certain directory.

The jsps are being displayed properly. The problem is that the classes folder in the WEB-INF folder isn't being found - I'm getting NoClassDefFoundError exceptions.

To complicate things, there are two 'apps' and they share a WEB-INF:

4 drwxr-xr-x    8 root     root         4096 Dec  2 09:38 thing1
4 drwxr-xr-x    8 root     root         8192 Dec  2 09:38 thing2
4 drwxr-xr-x    8 root     root         4096 Dec  2 09:38 WEB-INF

So in this sanitized-for-your-sanity example, we see the two 'applications' and the shared WEB-INF folder.

One URL that works is http://mysite/thing1/index.jsp When we try to log in from that page, however, we get the NoClassDef error.

Here's the relevant part of the server.xml file. So the actual path of the index.jsp file mentioned previously is tony/ROOT/thing1/index.jsp

  <Host name="tony.com" appBase="tony/ROOT">
      <Alias>111.111.111.111</Alias>
      <Context path="" docBase="" debug="0" reloadable="true" crossContext="true" />
  </Host>

My question is, how do I have to configure Tomcat so thing1 & 2 use WEB-INF for their lib and class folders? These 'apps' aren't being d开发者_StackOverflow中文版eployed as war files...

(note - making a copy of the production box would be difficult - there's a lot of stuff running there. I am attempting to pare it down to make a test environment for a few apps.)


A web application must have the following structure:

tomcat/webapps/appname
tomcat/webapps/appname/*.jsp
tomcat/webapps/appname/WEB-INF
tomcat/webapps/appname/WEB-INF/lib
tomcat/webapps/appname/WEB-INF/classes

So that way it should work, without any additional xml configurations

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜