It looks like there is a packaging bug in Spring 3.1.2.

Classes in the ORM package should not reference web classes! (OncePerRequestFilter in this case).

The situation is as follows:

- org.springframework.orm.hibernate4.support.OpenSes sionInViewFilter is in org.springframework.orm-sources-3.1.2.RELEASE.jar
- org.springframework.web.filter.OncePerRequestFilte r is in org.springframework.web-3.1.2.RELEASE.jar

This creates problems when we want to use OpenSessionInViewFilter in a webapp that is deployed as part of an EAR. org.springframework.orm.jar would natuarally be placed on the EAR classpath, and since OpenSessionInViewFilter depends on OncePerRequestFilter, this also forces us to place org.springframework.web.jar on the EAR classpath.

However, org.springframework.web.jar also contains org.springframework.web.jsf.* classes. Now if the webapp references anything from that package, we'll very likely get an exception - "java.lang.NoClassDefFoundError: javax/faces/context/FacesContext" (or something similar), b/c org.springframework.web.jar relies on JSF classes that live in WEB-INF/lib.

In order to fix this dependency problem, OpenSessionInViewFilter should probably be moved into org.springframework.web.jar

Does this sound right, or am I missing something?

Thanks!