-
1. Re: DAO integration problem
fernando_jmt May 1, 2008 4:01 PM (in response to kleinerroemer)Try changing your declaration to:
@In ISearchDAO SearchDAO;
Or:
@In(value = "#{SearchDAO}") ISearchDAO db;
Take into account that the name you use in @Name annotation is the name Seam uses to register the component.
-
2. Re: DAO integration problem
kleinerroemer May 1, 2008 6:38 PM (in response to kleinerroemer)Hey!
First of all thanks for the reply!
This made the page at least deploy and loadable, but when I now call the find function I get the following exception:
#{Search.findSearchObj}: /home.xhtml @39,109 action="#{Search.findSearchObj}": javax.ejb.EJBTransactionRolledbackException: no concurrent calls on stateful bean 'jboss.j2ee:service=EJB3,name=Search' (EJB3 4.3.13)
Hm...
Hope you can help me out again!
Greets
-
3. Re: DAO integration problem
dro_k May 9, 2008 8:35 AM (in response to kleinerroemer)Are you using SMPC? If so, then you don't need the EJB3 @PersistenceContext, you can just use @In instead in your DAO.
Also, the
(create = true)
is redundant in you action, since the DAO is marked with @AutoCreate.One more thing, it's probably a better idea to inject the EntityManger in your @Stateful action (even if you're not going to use it) to trigger creation of the EntityManager in you Action, rather than somewhere down the line, which will give you more control if you ever want to use different type of FLUSH mode per action.
cheers,
Drew
-
4. Re: DAO integration problem
kleinerroemer May 10, 2008 7:50 PM (in response to kleinerroemer)Hi again!
Yes I'm using SMPC and so you where right with the @In annotation.
It now works, but there was one other problem:
my EntityManager variable 'em' needed to have the same name as declared in components.xml (where it was declared as 'entityManager')... so I changed the name of the variable, and now its works nicely.
Thanks for your help!