Uploaded image for project: 'Geronimo'
  1. Geronimo
  2. GERONIMO-6387

@EJB doesn't work in an EJB annotated with @Entity

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 3.0-beta-1
    • None
    • dependencies
    • Security Level: public (Regular issues)
    • None
    • Geronimo 3.0 Beta
      JavaEE6 singleton sample

    Description

      I have an @Singleton bean also annotated @Startup. The singleton is startin gup and it is accessible to other @ManagedBeans that inject the singleton using @EJB.

      @Startup
      @Singleton
      @ConcurrencyManagement(BEAN)
      public class Factory {
      private EntityManagerFactory emf = null;
      private EntityManager entityManager = null;
      etc.

      and

      @ManagedBean(name = "Credentials")
      @SessionScoped
      public class Credentials {
      private User user = null;
      private String username;
      private String password;
      private String company;
      private String verification = null;
      private boolean loggedIn = false;
      private InitialContext initialcontext = null;
      @EJB
      private Factory factory;

      public Credentials() {}
      etc.

      work fine: the @EJB resolves the reference to my factory object/singleton. In the same WAR I have an entity bean defined as below and the @EJB doesnt work.

      @Entity
      @Table(name="user_table")
      @ManagedBean(name = "User")
      @RequestScoped
      public class User extends Particle {
      private long uuid = 0;
      @Id
      private long csid = 0;
      @EJB
      private Factory factory;
      etc.

      I've added an Entity bean to the singleton example and get the same results

      Attachments

        Activity

          People

            Unassigned Unassigned
            inso7687@gmail.com Anthony Insolia
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: