Bug 1001610
Summary: | CDI @Inject of @Stateless @WebService cause WELD-001408 Unsatisfied dependencies | ||
---|---|---|---|
Product: | [JBoss] JBoss Enterprise Application Platform 6 | Reporter: | Aslak Knutsen <aknutsen> |
Component: | CDI/Weld, EJB, Web Services | Assignee: | Stuart Douglas <sdouglas> |
Status: | CLOSED NOTABUG | QA Contact: | Marek Schmidt <maschmid> |
Severity: | medium | Docs Contact: | Russell Dickenson <rdickens> |
Priority: | unspecified | ||
Version: | 6.1.0 | CC: | istudens, jharting, pmuir |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2013-10-25 12:04:36 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Aslak Knutsen
2013-08-27 11:43:03 UTC
Use of @EJB on the InjectionPoint works when resolved with CDI, just not @Inject. @RunWith(Arquillian.class) public class TestBeanIT { @EJB TestBean bean; ... } Martin Kouba <mkouba> made a comment on jira WFLY-1960 The problem is the {{TestBean}} does NOT define a local client view - it doesn't implement a business interface and does not satisfy no-interface view requirements either. It only has a *web service client view*. See also EJB spec, 4.9.8 Session Bean’s No-Interface View: {quote} * If the bean does not expose any other client views (local, remote, no-interface, 2.x Remote Home, 2.x Local Home, Web Service) and its implements clause is empty, the bean defines a no-interface view. ... {quote} Furthermore the CDI spec, 3.2.2. Bean types of a session bean: {quote} The unrestricted set of bean types for a session bean contains all local interfaces of the bean and their superinterfaces. If the session bean has a bean class local view, the unrestricted set of bean types contains the bean class and all superclasses. ... {quote} I believe that "bean class local view" is referencing EJB no-interface view (I'm not sure though and will raise a CDI spec issue). If so the set of bean types for TestBean contains only {{java.lang.Object}} and so the test deployment should result in unsatisfied dependency. I'm not sure whether @EJB injection should work or not, but given that JAX-WS web services are accessible via JNDI it may work by coincidence. Note that if you annotate {{TestBean}} with {{javax.ejb.LocalBean}} (explicitly state a session bean exposes a no-interface view) the test passes. Rejecting dev_ack as per Martin's comment, as the test is invalid. |