简体   繁体   中英

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.

Below is my web.xml file:

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

Did you check your application.xml file? application.xml should both give reference to your jar and war module. 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.

Just a thought...

When you start your jboss server are you sure it is starting the instance you have deployed your war to? 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. 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?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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