for a new project i met following strange problem,please help me :
using myeclipse to generate a EJB3 projects and
When I create a session bean and use the annotation “@PersistenceContext” to inject the EntityManager, then I deploy such
EJB3 to jboss. With jboss web-console ,in JNDIView I cann’t find the EJB’s JNDI name ,that mean the session bean cann’t bind
to a JNDI name abd I cann’t visit it.
But when I delete the using of the annotation “@PersistenceContext”, the session bean will be deployed ok, in jboss web-
console I can also find the session-bean’s JNDI name.
code like :
//deploy it will have problem
@Stateless
public class CommonNativeQuery implements CommonNativeQueryLocal,
CommonNativeQueryRemote {
@PersistenceContext EntityManager em;
}
//deploy it will be OK
@Stateless
public class CommonNativeQuery implements CommonNativeQueryLocal,
CommonNativeQueryRemote {
//@PersistenceContext EntityManager em;
}
In such circumstance, I cann’t use EntityManager to operate the Entity-Bean ,it’s really a big headache,please help me!!
thanks!!