glassfish
  1. glassfish
  2. GLASSFISH-20829

Beans deployed in ejb archives that implements extension are not visible to war in ear deployment

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.1.2.2
    • Fix Version/s: 4.0
    • Component/s: cdi
    • Labels:
      None

      Description

      If you include an extension in an ejb archive and deploy the resulting application as an ear contained beans are not made available to wars in same ear. Looking at the logs I see that the archive is processed two times

      FINE|org.glassfish.weld.BeanDeploymentArchiveImpl|-JAR processing: file:/core.jee-0.0.1-SNAPSHOT_jar/ as a Bean archive jar since it has META-INF/beans.xml
      FINE|org.glassfish.weld.BeanDeploymentArchiveImpl|-JAR processing: file:/core.jee-0.0.1-SNAPSHOT_jar/ as an extensions jar since it has META-INF/services extension

      Looking at code (from org.glassfish.web:weld-integration:3.1.1) the second processing sets the bdaType to UNKNOWN

      418 if (archive.exists(META_INF_BEANS_XML))

      { 419 logger.log(FINE, "-JAR processing: " + archive.getURI() 420 + " as a Bean archive jar since it has META-INF/beans.xml"); 421 bdaType = BDAType.JAR; 422 collectJarInfo(archive, true); 423 }

      424
      425 if (archive.exists(META_INF_SERVICES_EXTENSION))

      { 426 logger.log(FINE, "-JAR processing: " + archive.getURI() 427 + " as an extensions jar since it has META-INF/services extension"); 428 bdaType = BDAType.UNKNOWN; 429 collectJarInfo(archive, false); 430 }

      and only JAR BDAs seem to be made available to wars (org.glassfish.weld.DeploymentImpl)

      228 if (warBDAs != null) {
      229 ListIterator<BeanDeploymentArchive> warIter = warBDAs.listIterator();
      230 boolean modifiedArchive = false;
      231 while (warIter.hasNext()) {
      232 BeanDeploymentArchive warBDA = (BeanDeploymentArchive)warIter.next();
      233 if (jarBDAs != null) {
      234 ListIterator<BeanDeploymentArchive> jarIter = jarBDAs.listIterator();
      235 while (jarIter.hasNext())

      { 236 BeanDeploymentArchive jarBDA = (BeanDeploymentArchive)jarIter.next(); 237 warBDA.getBeanDeploymentArchives().add(jarBDA); 238 modifiedArchive = true; 239 }

      240 }

      The result is a WELD-001408 for unsatisfied dependencies at deploy.

        Activity

        Hide
        jjsnyder83 added a comment -

        This was fixed several months ago with the work that was done for integrating with CDI 1.1.

        Show
        jjsnyder83 added a comment - This was fixed several months ago with the work that was done for integrating with CDI 1.1.
        Hide
        dgaffuri added a comment -

        Thanks for your answer. Do you have a link to the JIRA issue? What about a fix for version 3?

        Show
        dgaffuri added a comment - Thanks for your answer. Do you have a link to the JIRA issue? What about a fix for version 3?
        Hide
        jjsnyder83 added a comment -

        The change to BeanDeploymentArchiveImpl was done while fixing cdi 1.1 tck failures. Unfortunately there was not a Jira for it. The svn commit info for that change is:

        59030 01.02.2013 21:05:12, by jjsnyder83

        I'll look into your comment on DeploymentImpl next.

        Show
        jjsnyder83 added a comment - The change to BeanDeploymentArchiveImpl was done while fixing cdi 1.1 tck failures. Unfortunately there was not a Jira for it. The svn commit info for that change is: 59030 01.02.2013 21:05:12, by jjsnyder83 I'll look into your comment on DeploymentImpl next.
        Hide
        jjsnyder83 added a comment -

        As for the changes to DeploymentImpl I cannot determine when they were made as svn compare is failing on me due to repository issues.

        I do not know about fixes for version 3. Those would probably have to go through support. fyi...there were many many fixes and improvements in GlassFish with 4.0 especially in CDI. I encourage you to upgrade if that's possible.

        Show
        jjsnyder83 added a comment - As for the changes to DeploymentImpl I cannot determine when they were made as svn compare is failing on me due to repository issues. I do not know about fixes for version 3. Those would probably have to go through support. fyi...there were many many fixes and improvements in GlassFish with 4.0 especially in CDI. I encourage you to upgrade if that's possible.

          People

          • Assignee:
            jjsnyder83
            Reporter:
            dgaffuri
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: