jakarta-eenetbeans-8glassfish-4.1contextroot

Setting context-path J2EE compiled by netbeans


i developed an application for university, but for some reasons seems to be impossible for me to set the context-root of it. This is what i tried to do:

The last warning is really strange, cause the web app is called simply "web". I tried to make web-uri web, web.war, web_ear but it never recognize the web-uri as correct :(


Solution

  • Finally i found the solution, thx to JBoss doc that are better then glassfish and netbeans togheter. The problem is caused by the presence of an APP composed by two modules: - EJB - WEB

    That two modules are contained in an ear that, cause of netbeans, has no "application.xml" so glassfish simply doesn't look at "glassfish-web.xml" and using asadmin can't work too. The only solution is to add the application.xml like this (in the "configuration files" folder of the project):

    <application xmlns="http://java.sun.com/xml/ns/j2ee" version="1.4"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
      xsi:schemaLocation="http://java.sun.com /xml/ns/j2ee 
                             http://java.sun.com/xml/ns/j2ee/application_1_4.xsd">
      <display-name>Ibei</display-name>
    
      <module>
        <ejb>ejb.jar</ejb>
      </module>
      <module>
        <web>
            <web-uri>web.war</web-uri>
            <context-root></context-root>
        </web>
      </module>
    </application>