gpt4 book ai didi

java - glassfish autodeploy 使用简单的应用程序提供 404

转载 作者:行者123 更新时间:2023-11-29 09:24:18 33 4
gpt4 key购买 nike

我安装了 vanilla glassfish v3,并将我的 .war 放到了我的 Windows PC 的 C:\glassfishv3\glassfish\domains\domain1\autodeploy 文件夹中。 war 包含一个使用 java、JSF、richfaces 构建的小型 Web 应用程序。

glassfish 服务器已经启动。

浏览器返回:

The requested resource () is not available.

有点烦人,因为当我也使用 ant 部署到 tomcat 6 时这工作正常。我不确定从哪里开始。有什么想法吗?

我的 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">

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

我不认为最后一个会导致问题 - 但我不知道在哪里寻找链接 glassfish。我是否需要像在企业 application.xml 中那样显式声明上下文根?

编辑作为对回复的回应,这是在服务器启动后写入日志目录中的 server.log 的唯一内容,其中仅列出了信息行 - 没有警告或 SEVERES。请注意,我仍然收到 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|#]

我认为这只是服务器中的一些东西不在预期的位置,与我的问题无关。

我放了一个 sun-web.xml 文件,里面有以下内容:

<?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'>
<sun-web-app>
<context-root>/Client</context-root>
</sun-web-app>

它仍然不起作用。因为 404 提示资源 () 我怀疑它再次期望在其中一个地方并已部署到另一个地方。

编辑

我发现,在部署到另一台机器(不同的平台,相同的 glassfish 版本)时,war 再次部署正常,但 jvm.log barfs 很多:

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

这是否有助于解释可能出现的问题?

最佳答案

您可以交叉检查的内容很少。

  1. 首先检查是否有任何部署错误。检查日志。日志将在 SERVER_HOME/domains/domain1/logs 中
  2. 您可能必须在 sun-web.xml 中指定应用程序的上下文根
  3. 最好转到 SERVER_HOME/domains/domain/applications/j2ee-apps/,并检查您的 war 文件是否已在此处展开​​。如果部署成功,这就是 war 爆发的地方。

关于java - glassfish autodeploy 使用简单的应用程序提供 404,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3908782/

33 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com