glassfish
  1. glassfish
  2. GLASSFISH-15058

The <resource-ref> and <resource-env-ref> tags in web.xml are not checked properly during deployment

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.1_b31
    • Fix Version/s: 3.1_b33
    • Component/s: deployment
    • Labels:
      None
    • Environment:

      Windows XP

      Description

      If a web.xml contains an invalid <res-type> of <resource-ref>, the application can still be deployed without error.

      <resource-ref>
      <res-ref-name>jdbc/myDS</res-ref-name>
      <res-type>dummy</res-type>
      <res-auth>Container</res-auth>
      </resource-ref>

      I am not sure if this behaviour is expected in GlassFish V3.1, but GlassFish V2.1 gives an error message in server log:"java.lang.IllegalArgumentException: [dummy] is not an allowed property value type".

      A similiar issue is if the web.xml contains an empty name in the <resource-env-ref-type> tag of <resource-env-ref>,
      <resource-env-ref>
      <resource-env-ref-name></resource-env-ref-name>
      <resource-env-ref-type>test.AdminObject</resource-env-ref-type>
      </resource-env-ref>

      the deployment failed but the error in server log is not clear:

      [#|2010-12-09T12:01:57.328+1100|SEVERE|glassfish3.1|javax.enterprise.system.core.com.sun.enterprise.v3.server|_ThreadID=16;_ThreadName=Thread-1;|The log message is null.
      java.lang.NullPointerException
      at com.sun.enterprise.deployment.util.EjbBundleValidator.computeRuntimeDefault(EjbBundleValidator.java:1121)
      at com.sun.enterprise.deployment.util.EjbBundleValidator.accept(EjbBundleValidator.java:857)
      at com.sun.enterprise.deployment.WebBundleDescriptor.visit(WebBundleDescriptor.java:1988)
      at com.sun.enterprise.deployment.Application.visit(Application.java:1780)

      In GlassFish V2.1, the following error message appears in server log: "Invalid content was found starting with element 'resource-env-ref-type'".

      Please see attached for the test application.

        Activity

        Hide
        Hong Zhang added a comment -

        We now have validation for the resource ref and reject invalid ref type.

        Now for empty ref type, we will reject the deployment by this error message: java.lang.IllegalArgumentException: [null] is not an allowed property value type

        And for invalid ref type like foo, we will reject the deployment by this error message: java.lang.IllegalArgumentException: [foo] is not an allowed property value type

        Show
        Hong Zhang added a comment - We now have validation for the resource ref and reject invalid ref type. Now for empty ref type, we will reject the deployment by this error message: java.lang.IllegalArgumentException: [null] is not an allowed property value type And for invalid ref type like foo, we will reject the deployment by this error message: java.lang.IllegalArgumentException: [foo] is not an allowed property value type

          People

          • Assignee:
            Hong Zhang
            Reporter:
            jasonw401
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: