On Thu, May 27, 2010 at 5:23 PM, Nikolaos Giannopoulos
<nikol...@brightminds.org> wrote:
>    public class BaseActionBean implements ActionBean {
>       �...@springbean  protected ModalityDao modalityDao;
>        ...
>
>   �...@repository("modalityDao")
>    public class ModalityDaoImpl extends BaseDaoImpl<Modality, Integer>
> implements ModalityDao {
>        public List<Modality> findAll() {
>            return (this.load());  // [2]
>        }
>       �...@postconstruct
>        private void init() {
>            this.findAll();   // [1]
>        }
>
> And let's show the ApplicationContext.xml relevant snippet:
>
>        <context:annotation-config />
>        <context:component-scan
> base-package="org.lightagents.ws.dao.impl.stripersist" />
>
> The modalityDao bean is indeed constructed and all is well except that
> the init() post construct at [1] results in the call at [2] which
> results in calls to the underlying Stripersist Interceptor were in IT is
> not initialized.
>
> Clearly Stripersist plumbing is in an invalid state but how to get this
> to work is the question!

The problem is that you have objects instanciated by the 2 frameworks
with independent lifecycles :
- Spring instanciates the DAO at context initialization (triggered by
the listener)
- Stripes instanciates the Stripersist interceptor at filter
initialization, and the Spring context knows nothing about it

You don't really need to use the Stripersist interceptor in your
BaseDaoImpl, you just want the EntityManagerFactory injected directly
instead. Stripersist also gets it from the Spring context anyway
(AFAIR, we use our own TypeConverter with a similar mechanism).

Frank

------------------------------------------------------------------------------

_______________________________________________
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users

Reply via email to