Glassfish:找不到此项目的部署配置

时间:2015-02-25 08:17:00

标签: netbeans deployment configuration glassfish web.xml

我正在尝试修复glassfish warning: context path differs from bundle,但至少通过IDE无法创建glassfish-web.xml文件:

  

找不到此项目的部署配置。部署   描述符版本无法正确设置。

Deployment Configuration for this project not Found.

2 个答案:

答案 0 :(得分:1)

您不需要glassfish-web.xml。在您的项目中,您已经拥有了一个web.xml,这就是您所需要的。检入该文件以查看您的上下文根是否具有前导" /"。

您还可以在servlet本身中设置上下文根,因此请检查上下文根目录。你可能会发现一个有一个领先的斜杠而另一个没有。

答案 1 :(得分:1)

的glassfish-web.xml中:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE glassfish-web-app PUBLIC "-//GlassFish.org//DTD GlassFish Application Server 3.1 Servlet 3.0//EN" "http://glassfish.org/dtds/glassfish-web-app_3_0-1.dtd">
<glassfish-web-app error-url="">
  <context-root>/CRM</context-root>
  <class-loader delegate="true"/>
  <jsp-config>
    <property name="keepgenerated" value="true">
      <description>Keep a copy of the generated servlet class' java code.</description>
    </property>
  </jsp-config>
</glassfish-web-app>

的web.xml:

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.1" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd">
    <context-param>
        <param-name>javax.faces.PROJECT_STAGE</param-name>
        <param-value>Development</param-value>
    </context-param>
     <context-param>
<param-name>javax.faces.DEFAULT_SUFFIX</param-name>
<param-value>.xhtml</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>*.xhtml</url-pattern>
    </servlet-mapping>
    <session-config>
        <session-timeout>
            30
        </session-timeout>
    </session-config>
    <welcome-file-list>
        <welcome-file>index.html</welcome-file>
    </welcome-file-list>
</web-app>
NB,所以,某些东西有时候。选择Web组件项目,右键单击,运行,更改上下文:

run context

据我所知,这导致glassfish-web.xml的生成,这就是问题的开始......

无论如何,现在它以惊人的输出运行:

thufir@doge:~$ 
thufir@doge:~$ lynx http://localhost:8080/CRM/crm.xhtml -dump
   some details go here


thufir@doge:~$