views:

45

answers:

3

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"&gt;
<servlet>
    <servlet-name>GroupMaintenance</servlet-name>
    <servlet-class>com.wex.rrt.wrightweb.admin.servlet.GroupMaintenance</servlet-class>
</servlet>

<servlet>
    <servlet-name>ApplicationMaintenance</servlet-name>
    <servlet-class>com.wex.rrt.wrightweb.admin.servlet.ApplicationMaintenance</servlet-class>
</servlet>

<servlet>
    <servlet-name>EmailMaintenance</servlet-name>
    <servlet-class>com.wex.rrt.wrightweb.admin.servlet.EmailMaintenance</servlet-class>
</servlet>

<servlet>
    <servlet-name>FraudDefinitions</servlet-name>
    <servlet-class>com.wex.rrt.wrightweb.admin.servlet.FraudDefinitions</servlet-class>
</servlet>

<servlet>
    <servlet-name>UrlMaintenance</servlet-name>
    <servlet-class>com.wex.rrt.wrightweb.admin.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>wbpr_wrightweb_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>wbpr_wrightweb_write</role-name>
    </auth-constraint>  
</security-constraint> 

<security-role>
    <role-name>wbpr_wrightweb_write</role-name>
</security-role> 

<resource-ref>
    <description>DB Connection</description>
    <res-ref-name>wbOwnerDS</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>wbAppOwnerDS</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>wbpr_wrightweb_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.

A: 

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.

Andriy Sholokh
Yes according to the jmx-console it is started.
Casey
You said that the URL is localhost:8080/WebAdminwhere does index file redirect to?Is redirect destination among servlet mappings you described??
Andriy Sholokh
The welcome-file-list is set to /group_maintenance which is among the URL patterns.
Casey
A: 

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.

Yes the war file is in the correct instance.
Casey
A: 
  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?
Alexander