title: glassfish autodeploy gives 404 with simple app
body: <p>I've got a vanilla glassfish v3 install, and dropped my .war in the <code>C:\glassfishv3\glassfish\domains\domain1\autodeploy</code> folder of my Windows PC.  The war contains a small web app built with java, JSF, richfaces.</p>
  
  <p>The glassfish server was already started.</p>
  
  <p>The browser comes back with:</p>
  
  <pre><code>The requested resource () is not available.
  </code></pre>
  
  <p>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?</p>
  
  <p>My web.xml </p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;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;
  
      &lt;display-name&gt;Client&lt;/display-name&gt;
  
      &lt;context-param&gt;
          &lt;param-name&gt;javax.faces.STATE_SAVING_METHOD&lt;/param-name&gt;
          &lt;param-value&gt;server&lt;/param-value&gt;
      &lt;/context-param&gt;
  
      &lt;context-param&gt;
          &lt;param-name&gt;org.richfaces.SKIN&lt;/param-name&gt;
          &lt;param-value&gt;glassX&lt;/param-value&gt;
      &lt;/context-param&gt;
  
      &lt;context-param&gt;
          &lt;param-name&gt;org.richfaces.CONTROL_SKINNING&lt;/param-name&gt;
          &lt;param-value&gt;enable&lt;/param-value&gt;
      &lt;/context-param&gt;
  
      &lt;context-param&gt;
          &lt;param-name&gt;org.richfaces.CONTROL_SKINNING_CLASSES&lt;/param-name&gt;
          &lt;param-value&gt;enable&lt;/param-value&gt;
      &lt;/context-param&gt;
  
      &lt;context-param&gt;
          &lt;param-name&gt;org.richfaces.LoadStyleStrategy&lt;/param-name&gt;
          &lt;param-value&gt;ALL&lt;/param-value&gt;
      &lt;/context-param&gt;
  
      &lt;!-- Added after/for facelets --&gt;
      &lt;context-param&gt;
          &lt;param-name&gt;javax.faces.DEFAULT_SUFFIX&lt;/param-name&gt;
          &lt;param-value&gt;.xhtml&lt;/param-value&gt;
      &lt;/context-param&gt;
  
      &lt;!-- To prevent the error below --&gt;
      &lt;!--
          WARNING: facelets.RECREATE_VALUE_EXPRESSION_ON_BUILD_BEFORE_RESTORE is
          set to 'true' \
      --&gt;
      &lt;!-- but facelets.BUILD_BEFORE_RESTORE is set to 'false' or unset. \ --&gt;
      &lt;!--
          To use facelets.RECREATE_VALUE_EXPRESSION_ON_BUILD_BEFORE_RESTORE you
          must also \
      --&gt;
      &lt;!-- set facelets.BUILD_BEFORE_RESTORE to 'true'! --&gt;
      &lt;context-param&gt;
          &lt;param-name&gt;facelets.RECREATE_VALUE_EXPRESSION_ON_BUILD_BEFORE_RESTORE&lt;/param-name&gt;
          &lt;param-value&gt;false&lt;/param-value&gt;
      &lt;/context-param&gt;
  
      &lt;!-- must be the first filter in this file! --&gt;
      &lt;filter&gt;
          &lt;display-name&gt;RichFaces Filter&lt;/display-name&gt;
          &lt;filter-name&gt;richfaces&lt;/filter-name&gt;
          &lt;filter-class&gt;org.ajax4jsf.Filter&lt;/filter-class&gt;
      &lt;/filter&gt;
  
      &lt;filter-mapping&gt;
          &lt;filter-name&gt;richfaces&lt;/filter-name&gt;
          &lt;servlet-name&gt;Faces Servlet&lt;/servlet-name&gt;
          &lt;dispatcher&gt;REQUEST&lt;/dispatcher&gt;
          &lt;dispatcher&gt;FORWARD&lt;/dispatcher&gt;
          &lt;dispatcher&gt;INCLUDE&lt;/dispatcher&gt;
      &lt;/filter-mapping&gt;
  
      &lt;listener&gt;
          &lt;listener-class&gt;com.sun.faces.config.ConfigureListener&lt;/listener-class&gt;
      &lt;/listener&gt;
  
      &lt;!-- Optional JSF-RI Parameters to Help Debug --&gt;
      &lt;context-param&gt;
          &lt;param-name&gt;com.sun.faces.validateXml&lt;/param-name&gt;
          &lt;param-value&gt;true&lt;/param-value&gt;
      &lt;/context-param&gt;
  
      &lt;!-- Faces Servlet --&gt;
      &lt;servlet&gt;
          &lt;servlet-name&gt;Faces Servlet&lt;/servlet-name&gt;
          &lt;servlet-class&gt;javax.faces.webapp.FacesServlet&lt;/servlet-class&gt;
          &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
      &lt;/servlet&gt;
  
      &lt;!-- Faces Servlet Mapping --&gt;
      &lt;servlet-mapping&gt;
          &lt;servlet-name&gt;Faces Servlet&lt;/servlet-name&gt;
          &lt;url-pattern&gt;*.jsf&lt;/url-pattern&gt;
      &lt;/servlet-mapping&gt;
  
      &lt;error-page&gt;
          &lt;exception-type&gt;java.lang.Throwable&lt;/exception-type&gt;
          &lt;location&gt;/error.jsf&lt;/location&gt;
      &lt;/error-page&gt;
  
      &lt;login-config&gt;
          &lt;auth-method&gt;BASIC&lt;/auth-method&gt;
      &lt;/login-config&gt;
  
      &lt;!-- For saving configs to disk/loading them from --&gt;
      &lt;servlet&gt;
          &lt;servlet-name&gt;File Servlet&lt;/servlet-name&gt;
          &lt;servlet-class&gt;Client.FileServlet&lt;/servlet-class&gt;
      &lt;/servlet&gt;
      &lt;servlet-mapping&gt;
          &lt;servlet-name&gt;File Servlet&lt;/servlet-name&gt;
          &lt;url-pattern&gt;/client/temp/*&lt;/url-pattern&gt;
      &lt;/servlet-mapping&gt;
  
      &lt;!-- tomcat 6 oracle connection --&gt;
      &lt;resource-ref&gt;
          &lt;description&gt;Oracle Datasource&lt;/description&gt;
          &lt;res-ref-name&gt;jdbc/myoracle&lt;/res-ref-name&gt;
          &lt;res-type&gt;javax.sql.DataSource&lt;/res-type&gt;
          &lt;res-auth&gt;Container&lt;/res-auth&gt;
      &lt;/resource-ref&gt;
  &lt;/web-app&gt;
  </code></pre>
  
  <p>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?</p>
  
  <p><em>EDIT</em>
  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:</p>
  
  <pre><code>[#|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|#]
  </code></pre>
  
  <p>This I think is just something in the server which is not in the expected place and nothing to do with my problem.</p>
  
  <p>I put a sun-web.xml file in which has the following content:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;!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;
  &lt;sun-web-app&gt;
  &lt;context-root&gt;/Client&lt;/context-root&gt;
  &lt;/sun-web-app&gt;
  </code></pre>
  
  <p>And it still doesn't work.  Because the 404 suggests resource <code>()</code> I suspect there is something it is again expecting to be in 
  one place and has been deployed to another.</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>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:</p>
  
  <pre><code>&lt;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'/&gt;
  &lt;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'/&gt;
  &lt;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'/&gt;
  &lt;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'/&gt;
  &lt;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'/&gt;
  &lt;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'/&gt;
  &lt;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'/&gt;
  &lt;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'/&gt;
  &lt;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'/&gt;
  &lt;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'/&gt;
  &lt;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'/&gt;
  &lt;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'/&gt;
  &lt;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'/&gt;
  &lt;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'/&gt;
  &lt;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'/&gt;
  &lt;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'/&gt;
  &lt;dependency_failed type='leaf_type' ctxk='java/io/File' witness='org/glassfish/deployment/autodeploy/AutoDeployedFilesManager$UndeployRequestedFile' stamp='1717892.374'/&gt;
  &lt;dependency_failed type='leaf_type' ctxk='java/io/File' witness='org/glassfish/deployment/autodeploy/AutoDeployedFilesManager$UndeployRequestedFile' stamp='1717892.374'/&gt;
  &lt;dependency_failed type='leaf_type' ctxk='java/io/File' witness='org/glassfish/deployment/autodeploy/AutoDeployedFilesManager$UndeployRequestedFile' stamp='1717892.374'/&gt;
  &lt;dependency_failed type='leaf_type' ctxk='java/io/File' witness='org/glassfish/deployment/autodeploy/AutoDeployedFilesManager$UndeployRequestedFile' stamp='1717892.374'/&gt;
  &lt;dependency_failed type='leaf_type' ctxk='java/io/File' witness='org/glassfish/deployment/autodeploy/AutoDeployedFilesManager$UndeployRequestedFile' stamp='1717892.374'/&gt;
  &lt;dependency_failed type='leaf_type' ctxk='java/io/File' witness='org/glassfish/deployment/autodeploy/AutoDeployedFilesManager$UndeployRequestedFile' stamp='1717892.374'/&gt;
  &lt;dependency_failed type='leaf_type' ctxk='java/io/File' witness='org/glassfish/deployment/autodeploy/AutoDeployedFilesManager$UndeployRequestedFile' stamp='1717892.374'/&gt;
  &lt;dependency_failed type='leaf_type' ctxk='java/io/File' witness='org/glassfish/deployment/autodeploy/AutoDeployedFilesManager$UndeployRequestedFile' stamp='1717892.374'/&gt;
  &lt;dependency_failed type='leaf_type' ctxk='java/io/File' witness='org/glassfish/deployment/autodeploy/AutoDeployedFilesManager$UndeployRequestedFile' stamp='1717892.374'/&gt;
  &lt;dependency_failed type='leaf_type' ctxk='java/io/File' witness='org/glassfish/deployment/autodeploy/AutoDeployedFilesManager$UndeployRequestedFile' stamp='1717892.374'/&gt;
  &lt;dependency_failed type='leaf_type' ctxk='java/io/File' witness='org/glassfish/deployment/autodeploy/AutoDeployedFilesManager$UndeployRequestedFile' stamp='1717892.374'/&gt;
  &lt;dependency_failed type='leaf_type' ctxk='java/io/File' witness='org/glassfish/deployment/autodeploy/AutoDeployedFilesManager$UndeployRequestedFile' stamp='1717892.374'/&gt;
  &lt;dependency_failed type='leaf_type' ctxk='java/io/File' witness='org/glassfish/deployment/autodeploy/AutoDeployedFilesManager$UndeployRequestedFile' stamp='1717892.374'/&gt;
  &lt;dependency_failed type='leaf_type' ctxk='java/io/File' witness='org/glassfish/deployment/autodeploy/AutoDeployedFilesManager$UndeployRequestedFile' stamp='1717892.374'/&gt;
  &lt;dependency_failed type='leaf_type' ctxk='java/io/File' witness='org/glassfish/deployment/autodeploy/AutoDeployedFilesManager$UndeployRequestedFile' stamp='1717892.374'/&gt;
  &lt;dependency_failed type='leaf_type' ctxk='java/io/File' witness='org/glassfish/deployment/autodeploy/AutoDeployedFilesManager$UndeployRequestedFile' stamp='1717892.374'/&gt;
  &lt;dependency_failed type='leaf_type' ctxk='java/io/File' witness='org/glassfish/deployment/autodeploy/AutoDeployedFilesManager$UndeployRequestedFile' stamp='1717892.374'/&gt;
  &lt;dependency_failed type='leaf_type' ctxk='java/io/File' witness='org/glassfish/deployment/autodeploy/AutoDeployedFilesManager$UndeployRequestedFile' stamp='1717892.374'/&gt;
  &lt;dependency_failed type='leaf_type' ctxk='java/io/File' witness='org/glassfish/deployment/autodeploy/AutoDeployedFilesManager$UndeployRequestedFile' stamp='1717892.374'/&gt;
  &lt;dependency_failed type='leaf_type' ctxk='java/io/File' witness='org/glassfish/deployment/autodeploy/AutoDeployedFilesManager$UndeployRequestedFile' stamp='1717892.374'/&gt;
  &lt;dependency_failed type='leaf_type' ctxk='java/io/File' witness='org/glassfish/deployment/autodeploy/AutoDeployedFilesManager$UndeployRequestedFile' stamp='1717892.374'/&gt;
  &lt;dependency_failed type='leaf_type' ctxk='java/io/File' witness='org/glassfish/deployment/autodeploy/AutoDeployedFilesManager$UndeployRequestedFile' stamp='1717892.374'/&gt;
  &lt;dependency_failed type='leaf_type' ctxk='java/io/File' witness='org/glassfish/deployment/autodeploy/AutoDeployedFilesManager$UndeployRequestedFile' stamp='1717892.375'/&gt;
  &lt;dependency_failed type='leaf_type' ctxk='java/io/File' witness='org/glassfish/deployment/autodeploy/AutoDeployedFilesManager$UndeployRequestedFile' stamp='1717892.375'/&gt;
  </code></pre>
  
  <p>Does this help explain what might be wrong?</p>