[weld-issues] [JBoss JIRA] (WELD-993) Cannot declare web service resource using @WebServiceRef
Jozef Hartinger (JIRA)
jira-events at lists.jboss.org
Mon Apr 23 09:46:19 EDT 2012
[ https://issues.jboss.org/browse/WELD-993?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jozef Hartinger updated WELD-993:
---------------------------------
Fix Version/s: 2.0.0.Alpha3
(was: 2.0.0.Alpha2)
Git Pull Request: https://github.com/weld/core/pull/190 (was: https://github.com/weld/core/pull/190)
> Cannot declare web service resource using @WebServiceRef
> --------------------------------------------------------
>
> Key: WELD-993
> URL: https://issues.jboss.org/browse/WELD-993
> Project: Weld
> Issue Type: Bug
> Affects Versions: 1.1.2.Final
> Reporter: Martin Kouba
> Fix For: 2.0.0.Alpha3
>
>
> Following web service resource definition (see CDI 1.0 section 3.5 Resources) results in:
> *WELD-000025 Tried to create an EEResourceProducerField, but no @Resource, @PersistenceContext, @PersistenceUnit, @WebServiceRef or @EJB is present*
> {code}
> public class SheepWSProducer {
> @Produces
> @WebServiceRef
> SheepWS sheepWS;
> }
> {code}
> There is no CDI TCK test for this yet.
> The problem is very likely related to weird checking code in *org.jboss.weld.bean.builtin.ee.EEResourceProducerField.checkEEResource()* - the first group evaluates to false and is inverted to true with "!" operator and thus exception is thrown:
> {code}
> ...
> if (!
> (
> getWeldAnnotated().isAnnotationPresent(ejbApiAbstraction.RESOURCE_ANNOTATION_CLASS)
> || getWeldAnnotated().isAnnotationPresent(persistenceApiAbstraction.PERSISTENCE_CONTEXT_ANNOTATION_CLASS)
> || getWeldAnnotated().isAnnotationPresent(persistenceApiAbstraction.PERSISTENCE_UNIT_ANNOTATION_CLASS)
> || getWeldAnnotated().isAnnotationPresent(ejbApiAbstraction.EJB_ANNOTATION_CLASS)
> )
> || getWeldAnnotated().isAnnotationPresent(wsApiAbstraction.WEB_SERVICE_REF_ANNOTATION_CLASS)
> )
> {
> throw new IllegalStateException(INVALID_RESOURCE_PRODUCER_FIELD, getWeldAnnotated());
> }
> ...
> {code}
> Should be replaced with something like:
> {code}
> ...
> if (!
> (
> getWeldAnnotated().isAnnotationPresent(ejbApiAbstraction.RESOURCE_ANNOTATION_CLASS)
> || getWeldAnnotated().isAnnotationPresent(persistenceApiAbstraction.PERSISTENCE_CONTEXT_ANNOTATION_CLASS)
> || getWeldAnnotated().isAnnotationPresent(persistenceApiAbstraction.PERSISTENCE_UNIT_ANNOTATION_CLASS)
> || getWeldAnnotated().isAnnotationPresent(ejbApiAbstraction.EJB_ANNOTATION_CLASS)
> || getWeldAnnotated().isAnnotationPresent(wsApiAbstraction.WEB_SERVICE_REF_ANNOTATION_CLASS)
> )
> )
> {
> throw new IllegalStateException(INVALID_RESOURCE_PRODUCER_FIELD, getWeldAnnotated());
> }
> {code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the weld-issues
mailing list