<html><head><style type='text/css'>p { margin: 0; }</style></head><body><div style='font-family: Arial; font-size: 10pt; color: #000000'><font face="Arial" size="2" style="color: rgb(0, 0, 0); font-family: Arial; font-size: 10pt; background-color: rgb(255, 255, 255);">Hi JJ,</font><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: 10pt; background-color: rgb(255, 255, 255);">I have create a sample app to reproduce it&nbsp;<span style="font-size: 10pt;">and uploaded to my github[1]. It is a really simple sample where I have no classes, just a WAR with&nbsp;guava-14.0.1.jar in the WEB-INF/lib folder.</span></div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: 10pt; background-color: rgb(255, 255, 255);"><span style="font-size: 10pt;">When I try to deploy the app I have the following exception:</span></div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: 10pt; background-color: rgb(255, 255, 255);"><br></div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: 10pt; background-color: rgb(255, 255, 255);"><font face="Arial" size="2">org.jboss.weld.exceptions.DeploymentException: WELD-001408 Unsatisfied dependencies for type [Set&lt;Service&gt;] with qualifiers [@Default] at injection point [[BackedAnnotatedParameter] Parameter 1 of [BackedAnnotatedConstructor] @Inject com.google.common.util.concurrent.ServiceManager(Set&lt;Service&gt;)]</font></div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: 10pt; background-color: rgb(255, 255, 255);"><font face="Arial" size="2"><br></font></div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: 10pt; background-color: rgb(255, 255, 255);"><font face="Arial" size="2">I have tested GF4 with the property you sent me before and it worked. Now I can deploy our app. I am facing another issues with GF now but looks like it is not related to CDI, so it is story for another thread in another place.</font></div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: 10pt; background-color: rgb(255, 255, 255);"><font face="Arial" size="2"><br></font></div><div style="background-color: rgb(255, 255, 255);"><font face="Arial" size="2"><font size="2">Now the question is: Is this behaviour expected by spec? It looks like a serious regression to me, since the impact is huge for most applications and no clear warning or&nbsp;</font>advise<font size="2">&nbsp;is given in the spec in this matter.</font></font></div><div style="background-color: rgb(255, 255, 255);"><font face="Arial" size="2"><font size="2">The most close words about this I found in the spec I downloaded at cdi-spec.org is '</font>For compatibility with Contexts and Dependency 1.0, products must contain an option to cause an archive to be ignored by the</font></div><div style="background-color: rgb(255, 255, 255);"><font face="Arial" size="2">container when no beans.xml is present.<font size="2">', but it is not totally clear to me, mainly because it is now up to the container to define something that I am used to take for granted in CDI 1.0.</font></font></div><div style="background-color: rgb(255, 255, 255);"><font face="Arial" size="2"><font size="2"><br></font></font></div><div style="background-color: rgb(255, 255, 255);"><font face="Arial" size="2"><font size="2">I haven't tested it outside GF, maybe all this is just GF issues, so I am sorry for any&nbsp;inconvenience.</font></font></div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: 10pt; background-color: rgb(255, 255, 255);"><font face="Arial" size="2"><br></font></div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: 10pt; background-color: rgb(255, 255, 255);"><font face="Arial" size="2">Regards</font></div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: 10pt; background-color: rgb(255, 255, 255);"><font face="Arial" size="2">[1]</font><span class="Object" id="OBJ_PREFIX_DWT504_com_zimbra_url" style="color: rgb(0, 0, 139); cursor: pointer;"><a href="https://github.com/mgraciano/cdi-1.1-test/tree/master/GF4IssueTest" target="_blank" style="color: rgb(0, 0, 139); text-decoration: none; cursor: pointer;">https://github.com/mgraciano/cdi-1.1-test/tree/master/GF4IssueTest</a></span></div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: 10pt;"><span name="x"></span>-- <br>Michel Graciano <br>Pesquisa e Desenvolvimento <br>Betha Sistemas Ltda. <br>Telefone: +55 (48) 3431-0733 <br>Ramal: 4863 <span name="x"></span><br></div><br><hr id="zwchr" style="color: rgb(0, 0, 0); font-family: Arial; font-size: 10pt;"><div style="color: rgb(0, 0, 0); font-family: Helvetica, Arial, sans-serif; font-size: 12pt; font-weight: normal; font-style: normal; text-decoration: none;"><b>From: </b>"JJ Snyder" &lt;j.j.snyder@oracle.com&gt;<br><b>To: </b>cdi-dev@lists.jboss.org<br><b>Sent: </b>Thursday, May 2, 2013 11:29:40 AM<br><b>Subject: </b>Re: [cdi-dev] Doubt about bean discovery default behaviour<br><br>
  
    
  
  
    Michel,<br>
    Auto-discovery is enabled by default for GlassFish.&nbsp; So it will scan
    all archives in the application for bean-defining annotations.&nbsp; You
    can disable this by doing the following:<br>
    asadmin set
    configs.config.server-config.cdi-service.enable-implicit-cdi=false<br>
    <br>
    Can you send me your app?&nbsp; I'll take a deeper look into it.<br>
    <br>
    JJ<br>
    <br>
    On 04/29/2013 01:01 PM, Michel Graciano wrote:
    <blockquote cite="mid:251a6636-86dd-4833-8615-908029e6c1c5@zmbpbthlinus001.bethati.com.br">
      <style>p { margin: 0; }</style>
      <div style="font-family: Arial; font-size: 10pt; color: #000000"><font face="Arial" size="2">Hi all,</font>
        <div style="color: rgb(0, 0, 0); font-family: Arial; font-size:
          10pt;">I have been reading the CDI spec and did some little
          tests with a prototype we have here and I am facing a issue
          when I deploy our application at GF 4 (which has guava as ine
          of the dependencies):</div>
        <div style="color: rgb(0, 0, 0); font-family: Arial; font-size:
          10pt;"><br>
        </div>
        <div><font face="Arial" size="2">org.jboss.weld.exceptions.DeploymentException:
            WELD-001408 Unsatisfied dependencies for type
            [Set&lt;Service&gt;] with qualifiers [@Default] at injection
            point [[BackedAnnotatedParameter] Parameter 1 of
            [BackedAnnotatedConstructor] @Inject
            com.google.common.util.concurrent.ServiceManager(Set&lt;Service&gt;)]</font></div>
        <div><font face="Arial" size="2"><br>
          </font></div>
        <div><font face="Arial" size="2">Basically I am facing it
            because guava has some classes annotated with @Inject and
            the container by default are scanning all the deps.</font></div>
        <div><font face="Arial" size="2"><br>
          </font></div>
        <div><font face="Arial" size="2">I have read the spec and for me
            it is not clear what the default behaviour is, if the
            container should or not scan all the dependencies when my
            app is&nbsp;supposedly&nbsp;following 1.0 spec (see our beans.xml
            above). Digging a little bit more, I found a issue [1] which
            says basically that 'Auto-discover is false by default in
            CDI 1.1 and the attribute is required...', which for me
            means that by default the container should work as CDI 1.0
            at this matter. R</font><font face="Arial" size="2">eading
            the spec a little further I found '</font><span style="font-family: Arial; font-size: small;">For
            compatibility with Contexts and Dependency 1.0, products
            must contain an option to cause an archive to be ignored by
            the&nbsp;</span><span style="font-family: Arial; font-size:
            small;">container when no beans.xml is present.' (which is
            the case for guava library) which could means that by
            default the container will not work as expected by CDI 1.0,
            so we have an incompatible change here.</span></div>
        <div><font face="Arial" size="2"><br>
          </font></div>
        <div><span style="font-family: Arial; font-size: small;">Our
            beans.xml file has just this content:</span></div>
        <div><font face="Arial" size="2"><br>
          </font></div>
        <div><font face="Arial" size="2">
            <div>&lt;?xml version="1.0" encoding="UTF-8"?&gt;</div>
            <div>&lt;beans xmlns=<a class="moz-txt-link-rfc2396E" href="http://java.sun.com/xml/ns/javaee" target="_blank">"http://java.sun.com/xml/ns/javaee"</a></div>
            <div><span class="Apple-tab-span" style="white-space:pre"> </span>
              &nbsp; xmlns:xsi=<a class="moz-txt-link-rfc2396E" href="http://www.w3.org/2001/XMLSchema-instance" target="_blank">"http://www.w3.org/2001/XMLSchema-instance"</a></div>
            <div><span class="Apple-tab-span" style="white-space:pre"> </span>
              &nbsp; xsi:schemaLocation=<a class="moz-txt-link-rfc2396E" href="http://java.sun.com/xml/ns/javaeehttp://java.sun.com/xml/ns/javaee/beans_1_0.xsd" target="_blank">"http://java.sun.com/xml/ns/javaee
              http://java.sun.com/xml/ns/javaee/beans_1_0.xsd"</a>&gt;</div>
            <div>&lt;/beans&gt;</div>
            <div><br>
            </div>
            <div>My question here is: Am I facing a issue at Weld/GF 4
              (glassfish-4.0-b86) or it is the default behaviour
              expected for CDI 1.1 specification?</div>
            <div><br>
            </div>
            <div>IMHO this behaviour should be&nbsp;clear at the
              specification, maybe following as did by JSR 344 adding a
              'Breakages in Backward Compatibility' section for
              changelog section if it is the case.</div>
            <div><br>
            </div>
            <div>I am sorry if this question have already been asked,
              but I was unable to find it (I swear I tried :).</div>
          </font><font face="Arial" size="2">
            <div><br>
            </div>
            <div>Thanks in advance.</div>
            <div>[1]&nbsp;<a href="https://issues.jboss.org/browse/CDI-321" target="_blank">https://issues.jboss.org/browse/CDI-321</a></div>
          </font>
          <div style="color: rgb(0, 0, 0); font-family: Arial;
            font-size: 10pt;"><span></span>-- <br>
            Michel Graciano <br>
            Pesquisa e Desenvolvimento <br>
            Betha Sistemas Ltda.</div>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre>_______________________________________________
cdi-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:cdi-dev@lists.jboss.org" target="_blank">cdi-dev@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/cdi-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/cdi-dev</a></pre>
    </blockquote>
  

<br>_______________________________________________<br>cdi-dev mailing list<br>cdi-dev@lists.jboss.org<br>https://lists.jboss.org/mailman/listinfo/cdi-dev</div><br></div></body></html>