geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anthony Insolia (JIRA)" <j...@apache.org>
Subject [jira] [Created] (GERONIMO-6387) @EJB doesn't work in an EJB annotated with @Entity
Date Thu, 13 Sep 2012 08:53:08 GMT
Anthony Insolia created GERONIMO-6387:
-----------------------------------------

             Summary: @EJB doesn't work in an EJB annotated with @Entity
                 Key: GERONIMO-6387
                 URL: https://issues.apache.org/jira/browse/GERONIMO-6387
             Project: Geronimo
          Issue Type: Bug
      Security Level: public (Regular issues)
          Components: dependencies
    Affects Versions: 3.0-beta-1
         Environment: Geronimo 3.0 Beta
JavaEE6 singleton sample
            Reporter: Anthony Insolia


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

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message