0 Replies Latest reply on Jun 26, 2008 5:02 PM by Marius Oancea

    Struts2 web application accessing seam session beans

    Marius Oancea Novice

      I have a Struts2 application that make a call to a Seam sesion bean.


      1. Struts2 application is a plain web application deployed on jboss.


      2. Seam application is an ear deployed on the same jboss.


      After I call the EJB i get an Entity and when I try to navigate on its relations (e.g. getChildren()) i get LazyInitializationException.


      What is the best idea to solve this?


      Should I make a JNDI lookup of PersistenceUnit in an interceptor or in a filter to create something like OpenSessionInView in my struts2 application?
      Any link pointing me near to a solution will be very appreciated.


      Note: Struts application already uses HibernateTransactionManager in which sessionFactory is injected by spring.


      Transactions are provided by spring AOP.


      Please help.


      Thank you.