简体   繁体   English

jboss Web 应用程序正在部署但未找到

[英]jboss web application deploying but not found

Ok, trying to get a War deployed to JBoss 4.0.4.CR2 (no I can't upgrade) and I get no exceptions during startup, but whenever I try to access the application I get a 404. I've checked every log and I don't find any exceptions.好的,尝试将 War 部署到 JBoss 4.0.4.CR2(不,我无法升级)并且在启动过程中没有出现任何异常,但是每当我尝试访问该应用程序时,我都会收到 404。我检查了每个日志我没有发现任何例外。

Below is my web.xml file:下面是我的 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>

I've been playing around with this for about three hours now and am getting nowhere.我已经玩了大约三个小时了,但一无所获。 I've deployed other web applications to the same instance with no problems.我已经将其他 Web 应用程序部署到同一个实例,没有出现任何问题。 I think it's something small but I'm not seeing it.我认为它很小,但我没有看到它。

UPDATE: I commented out the Login configuration and security constraints and I can access the defined servlet mappings.更新:我注释掉了登录配置和安全约束,我可以访问定义的 servlet 映射。 In one of the security constraints, I define a protected area as在安全约束之一中,我将保护区定义为

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>  

I'm guessing that something here is not configured correctly.我猜这里的某些东西没有正确配置。 I dont' have a servlet that maps to WebAdmin, but want the security constraint to apply to all servlets within this WebAdmin.war.我没有映射到 WebAdmin 的 servlet,但希望安全约束应用于此 WebAdmin.war 中的所有 servlet。

Did you check your application.xml file?你检查你的application.xml文件了吗? application.xml should both give reference to your jar and war module. application.xml应该同时引用您的 jar 和 war 模块。 Following is an example of what i am talking about:以下是我正在谈论的一个例子:

<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>

Check if you started application after deployment.检查您是否在部署后启动了应用程序。

I don't know exactly how is this is JBoss application server, but in Weblogic one should "Start serving requests" after successful application deployment.我不知道 JBoss 应用服务器到底是怎么回事,但在 Weblogic 中,应用程序部署成功后应该“开始服务请求”。

Just a thought...只是一个念头...

When you start your jboss server are you sure it is starting the instance you have deployed your war to?当您启动 jboss 服务器时,您确定它正在启动您部署战争的实例吗? You may have deployed your war to the wrong server instance.您可能已将战争部署到错误的服务器实例。

I think the default instance to start in Jboss 404 is default, so make sure that you deployed your war to default and not production.我认为在 Jboss 404 中启动的默认实例是默认的,因此请确保您将战争部署为默认而不是生产。 Or vice versa, if the default instance to start is production.反之亦然,如果要启动的默认实例是生产。

  1. Can you check location of your war?你能检查你的战争的位置吗?
  2. It would be nice to see the log能看到日志就好了
  3. is the process running?进程在运行吗?
  4. Can you rename your war to something else and try again?您可以将您的战争重命名为其他名称并重试吗?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM