[
https://jira.jboss.org/browse/JBAS-8575?page=com.atlassian.jira.plugin.sy...
]
Radai Rosenblatt commented on JBAS-8575:
----------------------------------------
i've added beans.xml everywhere (in every META-INF or WEB-INF directory in every
archive file ...), and although the server log looks promising:
09:23:18,474 INFO [JndiSessionRegistrarBase] Binding the following Entries in Global
JNDI:
ear-1.0-SNAPSHOT/serviceImpl/local - EJB3.x Default Local Business Interface
ear-1.0-SNAPSHOT/serviceImpl/local-demo.ServiceInterface - EJB3.x Local Business
Interface
09:23:19,458 INFO [service] Removing bootstrap log handlers
09:23:20,865 INFO [org.jboss.web.tomcat.service.deployers.TomcatDeployment] deploy,
ctxPath=/jax-rs
09:23:21,193 INFO [org.jboss.resteasy.cdi.CdiInjectorFactory] Found BeanManager in
ServletContext
the EJB reference in the JAX-RS class is still null. is there anything else im doing
wrong? (i'll attach the updated maven project)
@EJB injection into JAX-RS resource not working
-----------------------------------------------
Key: JBAS-8575
URL:
https://jira.jboss.org/browse/JBAS-8575
Project: JBoss Application Server
Issue Type: Bug
Security Level: Public(Everyone can see)
Components: EJB3, Weld/CDI
Affects Versions: 6.0.0.M5
Environment: jboss 6.0.0.M5 on JDK 6U18 / windows XP
Reporter: Radai Rosenblatt
Assignee: Carlo de Wolf
Attachments: ear-1.0-SNAPSHOT.ear, parent.zip
i have a simple JAX-RS Resource bean:
@Path("/demo")
public class DemoResource {
@EJB
private ServiceInterface service;
public DemoResource() {
int forBreakPoint = 42;
}
@GET
@Produces("application/xml")
public StreamingOutput doSomething() {
service.doSomething();
// more code ...
which references a stateless session bean. the JAX-RS resource is inside a war module,
the SLSB in an eab module, both under the same ear.
injection of the SLSB into the JAX-RS Resource is not working - field is null.
from looking ta the server log this is not an order of init. issue since the jax-rs bean
is deployed after the SLSB has been bound to JNDI:
09:29:48,410 INFO [JndiSessionRegistrarBase] Binding the following Entries in Global
JNDI:
ear-1.0-SNAPSHOT/serviceImpl/local - EJB3.x Default Local Business Interface
ear-1.0-SNAPSHOT/serviceImpl/local-demo.ServiceInterface - EJB3.x Local Business
Interface
09:29:49,159 INFO [TomcatDeployment] deploy, ctxPath=/jax-rs
im attaching the maven project as well the the ear for anyone who wants to reproduce.
steps to reproduce:
1. build ear (mvn clean install)
2. deploy ear on jboss 6 M5
3. access
http://localhost:8080/jax-rs/demo/ with a web browser
4. watch the fireworks
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira