[weld-dev] Validation on Alternative/Interceptor/Decorator mentioned in beans.xml

Emily Jiang emijiang6 at googlemail.com
Thu May 7 07:57:28 EDT 2015


Thank you Jozef or your reply. have brought this discussion in the cdi dev
as I think the spec is contradicting itself. Anyway, this question is
related to one tck test
org.jboss.cdi.tck.tests.alternative.broken.incorrect.name.NoClassWithSpecifiedNameTest
org.jboss.cdi.tck.tests.alternative.broken.incorrect.name.stereotype.NoAnnotationWithSpecifiedNameTest

This tck is to test a scenario where no classes in the web-inf\classes but
one beans.xml. In this beans.xml, an invalid class was specified in the
alternative list. The test is expecting a deployment. In my interpretation,
I won't create any archive for it as there is no classes. What is the value
to create one with beans.xml but nothing else (by the way, no other
accessible bean archives either). What is the value of this test? I think
the test should be modified to include a class. Thoughts?

On Mon, May 4, 2015 at 7:30 AM, Jozef Hartinger <jharting at redhat.com> wrote:

>  Hi Emily,
>
> jar1 and jar2 would be bean archives on their own. If such archive
> declares beans.xml then that one is used. Otherwise, the bean archive may
> be implicit (no beans.xml but bean-defining annotation). Either way, no
> other beans.xml file is used instead for that particular jar.
>
> HTH,
>
> Jozef
>
>
> On 04/30/2015 11:34 PM, Emily Jiang wrote:
>
>    Thanks Jozef! I figured out why I did not get an error:
>
>  my war:
>  web-inf\beans.xml (containing invalid class as alternatives)
>  web-inf\lib\jar1.jar
>  web-inf\lib\jar2.jar
>  [no web-inf\classes]
>  In either jar1.jar or jar2.jar, there is no beans.xml and no
> bean-defining annotations. Do you think the jar1.jar and jar2.jar should
> use the beans.xml in the web-inf? If yes, what if there is beans.xml
> packaged in either jar1.jar or jar2.jar? I cannot find any clear
> instruction on this scenario.
>  Thanks,
> Emily
>
> On Thu, Apr 30, 2015 at 6:24 AM, Jozef Hartinger <jharting at redhat.com>
> wrote:
>
>>  Hi Emily,
>>
>> Weld performs all these validations.
>>
>> Jozef
>>
>>
>> On 04/29/2015 11:52 PM, Emily Jiang wrote:
>>
>>  CDI1.2 spec section 8.2.2 says:
>> In the beans.xml
>> Each child <class> element must specify the name of a decorator bean
>> class. If there is no class with the specified name, or if the class with
>> the specified name is not a decorator bean class, the container
>> automatically detects the problem and treats it as a deployment problem.
>> If the same class is listed twice under the <decorators> element, the
>> container automatically detects the problem and treats it as a deployment
>> problem.
>>
>>  Will Weld do the validation or Weld expects the integrator to do the
>> validation?
>>
>> I am confused about what validations are done by the spec reference
>> implemenatation (RI) or RI consumer.
>>  --
>> Thanks
>> Emily
>> =================
>> Emily Jiang
>> ejiang at apache.org
>>
>>
>>  _______________________________________________
>> weld-dev mailing listweld-dev at lists.jboss.orghttps://lists.jboss.org/mailman/listinfo/weld-dev
>>
>>
>>
>
>
> --
> Thanks
> Emily
> =================
> Emily Jiang
> ejiang at apache.org
>
>
>


-- 
Thanks
Emily
=================
Emily Jiang
ejiang at apache.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/weld-dev/attachments/20150507/c13a6ba5/attachment-0001.html 


More information about the weld-dev mailing list