Moved from java.net:
https://equinox.dev.java.net/issues/show_bug.cgi?id=19
ContextLoaderPlugIn is configured in struts-xonfig.xml like this:
<plug-in className="org.springframework.web.struts.ContextLoaderPlugIn">
<set-property property="contextConfigLocation"
value="/WEB-INF/applicationContext-hibernate.xml,
/WEB-INF/applicationContext.xml,
/WEB-INF/action-servlet.xml"/>
</plug-in>
However, this creates a second ApplicationContext as child of the main
ApplicationContext (created by ContextLoaderListener in web.xml). This means
that all beans in /WEB-INF/applicationContext*.xml will be instanciated twice
which can cause touble with OpenSessionInViewFilter because there are now two
SessionFactories.
Solution: Remove /WEB-INF/applicationContext-hibernate.xml and
/WEB-INF/applicationContext.xml from ContextLoaderPlugIn. See
http://forum.springframework.org/viewtopic.php?t=931#4094 for details.
------- Additional comments from mraible Tue Aug 23 04:15:38 +0000 2005 -------
You are correct that the applicationContext-hibernate.xml and
applicationContext.xml files are getting loaded twice. I agree this a bug.
However, if I remove these files from the ContextLoaderPlugin definition - then
the tests will fail b/c StrutsTestCase does not initialize listeners. I know
how to do a bridge between's Spring Mocks and StrutsTestCase, but I haven't done
it yet for Equinox.
Thanks for pointing this out - I'll try to figure out the best way to fix it in
the next release.
Matt