This content has been marked as final.
Show 4 replies
-
1. Re: JBoss Seam EntityManager
antibrumm.mfrey0.bluewin.ch Mar 24, 2011 7:09 AM (in response to richfaces_ahop)What about an application scoped bean with the @startup annotation?
-
2. Re: JBoss Seam EntityManager
richfaces_ahop Mar 24, 2011 8:06 PM (in response to richfaces_ahop)So, the Session Bean that I am using, use the @Startup annotation in conjunction with the EntityManager? Everytime I tried to use the EntityManager previously, I kept getting NullPointerException, unless I was clicking a button (which would make use of an action listener). I am not familiar with the @startup. Would the code look like this?
@In EntityManager em; //a Seam-managed persistence context
@Startup
public class Test() {
public void beginClaimWizard() {
claim = em.find(Claim.class, claimId);
}
} -
3. Re: JBoss Seam EntityManager
richfaces_ahop Mar 24, 2011 8:13 PM (in response to richfaces_ahop)I really am trying to figure out "How do I make Seam call an action method at JBoss AS startup time? -
4. Re: JBoss Seam EntityManager
lvdberg Mar 25, 2011 5:23 AM (in response to richfaces_ahop)Hi,
A seam application is usually the last in the chain to start up, so you're NOT able to start up a Seam bean at Jboss start up, You can create a simple JBoss service which does that for you. However be aware that the basic JBoss services (such as persistency) must be active first, so
at start-up time
really means after some N-seconds.Leo