[jboss-user] [EJB 3.0] - MyEclipse5.5.1GA+JBOSS4.2.1GA+EJB3, very strange problem?????

daemon1978 do-not-reply at jboss.com
Sat Aug 11 05:10:31 EDT 2007


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 big headache,please help me!!
thanks!!	

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4073260#4073260

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4073260



More information about the jboss-user mailing list