• 1 reply
  • Latest Post - ‏2013-05-02T17:22:02Z by bkail
1 Post

Pinned topic @Startup, Singleton EJB doesn't support injection

‏2013-04-22T14:51:35Z |


The following doesn't seem to work:


public class StartupBean {
    private EntityManager entityManager;
    public void createData() {
        entityManager.persist(new Task("Timothy", "Kanters"));

This does work in Websphere 8.5 Full profile. I'm deploying a war containing a jar with my EJB's the both the JAR and the WAR have a beans.xml. In my full application I am not injecting the persistencecontect but am instead injecting a statefull session bean. Both scenarios don't work on Liberty profile (8.5 Beta) and do work on full profile.

  • bkail
    23 Posts

    Re: @Startup, Singleton EJB doesn't support injection


    What problem/error are you seeing?  If you're using runtime enhancement and seeing the following warning, then that's a known issue with EJB+CDI+JPA that will be fixed:

    [WARNING ] CWWJP9991W: openjpa.Enhance: Warn: This configuration disallows runtime optimization, but the following listed types were not enhanced at build time or at class load time with a javaagent: