glassfish
  1. glassfish
  2. GLASSFISH-19229

Fix deployment from JDeveloper issue described in GLASSFISH-3297

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Duplicate
    • Affects Version/s: 4.0_b59
    • Fix Version/s: 4.0_b72_EE7MS4
    • Component/s: web_services
    • Labels:
      None

      Description

      So I am trying to deploy a simple war file generate by Oracle JDeveloper 11 (Technology Preview) by
      placing it in the autodeploy directory.

      This war file contains one class:

      package org.kingsfleet;

      @WebService
      public class MathService {
      public int thing(int a, int b)

      { return a^b; }

      }

      With the following web.xml:

      <?xml version = '1.0' encoding = 'US-ASCII'?>
      <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://
      java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" version="2.5"
      xmlns="http://java.sun.com/xml/ns/javaee">
      <description>Empty web.xml file for Web Application</description>
      <servlet>
      <servlet-name>MathServicePort</servlet-name>
      <servlet-class>org.kingsfleet.MathService</servlet-class>
      <load-on-startup>1</load-on-startup>
      </servlet>
      <servlet-mapping>
      <servlet-name>MathServicePort</servlet-name>
      <url-pattern>/mathserviceport</url-pattern>
      </servlet-mapping>
      <session-config>
      <session-timeout>35</session-timeout>
      </session-config>
      <mime-mapping>
      <extension>html</extension>
      <mime-type>text/html</mime-type>
      </mime-mapping>
      <mime-mapping>
      <extension>txt</extension>
      <mime-type>text/plain</mime-type>
      </mime-mapping>
      </web-app>

      When copied to the autodeploy directory I quite quickly see the WebServices.war_deployed signal which
      is good. When I try to test my web service using the management console though I get "404 - Resource
      not avaliable" when I try to test or view the WSDL for the service. Interestingly I can view the deployment
      descriptor okay.

      If modify the web.xml to remove all the servlet mappings:

      <?xml version = '1.0' encoding = 'US-ASCII'?>
      <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://
      java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" version="2.5"
      xmlns="http://java.sun.com/xml/ns/javaee">
      <description>Empty web.xml file for Web Application</description>
      <mime-mapping>
      <extension>html</extension>
      <mime-type>text/html</mime-type>
      </mime-mapping>
      <mime-mapping>
      <extension>txt</extension>
      <mime-type>text/plain</mime-type>
      </mime-mapping>
      </web-app>

      The service deploys properly.

      There is a bug GLASSFISH-3297 that is tracking the inconsistency with the reporting of the deployment status, and this bug is specifically to look at the failure to deploy in this case.

        Issue Links

          Activity

          Hide
          Lukas Jungmann added a comment -

          as soon as load-on-startup element is removed from web.xml, application deploys fine and web service is responding to requests, so the best and the easiest fix would be on the JDeveloper side to not generate load-on-starup element.

          problem of that element is that it forces servlet container to instantiate the class before webservice logic is in place and causes classcastexception - this is more a configuration error which is tracked in original GLASSFISH-3297 therefore marking this as a duplicate of that issue.

          Show
          Lukas Jungmann added a comment - as soon as load-on-startup element is removed from web.xml, application deploys fine and web service is responding to requests, so the best and the easiest fix would be on the JDeveloper side to not generate load-on-starup element. problem of that element is that it forces servlet container to instantiate the class before webservice logic is in place and causes classcastexception - this is more a configuration error which is tracked in original GLASSFISH-3297 therefore marking this as a duplicate of that issue.

            People

            • Assignee:
              Lukas Jungmann
              Reporter:
              gdavison
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: