Thufir
Thufir

Reputation: 8487

Glassfish: Deployment Configuration for this project not found

I'm trying to fix a glassfish warning: context path differs from bundle but cannot, at least through the IDE, create a glassfish-web.xml file:

Deployment Configuration for this project not found. Deployment descriptor version could not be set properly.

Deployment Configuration for this project not Found.

Upvotes: 1

Views: 2099

Answers (2)

Thufir
Thufir

Reputation: 8487

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, so, something something sometimes. Selecting the Web component project, right click, run, change context:

run context

as far as I can tell, this caused the generation of glassfish-web.xml which was the problem to begin with...

Anyhow, now it runs with astonishing output:

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


thufir@doge:~$ 

Upvotes: 1

Mike
Mike

Reputation: 4963

You don't need a glassfish-web.xml. In your project, you already have a web.xml which is all you need. Check in that file to see if your context root has a leading "/".

You can also set your context root in the servlet itself, so check to see what the context root is in there. You may find that one has a leading slash and the other doesn't.

Upvotes: 1

Related Questions