<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <br>
    <div class="moz-cite-prefix">On 05/25/2015 11:07 AM, Emily Jiang
      wrote:<br>
    </div>
    <blockquote
cite="mid:CAECq3A_urRaEiTA1KeHaP7_pgNEjsFWVngFpbUKmBML+fhsKow@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div>
          <div>Thank you Jozef! I also figured this out after I debugged
            the case further and reread the javadoc. Would you recommend
            to create one bda for every given class (not app class) or
            we should design a special archive to hold all this kind of
            classes or it does not matter much?<br>
          </div>
        </div>
      </div>
    </blockquote>
    You'll need to honor accessibility in these archives. Therefore, for
    example Integer and Long can share a single bean archive but e.g. a
    different class that is not accessible from Integer and Long needs
    to be put in a separate bean archive and accessibility of the
    classes needs to be reflected in the BDA graph.<br>
    <br>
    One option we use in WildFly for these additional bean archives is
    to have a bean archive per classloader.<br>
    <blockquote
cite="mid:CAECq3A_urRaEiTA1KeHaP7_pgNEjsFWVngFpbUKmBML+fhsKow@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div>
          <div><br>
            As for adding the bda to the graph, from my understanding,
            these classes should be visible to every other classes in
            the deployment. Therefore, this new bda should be accessible
            to all other bdas in this deployment, right?<br>
          </div>
        </div>
      </div>
    </blockquote>
    Yes, it is true for this particular class. If however
    loadBeanDeploymentArchive() was called for a different class (e.g.
    for a class from a web archive's library jar that is not itself a
    bean archive) then, as such class is not necessarily accessible from
    every bean archive, neither should be the returned bean archive.<br>
    <blockquote
cite="mid:CAECq3A_urRaEiTA1KeHaP7_pgNEjsFWVngFpbUKmBML+fhsKow@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div>Thanks<br>
        </div>
        Emily<br>
      </div>
      <div class="gmail_extra"><br>
        <div class="gmail_quote">On Mon, May 25, 2015 at 6:54 AM, Jozef
          Hartinger <span dir="ltr">&lt;<a moz-do-not-send="true"
              href="mailto:jharting@redhat.com" target="_blank">jharting@redhat.com</a>&gt;</span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div text="#000000" bgcolor="#FFFFFF"> Emily,<br>
              <br>
              see the JavaDoc here:
              <a moz-do-not-send="true"
href="http://docs.jboss.org/weld/javadoc/2.2/weld-spi/org/jboss/weld/bootstrap/spi/Deployment.html#loadBeanDeploymentArchive-java.lang.Class"
                target="_blank">http://docs.jboss.org/weld/javadoc/2.2/weld-spi/org/jboss/weld/bootstrap/spi/Deployment.html#loadBeanDeploymentArchive-java.lang.Class</a>-<br>
              <br>
              Specifically, it says:<br>
              <br>
              " <span style="color:rgb(71,71,71);font-family:'DejaVu
                Serif',Georgia,'Times New
Roman',Times,serif;font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:19.6000003814697px;text-align:left;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;display:inline!important;float:none;background-color:rgb(255,255,255)">If
                the deployment archive containing the given class is not
                currently a bean deployment archive, it must be added to
                the bean deployment archive graph and returned.</span>"<br>
              <br>
              Therefore, even though the given class is not part of an
              existing bean archive, it should be handled by the
              integrator, added to the bean archive graph and returned
              from the method.<br>
              <br>
              HTH,<br>
              <br>
              Jozef
              <div>
                <div class="h5"><br>
                  <br>
                  <div>On 05/24/2015 09:58 AM, Emily Jiang wrote:<br>
                  </div>
                </div>
              </div>
              <blockquote type="cite">
                <div>
                  <div class="h5">
                    <div dir="ltr">
                      <div>I'm trying to run the cdi tck but got an
                        error for the following test:<br>
                        In the test:
org.jboss.cdi.tck.tests.definition.bean.custom.CustomBeanImplementationTest<br>
                        Method:  arquillianBeforeClass<br>
                        <br>
                        <br>
                        <br>
                        Caused by:
                        org.jboss.weld.exceptions.IllegalStateException:
                        WELD-000817: Unable to find Bean Deployment
                        Archive for class java.lang.Integer<br>
                        at
org.jboss.weld.util.DeploymentStructures.getOrCreateBeanDeployment(DeploymentStructures.java:39)<br>
                        at
org.jboss.weld.bootstrap.events.AbstractBeanDiscoveryEvent.getOrCreateBeanDeployment(AbstractBeanDiscoveryEvent.java:70)<br>
                        at
org.jboss.weld.bootstrap.events.AfterBeanDiscoveryImpl.processBean(AfterBeanDiscoveryImpl.java:86)<br>
                        at
org.jboss.weld.bootstrap.events.AfterBeanDiscoveryImpl.finish(AfterBeanDiscoveryImpl.java:186)<br>
                        ... 15 more<br>
                        <br>
                      </div>
                      <div>It seems that Custom bean was added by an
                        extension but the bean implements
                        Bean&lt;Integer&gt;. Surely the
                        java.lang.Interger should not be any bean
                        archives. Can someone tell me what I might done
                        wrong? Will integrator need to do something to
                        cater for all of the java.x classes or Weld
                        should handle this?<br>
                      </div>
                      <div>
                        <div><br>
                          -- <br>
                          <div>Thanks<br>
                            Emily<br>
                            =================<br>
                            Emily Jiang<br>
                            <a moz-do-not-send="true"
                              href="mailto:ejiang@apache.org"
                              target="_blank">ejiang@apache.org</a><br>
                          </div>
                        </div>
                      </div>
                    </div>
                    <br>
                    <fieldset></fieldset>
                    <br>
                  </div>
                </div>
                <pre>_______________________________________________
weld-dev mailing list
<a moz-do-not-send="true" href="mailto:weld-dev@lists.jboss.org" target="_blank">weld-dev@lists.jboss.org</a>
<a moz-do-not-send="true" href="https://lists.jboss.org/mailman/listinfo/weld-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/weld-dev</a></pre>
              </blockquote>
              <br>
            </div>
          </blockquote>
        </div>
        <br>
        <br clear="all">
        <br>
        -- <br>
        <div class="gmail_signature">Thanks<br>
          Emily<br>
          =================<br>
          Emily Jiang<br>
          <a moz-do-not-send="true" href="mailto:ejiang@apache.org"
            target="_blank">ejiang@apache.org</a><br>
        </div>
      </div>
    </blockquote>
    <br>
  </body>
</html>