我尝试将一个非常简单的 helloworld.war 部署到 ubuntu 10.04 上的 glassfish 3.1.2 服务器。在我的电脑上它工作正常,但在我的服务器上我总是得到一个 404 页面。我的服务器上没有错误。有人有想法吗?
我注意到另一个奇怪的行为。重新启动服务器后,我无法登录管理控制台。我总是得到验证失败重新输入您的用户名和密码。当我重新启动 glassfish 时,它再次工作。
这听起来很熟悉,但我不明白他的解决方案如何帮助我。 glassfish autodeploy 通过简单的应用程序提供 404
[#|2012-12-14T02:53:30.368+0100|INFO|glassfish3.1.2|org.glassfish.admingui|_ThreadID=71;_ThreadName=Thread-2;|uploadFileName=HelloWorld-1.0-SNAPSHOT.war|#]
[#|2012-12-14T02:53:30.605+0100|INFO|glassfish3.1.2|javax.enterprise.resource.webcontainer.jsf.config|_ThreadID=135;_ThreadName=Thread-2;|Mojarra 2.1.6 (SNAPSHOT 20111206) für Kontext '/HelloWorld-1.0-SNAPSHOT' wird initialisiert.|#]
[#|2012-12-14T02:53:30.729+0100|INFO|glassfish3.1.2|javax.enterprise.system.container.web.com.sun.enterprise.web|_ThreadID=135;_ThreadName=Thread-2;|WEB0671: Loading application [HelloWorld-1.0-SNAPSHOT] at [/HelloWorld-1.0-SNAPSHOT]|#]
[#|2012-12-14T02:53:30.883+0100|INFO|glassfish3.1.2|javax.enterprise.system.tools.admin.org.glassfish.deployment.admin|_ThreadID=135;_ThreadName=Thread-2;|HelloWorld-1.0-SNAPSHOT was successfully deployed in 482 milliseconds.|#]
索引.xhtml
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html">
<h:head>
<title>Facelet Title</title>
</h:head>
<h:body>
Hello from Facelets
</h:body>
</html>
web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.0" 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_3_0.xsd">
<context-param>
<param-name>javax.faces.PROJECT_STAGE</param-name>
<param-value>Development</param-value>
</context-param>
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>/faces/*</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>
30
</session-timeout>
</session-config>
<welcome-file-list>
<welcome-file>faces/index.xhtml</welcome-file>
</welcome-file-list>
</web-app>