glassfish
  1. glassfish
  2. GLASSFISH-18162

CDI failed to inject class from jar file in the same web module

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Invalid
    • Affects Version/s: 3.1.1_b12, 4.0_b18
    • Fix Version/s: None
    • Labels:
      None
    • Environment:

      Description

      1. created a webapp with a simple JAX-WS web service (MyWebService.java).
      2. Inside MyWebservice injected MyServiceImpl.java from a library libA.jar.

      3. Build .war file that contains libA.jar in WEB-INF/lib/ and MyWebService.class in WEB-INF/classes/

      4. Deploy the .war file.

      Expected: war deploy ok, webservice working

      Actual: War not deployed, server generate "WELD-001408 Unsatisfied dependencies for type"

      Firstly i thought this is a duplication of GLASSFISH-15906, GLASSFISH-15721 after test with the file from those JIRA issues, I belive this is new issue.

      the war file attached.

        Activity

        Hide
        Sivakumar Thyagarajan added a comment -

        libA.jar doesn't have a beans.xml in it and hence is not considered a bean archive (See CDI 1.0 Spec Section 12.1 that says that a library jar is considered only a bean archive if it contains a beans.xml). Adding a beans.xml in libA.jar results in successful deployment of the WAR. Marking this issue as "not a bug".

        Show
        Sivakumar Thyagarajan added a comment - libA.jar doesn't have a beans.xml in it and hence is not considered a bean archive (See CDI 1.0 Spec Section 12.1 that says that a library jar is considered only a bean archive if it contains a beans.xml). Adding a beans.xml in libA.jar results in successful deployment of the WAR. Marking this issue as "not a bug".

          People

          • Assignee:
            Sivakumar Thyagarajan
            Reporter:
            nguyenphucnguyen
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: