glassfish
  1. glassfish
  2. GLASSFISH-16059

failure while processing resource-type of a resource-ref in an application that uses a resource-adapter artifact on non-DAS target

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 4.0
    • Fix Version/s: 3.1.1_b01
    • Component/s: naming
    • Labels:
      None

      Description

      1) Deploy the resource-adapter to the instance
      2) Create pool and resource with "target" as the instance
      3) Deploy the application that uses the resources of the
      resource-adapter to the instance.
      [This will fail in DAS as there seem to be some processing happening in
      DAS though the target is "instance"]

      Exact failure is due to EjbBundleValidator making sure that the
      resource-type of the resource-ref specified is valid.
      [Refer EJBBundleValidator calling "resRef.checkType()" in the method
      "accept()" ]

      Above check will fail in DAS as the resource-adapter is not enabled (and
      hence not available for the classloader hierarchy).

      Workaround would be to deploy the resource-adapter and the application that uses the resource-adapter in DAS and then create application-ref in appropriate targets.

        Activity

        Hide
        Hong Zhang added a comment -

        This is related to my fix to
        http://java.net/jira/browse/GLASSFISH-15058

        Seems we should invoke the validation in the naming code like in v2 where the resource is actually being used (looked up).

        Assign to Cheng to take a look.

        Show
        Hong Zhang added a comment - This is related to my fix to http://java.net/jira/browse/GLASSFISH-15058 Seems we should invoke the validation in the naming code like in v2 where the resource is actually being used (looked up). Assign to Cheng to take a look.
        Hide
        Cheng Fang added a comment -

        Sending common/container-common/src/main/java/com/sun/enterprise/container/common/impl/ComponentEnvManagerImpl.java
        Sending deployment/dol/src/main/java/com/sun/enterprise/deployment/EnvironmentProperty.java
        Sending deployment/dol/src/main/java/com/sun/enterprise/deployment/JmsDestinationReferenceDescriptor.java
        Sending deployment/dol/src/main/java/com/sun/enterprise/deployment/util/EjbBundleValidator.java
        Committed revision 45383.

        I've moved the checkType from EjbBundleValidator to ComponentEnvManagerImpl,
        which is roughly the equivalent as in v2.
        I also added the same checkType for res-env-ref to be consistent with resource-ref.

        I tested with invalid res-ref-type and res-env-ref-type (as in issue 15058), and either one will cause the deployment to fail with the correct exception and error message.

        Jagadish tested with the resource adapter (thanks!) with the following comments:
        <quote>
        I tried with the resource-adapter that I was using before. It works fine
        now. ie., even though the RAR (and the resource) are not available in DAS,
        deployment works fine with your fix.
        If I dont have the RAR available in the instance and try to deploy
        the .ear that uses the resource of RAR, it fails as expected.
        </quote>

        Show
        Cheng Fang added a comment - Sending common/container-common/src/main/java/com/sun/enterprise/container/common/impl/ComponentEnvManagerImpl.java Sending deployment/dol/src/main/java/com/sun/enterprise/deployment/EnvironmentProperty.java Sending deployment/dol/src/main/java/com/sun/enterprise/deployment/JmsDestinationReferenceDescriptor.java Sending deployment/dol/src/main/java/com/sun/enterprise/deployment/util/EjbBundleValidator.java Committed revision 45383. I've moved the checkType from EjbBundleValidator to ComponentEnvManagerImpl, which is roughly the equivalent as in v2. I also added the same checkType for res-env-ref to be consistent with resource-ref. I tested with invalid res-ref-type and res-env-ref-type (as in issue 15058), and either one will cause the deployment to fail with the correct exception and error message. Jagadish tested with the resource adapter (thanks!) with the following comments: <quote> I tried with the resource-adapter that I was using before. It works fine now. ie., even though the RAR (and the resource) are not available in DAS, deployment works fine with your fix. If I dont have the RAR available in the instance and try to deploy the .ear that uses the resource of RAR, it fails as expected. </quote>

          People

          • Assignee:
            Cheng Fang
            Reporter:
            Jagadish
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: