I am using Wicket 1.2.2 + Spring 2.0 + Hibernate 3.2 (same problem with Spring 1.2.8 + Hibernate 3.0.5)
I added OpenSessionInViewFilter in web.xml but still get LazyInitializationException
Here is my settings :
web.xml :
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/src/app.xml,classpath*:applicationContext-*.xml</param-value>
</context-param>
<servlet>
<servlet-name>context</servlet-name>
<servlet-class>org.springframework.web.context.ContextLoaderServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
... (skip)
<servlet-mapping>
<servlet-name>wicket</servlet-name>
<url-pattern>/app/*</url-pattern>
</servlet-mapping>
<filter>
<filter-name>OpenSessionInViewFilter</filter-name>
<filter-class>org.springframework.orm.hibernate3.support.OpenSessionInViewFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>OpenSessionInViewFilter</filter-name>
<url-pattern>/app/*</url-pattern>
</filter-mapping>
MyApplication extends WebApplication
protected void init()
{
super.init();
addComponentInstantiationListener(new SpringComponentInjector(this));
}
In the application initialization progress , I do see Filter 'OpenSessionInViewFilter' configured successfully :
http listening to *:8080
srun listening to 127.0.0.1:6802
INFO - Initializing filter 'OpenSessionInViewFilter'
INFO - Filter 'OpenSessionInViewFilter' configured successfully
INFO - JDBC 3.0 Savepoint class is available
But when I pass my object from one page to another page , and retrieve its set/list , I still get LazyInitializationException :
WicketMessage: Error attaching this container for rendering: [MarkupContainer [Component id = pagable, page = foo.bar.ItemPage, path = 1:itemListPanel:pagable.ItemListPanel$1, isVisible = true, isVersioned = true]]
Root cause:
org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: foo.bar.Item.images, no session or session was closed
at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationException(AbstractPersistentCollection.java:358)
at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationExceptionIfNotConnected (AbstractPersistentCollection.java:350)
Can somebody tell me where goes wrong ?
Thank you.
------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________ Wicket-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/wicket-user
