如何使用GlassFish自动部署war文件 - 从“Core JavaServerFaces”由David Geary,Cay S. Horstmann撰写 [英] How to to autodeploy war file with GlassFish -- from "Core JavaServerFaces" by David Geary, Cay S. Horstmann

查看:205
本文介绍了如何使用GlassFish自动部署war文件 - 从“Core JavaServerFaces”由David Geary,Cay S. Horstmann撰写的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

天真的问题,但这是我在JSF中的第一步,所以原谅我; - )



我遵循所有步骤第一个例子来自David Geary的Core JavaServerFaces,Cay S. Horstmann(第三版)。

一般情况下有效:




  • java作品

  • glassfish作品

  • 我可以编译附加的代码

  • 我可以创建.war文件


当我将war文件复制到GlassFish的autodeploy子目录时,问题就开始了并尝试在GF中显示相应的页面。作为回报,我得到了404错误,并在日志中找到了这个:
$ b


选择文件/ opt / glassfish3 / glassfish / domains / domain1 / autodeploy / login.war用于自动部署。



模块类型无法识别模块/ opt / glassfish3 / glassfish / domains / domain1 / applications / login

没有安装的容器能够处理此应用程序登录。



Autodeploy失败:/ opt / glassfish3 / glassfish / domains / domain1 / autodeploy / login。 。

glassfish 3.1.2,java 1.6.0_29,opensuse 11.4。



>
tvf login.war



  0四月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星期一6月27日10:13:54 CEST 20 11 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星期一6月27日10:13:54 CEST 2011 web /
0四月12 21:24:56 CEST 2012 web / WEB-INF /
877 Mon Jun 27 10:13:54 CEST 2011 web / WEB-INF / web.xml
0四月12 22:21:38 CEST 2012 web / WEB-INF / classes /
0星期四4月12 22:21:38 CEST 2012 web / WEB-INF / classes / com /
0星期四4月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


解决方案

WAR文件损坏。



将它打包到web文件夹中。 WEB-INF应该在根目录中。


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

解决方案

Your WAR file is broken.

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

这篇关于如何使用GlassFish自动部署war文件 - 从“Core JavaServerFaces”由David Geary,Cay S. Horstmann撰写的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆