指定旧 Tomcat 应用程序的 WEB-INF 位置
我正在尝试为旧版 Apache/Tomcat 应用程序构建测试设置。老实说,我不确定这是否是一个“应用程序”。它是恰好位于某个目录中的 JSP 的集合。
jsp 已正确显示。问题是未找到 WEB-INF 文件夹中的类文件夹 - 我收到 NoClassDefFoundError 异常。
让事情变得复杂的是,有两个“应用程序”并且它们共享一个 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
因此,在这个为您的理智进行清理的示例中,我们看到两个“应用程序”和共享的 WEB-INF文件夹。
一个有效的 URL 是 http://mysite/thing1/index.jsp 但是,当我们尝试从该页面登录时,我们会收到 NoClassDef 错误。
这是 server.xml 文件的相关部分。所以前面提到的index.jsp文件的实际路径是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>
我的问题是,我该如何配置Tomcat,使thing1 & 2 使用 WEB-INF 作为他们的 lib 和 class 文件夹?这些“应用程序”没有被部署为战争文件......
(注意 - 制作生产框的副本会很困难 - 那里运行着很多东西。我正在尝试将其削减以创建一个测试环境一些应用程序。)
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 deployed 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.)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Web 应用程序必须具有以下结构:
这样它就可以工作,无需任何额外的 xml 配置
A web application must have the following structure:
So that way it should work, without any additional xml configurations