2 Replies Latest reply on May 2, 2011 2:35 AM by marx3

    Inject vs EJB

    marx3 Apprentice

      1) What annotation should be used to inject stateless components? @EJB or @Inject?

      2) There is strange behavior in my application. If I don't use @EJB anywhere, I cannot uses injection in components which observes PostConstructApplicationEvent (WELD-000079 Could not find the EJB in JNDI). Hovewer, if I use even only once anywhere annotation @EJB - injections works. In console it's clear that Binding the following entry in Global JNDI for bean: xxx is before or after PostConstructApplicationEvent and it depends on using @EJB

      3) Should injected beans be defined as transient? And what about serialization - should I in some way use PostActivate event to fill injected-transient object again?