How to to autodeploy war file with GlassFish — from “Core JavaServerFaces” by David Geary, Cay S. Horstmann

北慕城南 提交于 2019-12-12 11:25:33

问题


Naive question, but this is my first step in JSF, so forgive me ;-)

I am following all the steps of the first example from "Core JavaServerFaces" by David Geary, Cay S. Horstmann (the 3rd edition).

What works in general:

  • java works
  • glassfish works
  • I can compile the attached code
  • I can create .war file

The problem begins when I copy the war file into autodeploy subdirectory of GlassFish and try to show the appropriate page in GF. In return I get 404 error and in logs I find this:

Selecting file /opt/glassfish3/glassfish/domains/domain1/autodeploy/login.war for autodeployment.

Module type not recognized for module /opt/glassfish3/glassfish/domains/domain1/applications/login

There is no installed container capable of handling this application login

Autodeploy failed : /opt/glassfish3/glassfish/domains/domain1/autodeploy/login.war.

glassfish 3.1.2, java 1.6.0_29, opensuse 11.4.

The question is how to make this code work?

Updates

jar tvf login.war

     0 Thu Apr 12 22:24:24 CEST 2012 META-INF/
    71 Thu Apr 12 22:24:24 CEST 2012 META-INF/MANIFEST.MF
     0 Mon Jun 27 10:13:54 CEST 2011 src/
     0 Mon Jun 27 10:13:54 CEST 2011 src/java/
     0 Mon Jun 27 10:13:54 CEST 2011 src/java/com/
     0 Thu Apr 12 22:16:32 CEST 2012 src/java/com/corejsf/
   603 Thu Apr 12 22:16:32 CEST 2012 src/java/com/corejsf/UserBean.java
     0 Mon Jun 27 10:13:54 CEST 2011 web/
     0 Thu Apr 12 21:24:56 CEST 2012 web/WEB-INF/
   877 Mon Jun 27 10:13:54 CEST 2011 web/WEB-INF/web.xml
     0 Thu Apr 12 22:21:38 CEST 2012 web/WEB-INF/classes/
     0 Thu Apr 12 22:21:38 CEST 2012 web/WEB-INF/classes/com/
     0 Thu Apr 12 22:21:38 CEST 2012 web/WEB-INF/classes/com/corejsf/
   704 Thu Apr 12 22:21:38 CEST 2012 web/WEB-INF/classes/com/corejsf/UserBean.class
     0 Mon Jun 27 10:13:54 CEST 2011 web/WEB-INF/beans.xml
   786 Mon Jun 27 10:13:54 CEST 2011 web/index.xhtml
   394 Mon Jun 27 10:13:54 CEST 2011 web/welcome.xhtml

回答1:


Your WAR file is broken.

Package it up in the web folder instead. WEB-INF should be in the root.



来源:https://stackoverflow.com/questions/10147995/how-to-to-autodeploy-war-file-with-glassfish-from-core-javaserverfaces-by-d

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!