views:

32

answers:

2

Hello

I've got a vanilla glassfish v3 install, and dropped my .war in the C:\glassfishv3\glassfish\domains\domain1\autodeploy folder of my Windows PC. The war contains a small web app built with java, JSF, richfaces.

The glassfish server was already started.

The browser comes back with:

The requested resource () is not available.

A bit annoying as this worked fine when I deployed also using ant to tomcat 6. I'm not sure where to start. Any ideas?

My web.xml

<?xml version="1.0"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"&gt;

    <display-name>Client</display-name>

    <context-param>
        <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
        <param-value>server</param-value>
    </context-param>

    <context-param>
        <param-name>org.richfaces.SKIN</param-name>
        <param-value>glassX</param-value>
    </context-param>

    <context-param>
        <param-name>org.richfaces.CONTROL_SKINNING</param-name>
        <param-value>enable</param-value>
    </context-param>

    <context-param>
        <param-name>org.richfaces.CONTROL_SKINNING_CLASSES</param-name>
        <param-value>enable</param-value>
    </context-param>

    <context-param>
        <param-name>org.richfaces.LoadStyleStrategy</param-name>
        <param-value>ALL</param-value>
    </context-param>

    <!-- Added after/for facelets -->
    <context-param>
        <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
        <param-value>.xhtml</param-value>
    </context-param>

    <!-- To prevent the error below -->
    <!--
        WARNING: facelets.RECREATE_VALUE_EXPRESSION_ON_BUILD_BEFORE_RESTORE is
        set to 'true' \
    -->
    <!-- but facelets.BUILD_BEFORE_RESTORE is set to 'false' or unset. \ -->
    <!--
        To use facelets.RECREATE_VALUE_EXPRESSION_ON_BUILD_BEFORE_RESTORE you
        must also \
    -->
    <!-- set facelets.BUILD_BEFORE_RESTORE to 'true'! -->
    <context-param>
        <param-name>facelets.RECREATE_VALUE_EXPRESSION_ON_BUILD_BEFORE_RESTORE</param-name>
        <param-value>false</param-value>
    </context-param>

    <!-- must be the first filter in this file! -->
    <filter>
        <display-name>RichFaces Filter</display-name>
        <filter-name>richfaces</filter-name>
        <filter-class>org.ajax4jsf.Filter</filter-class>
    </filter>

    <filter-mapping>
        <filter-name>richfaces</filter-name>
        <servlet-name>Faces Servlet</servlet-name>
        <dispatcher>REQUEST</dispatcher>
        <dispatcher>FORWARD</dispatcher>
        <dispatcher>INCLUDE</dispatcher>
    </filter-mapping>

    <listener>
        <listener-class>com.sun.faces.config.ConfigureListener</listener-class>
    </listener>

    <!-- Optional JSF-RI Parameters to Help Debug -->
    <context-param>
        <param-name>com.sun.faces.validateXml</param-name>
        <param-value>true</param-value>
    </context-param>

    <!-- Faces Servlet -->
    <servlet>
        <servlet-name>Faces Servlet</servlet-name>
        <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>

    <!-- Faces Servlet Mapping -->
    <servlet-mapping>
        <servlet-name>Faces Servlet</servlet-name>
        <url-pattern>*.jsf</url-pattern>
    </servlet-mapping>

    <error-page>
        <exception-type>java.lang.Throwable</exception-type>
        <location>/error.jsf</location>
    </error-page>

    <login-config>
        <auth-method>BASIC</auth-method>
    </login-config>

    <!-- For saving configs to disk/loading them from -->
    <servlet>
        <servlet-name>File Servlet</servlet-name>
        <servlet-class>Client.FileServlet</servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>File Servlet</servlet-name>
        <url-pattern>/client/temp/*</url-pattern>
    </servlet-mapping>

    <!-- tomcat 6 oracle connection -->
    <resource-ref>
        <description>Oracle Datasource</description>
        <res-ref-name>jdbc/myoracle</res-ref-name>
        <res-type>javax.sql.DataSource</res-type>
        <res-auth>Container</res-auth>
    </resource-ref>
</web-app>

I dont expect this last one will cause a problem - but I dont know where to look to link glassfish in. Do I need to explicitly state the context-root like I would in an enterprise application.xml?

EDIT In response to replies, here is the only thing that is written to the server.log in the logs dir after a server startup which only listed INFO lines - no WARNINGS, or SEVERES. Note I still got a 404:

[#|2010-10-12T10:46:20.193+0100|WARNING|glassfish3.0.1|null|_ThreadID=24;_ThreadName=Thread-1;|Resource not found: com/sun/enterprise/v3/admin/adapter/theme/com/sun/webui/jsf/suntheme/images/masthead/masthead_button_over.gif|#]

This I think is just something in the server which is not in the expected place and nothing to do with my problem.

I put a sun-web.xml file in which has the following content:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sun-web-app PUBLIC '-//Sun Microsystems, Inc.//DTD 
Application Server 9.0 Servlet 2.5//EN' 
'http://www.sun.com/software/appserver/dtds/sun-web-app_2_5-0.dtd'&gt;
<sun-web-app>
<context-root>/Client</context-root>
</sun-web-app>

And it still doesn't work. Because the 404 suggests resource () I suspect there is something it is again expecting to be in one place and has been deployed to another.

EDIT

I find, on deploying to another machine (different platform, same glassfish version), that again the war deploys fine, but the jvm.log barfs this lot:

<dependency_failed type='unique_concrete_method' ctxk='org/apache/log4j/spi/LoggerRepository' x='org/apache/log4j/Hierarchy getLogger (Ljava/lang/String;)Lorg/apache/log4j/Logger;' witness='org/apache/log4j/spi/LoggerRepository' stamp='1717891.656'/>
<dependency_failed type='unique_concrete_method' ctxk='org/apache/log4j/spi/LoggerRepository' x='org/apache/log4j/Hierarchy getLogger (Ljava/lang/String;)Lorg/apache/log4j/Logger;' witness='org/apache/log4j/spi/LoggerRepository' stamp='1717891.656'/>
<dependency_failed type='unique_concrete_method' ctxk='org/apache/log4j/spi/LoggerRepository' x='org/apache/log4j/Hierarchy getLogger (Ljava/lang/String;)Lorg/apache/log4j/Logger;' witness='org/apache/log4j/spi/LoggerRepository' stamp='1717891.656'/>
<dependency_failed type='unique_concrete_method' ctxk='org/apache/log4j/spi/LoggerRepository' x='org/apache/log4j/Hierarchy getLogger (Ljava/lang/String;)Lorg/apache/log4j/Logger;' witness='org/apache/log4j/spi/LoggerRepository' stamp='1717891.656'/>
<dependency_failed type='unique_concrete_method' ctxk='org/apache/log4j/spi/LoggerRepository' x='org/apache/log4j/Hierarchy getLogger (Ljava/lang/String;)Lorg/apache/log4j/Logger;' witness='org/apache/log4j/spi/LoggerRepository' stamp='1717891.656'/>
<dependency_failed type='unique_concrete_method' ctxk='org/apache/log4j/spi/LoggerRepository' x='org/apache/log4j/Hierarchy getLogger (Ljava/lang/String;)Lorg/apache/log4j/Logger;' witness='org/apache/log4j/spi/LoggerRepository' stamp='1717891.656'/>
<dependency_failed type='unique_concrete_method' ctxk='org/apache/log4j/spi/LoggerRepository' x='org/apache/log4j/Hierarchy getLogger (Ljava/lang/String;)Lorg/apache/log4j/Logger;' witness='org/apache/log4j/spi/LoggerRepository' stamp='1717891.656'/>
<dependency_failed type='unique_concrete_method' ctxk='org/apache/log4j/spi/LoggerRepository' x='org/apache/log4j/Hierarchy isDisabled (I)Z' witness='org/apache/log4j/spi/LoggerRepository' stamp='1717891.656'/>
<dependency_failed type='unique_concrete_method' ctxk='org/apache/log4j/spi/LoggerRepository' x='org/apache/log4j/Hierarchy getLogger (Ljava/lang/String;)Lorg/apache/log4j/Logger;' witness='org/apache/log4j/spi/LoggerRepository' stamp='1717891.657'/>
<dependency_failed type='unique_concrete_method' ctxk='org/apache/log4j/spi/LoggerRepository' x='org/apache/log4j/Hierarchy getLogger (Ljava/lang/String;)Lorg/apache/log4j/Logger;' witness='org/apache/log4j/spi/LoggerRepository' stamp='1717891.657'/>
<dependency_failed type='unique_concrete_method' ctxk='org/apache/log4j/spi/LoggerRepository' x='org/apache/log4j/Hierarchy getLogger (Ljava/lang/String;)Lorg/apache/log4j/Logger;' witness='org/apache/log4j/spi/LoggerRepository' stamp='1717891.657'/>
<dependency_failed type='unique_concrete_method' ctxk='org/apache/log4j/spi/LoggerRepository' x='org/apache/log4j/Hierarchy getLogger (Ljava/lang/String;)Lorg/apache/log4j/Logger;' witness='org/apache/log4j/spi/LoggerRepository' stamp='1717891.657'/>
<dependency_failed type='unique_concrete_method' ctxk='org/apache/log4j/spi/LoggerRepository' x='org/apache/log4j/Hierarchy getLogger (Ljava/lang/String;)Lorg/apache/log4j/Logger;' witness='org/apache/log4j/spi/LoggerRepository' stamp='1717891.657'/>
<dependency_failed type='unique_concrete_method' ctxk='org/apache/log4j/spi/LoggerRepository' x='org/apache/log4j/Hierarchy isDisabled (I)Z' witness='org/apache/log4j/spi/LoggerRepository' stamp='1717891.657'/>
<dependency_failed type='unique_concrete_method' ctxk='org/apache/log4j/spi/LoggerRepository' x='org/apache/log4j/Hierarchy getLogger (Ljava/lang/String;)Lorg/apache/log4j/Logger;' witness='org/apache/log4j/spi/LoggerRepository' stamp='1717891.657'/>
<dependency_failed type='unique_concrete_method' ctxk='org/apache/log4j/spi/LoggerRepository' x='org/apache/log4j/Hierarchy getLogger (Ljava/lang/String;)Lorg/apache/log4j/Logger;' witness='org/apache/log4j/spi/LoggerRepository' stamp='1717891.657'/>
<dependency_failed type='leaf_type' ctxk='java/io/File' witness='org/glassfish/deployment/autodeploy/AutoDeployedFilesManager$UndeployRequestedFile' stamp='1717892.374'/>
<dependency_failed type='leaf_type' ctxk='java/io/File' witness='org/glassfish/deployment/autodeploy/AutoDeployedFilesManager$UndeployRequestedFile' stamp='1717892.374'/>
<dependency_failed type='leaf_type' ctxk='java/io/File' witness='org/glassfish/deployment/autodeploy/AutoDeployedFilesManager$UndeployRequestedFile' stamp='1717892.374'/>
<dependency_failed type='leaf_type' ctxk='java/io/File' witness='org/glassfish/deployment/autodeploy/AutoDeployedFilesManager$UndeployRequestedFile' stamp='1717892.374'/>
<dependency_failed type='leaf_type' ctxk='java/io/File' witness='org/glassfish/deployment/autodeploy/AutoDeployedFilesManager$UndeployRequestedFile' stamp='1717892.374'/>
<dependency_failed type='leaf_type' ctxk='java/io/File' witness='org/glassfish/deployment/autodeploy/AutoDeployedFilesManager$UndeployRequestedFile' stamp='1717892.374'/>
<dependency_failed type='leaf_type' ctxk='java/io/File' witness='org/glassfish/deployment/autodeploy/AutoDeployedFilesManager$UndeployRequestedFile' stamp='1717892.374'/>
<dependency_failed type='leaf_type' ctxk='java/io/File' witness='org/glassfish/deployment/autodeploy/AutoDeployedFilesManager$UndeployRequestedFile' stamp='1717892.374'/>
<dependency_failed type='leaf_type' ctxk='java/io/File' witness='org/glassfish/deployment/autodeploy/AutoDeployedFilesManager$UndeployRequestedFile' stamp='1717892.374'/>
<dependency_failed type='leaf_type' ctxk='java/io/File' witness='org/glassfish/deployment/autodeploy/AutoDeployedFilesManager$UndeployRequestedFile' stamp='1717892.374'/>
<dependency_failed type='leaf_type' ctxk='java/io/File' witness='org/glassfish/deployment/autodeploy/AutoDeployedFilesManager$UndeployRequestedFile' stamp='1717892.374'/>
<dependency_failed type='leaf_type' ctxk='java/io/File' witness='org/glassfish/deployment/autodeploy/AutoDeployedFilesManager$UndeployRequestedFile' stamp='1717892.374'/>
<dependency_failed type='leaf_type' ctxk='java/io/File' witness='org/glassfish/deployment/autodeploy/AutoDeployedFilesManager$UndeployRequestedFile' stamp='1717892.374'/>
<dependency_failed type='leaf_type' ctxk='java/io/File' witness='org/glassfish/deployment/autodeploy/AutoDeployedFilesManager$UndeployRequestedFile' stamp='1717892.374'/>
<dependency_failed type='leaf_type' ctxk='java/io/File' witness='org/glassfish/deployment/autodeploy/AutoDeployedFilesManager$UndeployRequestedFile' stamp='1717892.374'/>
<dependency_failed type='leaf_type' ctxk='java/io/File' witness='org/glassfish/deployment/autodeploy/AutoDeployedFilesManager$UndeployRequestedFile' stamp='1717892.374'/>
<dependency_failed type='leaf_type' ctxk='java/io/File' witness='org/glassfish/deployment/autodeploy/AutoDeployedFilesManager$UndeployRequestedFile' stamp='1717892.374'/>
<dependency_failed type='leaf_type' ctxk='java/io/File' witness='org/glassfish/deployment/autodeploy/AutoDeployedFilesManager$UndeployRequestedFile' stamp='1717892.374'/>
<dependency_failed type='leaf_type' ctxk='java/io/File' witness='org/glassfish/deployment/autodeploy/AutoDeployedFilesManager$UndeployRequestedFile' stamp='1717892.374'/>
<dependency_failed type='leaf_type' ctxk='java/io/File' witness='org/glassfish/deployment/autodeploy/AutoDeployedFilesManager$UndeployRequestedFile' stamp='1717892.374'/>
<dependency_failed type='leaf_type' ctxk='java/io/File' witness='org/glassfish/deployment/autodeploy/AutoDeployedFilesManager$UndeployRequestedFile' stamp='1717892.374'/>
<dependency_failed type='leaf_type' ctxk='java/io/File' witness='org/glassfish/deployment/autodeploy/AutoDeployedFilesManager$UndeployRequestedFile' stamp='1717892.374'/>
<dependency_failed type='leaf_type' ctxk='java/io/File' witness='org/glassfish/deployment/autodeploy/AutoDeployedFilesManager$UndeployRequestedFile' stamp='1717892.375'/>
<dependency_failed type='leaf_type' ctxk='java/io/File' witness='org/glassfish/deployment/autodeploy/AutoDeployedFilesManager$UndeployRequestedFile' stamp='1717892.375'/>

Does this help explain what might be wrong?

A: 

Few things that you can cross-check.

  1. First check,if there is any deployment error. Check the logs. Logs will be in SERVER_HOME/domains/domain1/logs
  2. You might have to specify the context root of your application in sun-web.xml
  3. Better go to SERVER_HOME/domains/domain/applications/j2ee-apps/, and check if your war file has been exploded here. If at all the deployment is successful,this is where you war gets exploded.
chedine
Hi - thanks. There is no deployment error. I added a sun-web.xml and redeployed. The Admin console sees both descriptors, but still the same 404. The war has been exploded perfectly. It's well frustrating.
Mark Lewis
A: 

I had been specifying a URL which omitted the welcome filename, which was different to the any in the list of defaults.

In essence, the file I was looking for wasn't asked for.

Mark Lewis