I have a stateless DAO-EJB with a no interface view, which is inherited from a generic abstract DAO class with an additional method readAll();
So the tree is FooDAOBean <- extends GenericDAOImpl <- implements GenericDAOInterface
(click here to see GenericDAO implementation - in the link it isn't an abstract class):
@Stateless
public class FooDAOBean extends GenericDAOImpl<ENodeFocus, Serializable>{
@Override
public List<Foo> readAll() {
// do something...
}
}
and i have an initialization bean, which should configure the application with some entries:
@Singleton
@Startup
public class InitializationBean {
@EJB
FooDAOBean dao;
@PostConstruct
public void initialize() {
// do something
}
}
On deploying i'm getting the errors:
WFLYNAM0059: Resource lookup for injection failed: env/shitstorm.beans.InitializationBean/dao
WFLYEE0046: Failed to instantiate component view
When i implement a remote interface and annotate FooDAOBean
with @Remote(<RemoteInterface>.class)
it is working correctly. But i don't want to allow remote access. For me it is important, that FooDAOBean
's methods are only accessible in the same JVM (local). FooDAOBean
and InitializationBean
are in the same EAR-Project, so it should be work or do i miss something here? Has it to do with the singleton or whats happening here? Do i have to implement a local interface? I thought since EJB 3.0 i don't need it anymore. Thanks a lot! :)