facebook

MyEclipse5.5.1GA+JBOSS4.2.1GA+EJB3 very strange problem???

  1. MyEclipse IDE
  2.  > 
  3. Off Topic
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #273783 Reply

    daemon1978
    Member

    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!!

    #273876 Reply

    Riyad Kalla
    Member

    Unfortunately this is a JBoss-specific question, I don’t know why it’s treating the annotation in that way and it’s effecting the deployment status of the Bean. I’m sorry.

    #273922 Reply

    Try the following:
    @Stateless
    public class FacilitiesFacadeBean implements FacilitiesFacadeRemote {

    @PersistenceContext(unitName=”FacilitiesPU”)
    private EntityManager em;

    Specify the unitName. This may solve the problem. I am using this on JBoss 4.2.1. and it works.
    Garth

Viewing 3 posts - 1 through 3 (of 3 total)
Reply To: MyEclipse5.5.1GA+JBOSS4.2.1GA+EJB3 very strange problem???

You must be logged in to post in the forum log in