Wicket, Hibernate and filters (web.xml)

I guess everybody read about Open Session In View. So, as the jboss guys said there, we need something like SessionRequest filter. No problem with that. I’ve used almost the same code in my application, but I had issues with it.

What happend? Well, sometimes after saving something wicket would block, wait a minute and throw a “After 1 minute the Pagemap null is still locked by:” exception. I’ve read alot about that, but couldn’t find any solution!

Luckly, I found one mailing list, where somebody said that SessionRequest should be defined before WicketFilter (I’ve lost the link, but when I find it, I’ll post it).  Here is how my web.xml looks like now and it worked!

<filter>
 <filter-name>SessionRequestFilter</filter-name>
 <filter-class>com.vuknikolic.SessionRequestFilter</filter-class>
 </filter>
 <filter-mapping>
 <filter-name>SessionRequestFilter</filter-name>
 <url-pattern>/*</url-pattern>
 </filter-mapping>

<filter>
 <filter-name>wicket.patientportal</filter-name>
 <filter-class>org.apache.wicket.protocol.http.WicketFilter</filter-class>
 <init-param>
 <param-name>applicationClassName</param-name>
 <param-value>com.vuknikolic.WicketApplication</param-value>
 </init-param>
 </filter>
 

UPDATE: I need to find some plugin for posting source code…

UPDATE 2: Found one source code highlighter, yay!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s