设置 EAR 应用程序的上下文根 (Resin)
我有一个具有以下结构的 EAR 应用程序:
app.ear
|-- app.war
`-- META-INF
`-- application.xml
application.xml
<?xml version="1.0" encoding="UTF-8"?>
<application xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/application_1_4.xsd"
version="1.4">
<display-name>App</display-name>
<description>Application</description>
<module>
<web>
<web-uri>app.war</web-uri>
<context-root>/path</context-root>
</web>
</module>
</application>
Resin 具有默认配置。我希望 http://localhost:3333/path/service
应该是 app.war,但是每个请求都会返回以下内容:
<html>
<head>
<title>404 Not Found</title>
</head>
<body>
<h1>404 Not Found</h1>
/path/service was not found on this server.
<p/>
<hr/>
<small>Resin/3.1.9</small>
</body>
</html>
如果我仅将应用程序作为 WAR 文件放置,Resin 会加载它并且它适用于 /app/service
。问题出在哪里?配置对我来说似乎是正确的。
编辑:树脂的日志
[10:38:57.799] {main} WebApp[http://localhost:3333] active
[10:38:58.018] {main} WebApp[http://localhost:3333/resin-admin] active
[10:38:58.059] {main} WebApp[http://localhost:3333/app.ear] active
[10:39:00.323] {main} WebApp[http://localhost:3333/resin-doc] active
I have a EAR application with following structure:
app.ear
|-- app.war
`-- META-INF
`-- application.xml
application.xml
<?xml version="1.0" encoding="UTF-8"?>
<application xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/application_1_4.xsd"
version="1.4">
<display-name>App</display-name>
<description>Application</description>
<module>
<web>
<web-uri>app.war</web-uri>
<context-root>/path</context-root>
</web>
</module>
</application>
Resin has default configuration. I would expect that http://localhost:3333/path/service
should be the app.war, but every request returns this:
<html>
<head>
<title>404 Not Found</title>
</head>
<body>
<h1>404 Not Found</h1>
/path/service was not found on this server.
<p/>
<hr/>
<small>Resin/3.1.9</small>
</body>
</html>
If I put the application only as WAR file, Resin loads it and it works on /app/service
. Where is the problem? The configuration seems correct to me.
EDIT: Resin's log
[10:38:57.799] {main} WebApp[http://localhost:3333] active
[10:38:58.018] {main} WebApp[http://localhost:3333/resin-admin] active
[10:38:58.059] {main} WebApp[http://localhost:3333/app.ear] active
[10:39:00.323] {main} WebApp[http://localhost:3333/resin-doc] active
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
application.xml 应该属于耳朵内的文件夹“META-INF”,而不是您示例中的“WEB-INF”。
The application.xml should belong in a folder "META-INF" inside the ear, not "WEB-INF" as in your example.