glassfish
  1. glassfish
  2. GLASSFISH-5180

shared library not available in deployment time

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 9.1peur2
    • Fix Version/s: 9.1.1_dev
    • Component/s: deployment
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Issuezilla Id:
      5,180
    • Status Whiteboard:
      Hide

      911Approved

      Show
      911Approved

      Description

      There is an EJBv3 with an interface that references to a shared library (defined
      through --library option), for example one of its method uses a class as its
      argument that is in the shared library (jar). In this case, the EJB can't be
      deployed (error message: the ejb jar contains zero EJBs), or it can be, but it
      can't be registered to jndi (according to log in deployment time, the external
      class can't be found), so no client can reference to it (jndi lookup or
      dependency injection fails). If the EJB uses the external class only in its
      method bodies, it works fine.

        Activity

        Hide
        pbiener added a comment -

        Created an attachment (id=1571)
        sample program for the bug

        Show
        pbiener added a comment - Created an attachment (id=1571) sample program for the bug
        Hide
        Hong Zhang added a comment -

        Yeah, as I replied to the forum thread earlier, I think there is a bug on this
        that the libraries defined through --library option are only available at
        application loading (into container) time and not available at deployment
        descriptor/annotation processing time.

        As this problem can be worked around by either packaging this library inside the
        ear (in its top level lib directory) or dropping the library to the common
        library directory domains/domain1/lib (the latter will need a server restart), I
        will downgrade the bug to P3.

        I will take a look to see if we can fix in 9.* (this is not a problem in v3 code
        base). If you could attach the test case (the ear and the library jar) to
        reproduce this, it will be great.

        Show
        Hong Zhang added a comment - Yeah, as I replied to the forum thread earlier, I think there is a bug on this that the libraries defined through --library option are only available at application loading (into container) time and not available at deployment descriptor/annotation processing time. As this problem can be worked around by either packaging this library inside the ear (in its top level lib directory) or dropping the library to the common library directory domains/domain1/lib (the latter will need a server restart), I will downgrade the bug to P3. I will take a look to see if we can fix in 9.* (this is not a problem in v3 code base). If you could attach the test case (the ear and the library jar) to reproduce this, it will be great.
        Hide
        Hong Zhang added a comment -

        Sorry, I just saw the attachement, so doing this should be able to reproduce the
        problem?
        asadmin deploy --library SharedLibTestEAR-ejb.jar SharedLibTestEAR.ear

        Show
        Hong Zhang added a comment - Sorry, I just saw the attachement, so doing this should be able to reproduce the problem? asadmin deploy --library SharedLibTestEAR-ejb.jar SharedLibTestEAR.ear
        Hide
        pbiener added a comment -

        No, the ejb-jar is included in the EAR, the shared library is SharedUtils.jar.
        So the deploy command is:
        asadmin deploy --libraries SharedUtils.jar SharedLibTestEAR.ear

        Show
        pbiener added a comment - No, the ejb-jar is included in the EAR, the shared library is SharedUtils.jar. So the deploy command is: asadmin deploy --libraries SharedUtils.jar SharedLibTestEAR.ear
        Hide
        harpreet added a comment -

        Approved for v2.1

        Show
        harpreet added a comment - Approved for v2.1
        Hide
        Hong Zhang added a comment -

        I have checked the fix into 9.1.1.

        Also note, the correct syntax should be as follows, using the absolute path for
        your library, e.g.
        asadmin deploy --libraries /usr/local/files/SharedUtils.jar SharedLibTestEAR.ear

        When relative paths are used, they are relative to instance-root/lib/applibs.
        Please see the doc below:
        http://docs.sun.com/app/docs/doc/819-3675/deploy-1?a=view

        Show
        Hong Zhang added a comment - I have checked the fix into 9.1.1. Also note, the correct syntax should be as follows, using the absolute path for your library, e.g. asadmin deploy --libraries /usr/local/files/SharedUtils.jar SharedLibTestEAR.ear When relative paths are used, they are relative to instance-root/lib/applibs. Please see the doc below: http://docs.sun.com/app/docs/doc/819-3675/deploy-1?a=view
        Hide
        Hong Zhang added a comment -

        Updated the target milestone to reflect the correct build number.

        Show
        Hong Zhang added a comment - Updated the target milestone to reflect the correct build number.
        Hide
        Hong Zhang added a comment -
            • Issue 6927 has been marked as a duplicate of this issue. ***
        Show
        Hong Zhang added a comment - Issue 6927 has been marked as a duplicate of this issue. ***

          People

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

            Dates

            • Created:
              Updated:
              Resolved: