好的,试图将一个War部署到JBoss 4.0.4.CR2(我不能升级)并且在启动期间我没有例外,但每当我尝试访问该应用程序时,我得到404.我已经检查每个日志,我没有发现任何例外。
以下是我的web.xml文件:
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.4" 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/web-app_2_4.xsd">
<servlet>
<servlet-name>GroupMaintenance</servlet-name>
<servlet-class>com.example.servlet.GroupMaintenance</servlet-class>
</servlet>
<servlet>
<servlet-name>ApplicationMaintenance</servlet-name>
<servlet-class>com.example.servlet.ApplicationMaintenance</servlet-class>
</servlet>
<servlet>
<servlet-name>EmailMaintenance</servlet-name>
<servlet-class>com.example.servlet.EmailMaintenance</servlet-class>
</servlet>
<servlet>
<servlet-name>FraudDefinitions</servlet-name>
<servlet-class>com.example.servlet.FraudDefinitions</servlet-class>
</servlet>
<servlet>
<servlet-name>UrlMaintenance</servlet-name>
<servlet-class>com.example.servlet.UrlMaintenance</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>EmailMaintenance</servlet-name>
<url-pattern>/email_maintenance</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>FraudDefinitions</servlet-name>
<url-pattern>/fraud_definitions</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>UrlMaintenance</servlet-name>
<url-pattern>/url_maintenance</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>GroupMaintenance</servlet-name>
<url-pattern>/group_maintenance</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>ApplicationMaintenance</servlet-name>
<url-pattern>/application_maintenance</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>
30
</session-timeout>
</session-config>
<welcome-file-list>
<welcome-file>/group_maintenance</welcome-file>
</welcome-file-list>
<login-config>
<auth-method>FORM</auth-method>
<realm-name>Example Form-Based Authentication Area</realm-name>
<form-login-config>
<form-login-page>/jsp/login.jsp</form-login-page>
<form-error-page>/jsp/error.jsp</form-error-page>
</form-login-config>
</login-config>
<security-constraint>
<web-resource-collection>
<web-resource-name>Protected Area</web-resource-name>
<url-pattern>/jsp/*</url-pattern>
<http-method>DELETE</http-method>
<http-method>GET</http-method>
<http-method>POST</http-method>
<http-method>PUT</http-method>
</web-resource-collection>
<auth-constraint>
<role-name>access_write</role-name>
</auth-constraint>
</security-constraint>
<security-constraint>
<web-resource-collection>
<web-resource-name>Protected Area</web-resource-name>
<url-pattern>/WebAdmin</url-pattern>
<http-method>DELETE</http-method>
<http-method>GET</http-method>
<http-method>POST</http-method>
<http-method>PUT</http-method>
</web-resource-collection>
<auth-constraint>
<role-name>access_write</role-name>
</auth-constraint>
</security-constraint>
<security-role>
<role-name>access_write</role-name>
</security-role>
<resource-ref>
<description>DB Connection</description>
<res-ref-name>ownerDS</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
<resource-ref>
<description>DB Connection</description>
<res-ref-name>ownerDS</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
我现在已经玩了大约三个小时,现在无处可去。我已经将其他Web应用程序部署到同一个实例中,没有任何问题。我认为它很小但我没有看到它。
更新:我注释掉了Login配置和安全性约束,我可以访问定义的servlet映射。在其中一个安全约束中,我将受保护区域定义为
security-constraint>
<web-resource-collection>
<web-resource-name>Protected Area</web-resource-name>
<url-pattern>/WebAdmin</url-pattern>
<http-method>DELETE</http-method>
<http-method>GET</http-method>
<http-method>POST</http-method>
<http-method>PUT</http-method>
</web-resource-collection>
<auth-constraint>
<role-name>write</role-name>
</auth-constraint>
我猜这里的东西配置不正确。我没有一个映射到WebAdmin的servlet,但希望安全约束适用于此WebAdmin.war中的所有servlet。
答案 0 :(得分:0)
检查部署后是否启动了应用程序。
我不确切知道这是怎么回事JBoss应用程序服务器,但在Weblogic中,应该在成功部署应用程序后“开始提供请求”。
答案 1 :(得分:0)
只是一个想法...
当你启动jboss服务器时,你确定它已启动你已经部署了战争的实例吗?您可能已将战争部署到错误的服务器实例。
我认为在Jboss 404中启动的默认实例是默认的,因此请确保将战争部署为默认而非生产。 反之亦然,如果要启动的默认实例是生产。
答案 2 :(得分:0)
答案 3 :(得分:0)
您检查过application.xml
文件了吗? application.xml
都应该引用你的jar和war模块。以下是我所说的一个例子:
<application>
<display-name>admin-ear</display-name>
<module>
<ejb>admin-core.jar</ejb>
</module>
<module>
<web>
<web-uri>admin-web.war</web-uri>
<context-root>/admin</context-root>
</web>
</module>
</application>