This content has been marked as final.
Show 18 replies
-
15. Re: Cannot inject field annotated with @EJB annotation
jaikiran Dec 16, 2009 7:25 AM (in response to sebbay)When the application is being deployed, what messages related to JNDI bindings do you see for your application? The JNDI logs will look like:
17:54:50,143 INFO [JndiSessionRegistrarBase] Binding the following Entries in Global JNDI: SecureProfileService/remote - EJB3.x Default Remote Business Interface SecureProfileService/remote-org.jboss.profileservice.spi.ProfileService - EJB3.x Remote Business Interface
-
16. Re: Cannot inject field annotated with @EJB annotation
sebbay Dec 17, 2009 6:00 AM (in response to jaikiran)I have the following bean 'ServiceImpl' which demands on 'BeanA' and 'BeanB':
10:31:15,499 INFO [JBossASKernel] installing bean: jboss.j2ee:ear=test.ear,jar=test-ejb.jar,name=ServiceImpl,service=EJB3
10:31:15,499 INFO [JBossASKernel] with dependencies:
10:31:15,499 INFO [JBossASKernel] and demands:
10:31:15,499 INFO [JBossASKernel] jndi:test/BeanAImpl/local-com.test.BeanA
10:31:15,499 INFO [JBossASKernel] jndi:test/BeanBImpl/local-com.test.BeanB
BeanA is binded to the JNDI:
10:31:37,310 INFO [SessionSpecContainer] Starting jboss.j2ee:ear=test.ear,jar=test-ejb.jar,name=BeanAImpl,service=EJB3
10:31:37,311 INFO [EJBContainer] STARTED EJB: com.test.BeanAImpl ejbName: BeanAImpl
10:31:37,807 INFO [JndiSessionRegistrarBase] Binding the following Entries in Global JNDI:
test/BeanAImpl/local - EJB3.x Default Local Business Interface
test/BeanAImpl/local-com.test.BeanA - EJB3.x Local Business Interface
Deployment "<UNKNOWN jboss.j2ee:ear=test.ear,jar=test-ejb.jar,name=MessageArchiveServiceImpl,service=EJB3>" is in error due to the following reason(s): ** UNRESOLVED Demands 'jndi:test/GetPackedMessageServiceImpl/local-com.test.BeanB' **
@Stateless
@TransactionManagement(value = TransactionManagementType.BEAN)
@Interceptors( { ServiceLoggerContextInterceptor.class, TimingInterceptor.class, LoggingInterceptor.class })
public class BeanAImpl extends SomeAbstractClass implements BeanA
{
@EJB
private SomeOtherServiceService someOtherServiceService;
...
BeanB looks like this:
@Stateless
@Interceptors(
{ ServiceLoggerContextInterceptor.class, TimingInterceptor.class, LoggingInterceptor.class })
public class BeanBImpl implements BeanB
{
@EJB
private SomeOtherServiceService2 someOtherServiceService2;
Could the missing '@TransactionManagement(value = TransactionManagementType.BEAN)' be the reason for my faults? -
17. Re: Cannot inject field annotated with @EJB annotation
sebbay Dec 17, 2009 6:47 AM (in response to sebbay)Hello,
I figured out the reason for my problem. The reason was, that Bean1 demands on Bean2, Bean2 demands on Bean3 and Bean3 demands on Bean1!!!
Can I configure JBoss, to ignore these demands?
Best regards
sebbay