Hi,
Here is my problem:
I'm using Spring, Hibernate3, struts1.1. I used the plugin for struts so the application context is being created and I can use the injection.
Now I have to create this tag library and I need to wire some of the beans that I use there.
So, since this are not "connected" with the struts actions etc, I don't have a existing context. What I was trying to do is something like
And that loads the context but I get this exception:Code:Resource res = new FileSystemResource("C:/apps/Tomcat5.5/webapps/myApp/WEB-INF/applicationContext.xml"); factory = new XmlBeanFactory(res);
Code:[13 Apr 2006 13:08:30,083 LazyInitializationException(line:19) ERROR] could not initialize proxy - the owning Session was closed org.hibernate.LazyInitializationException: could not initialize proxy - the owning Session was closed at org.hibernate.proxy.AbstractLazyInitializer.initialize(AbstractLazyInitializer.java:60) at org.hibernate.proxy.AbstractLazyInitializer.getImplementation(AbstractLazyInitializer.java:102) at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.intercept(CGLIBLazyInitializer.java:160) at com.dropshopz.model.Rate$$EnhancerByCGLIB$$23265776_2.getIdAsString(<generated>)
I believe it's because I already had the other session.
So what I what to know is: is there any way to get the context created with the struts plugin?
I mean do something like:
Context ctx =(Context)request.getAttribute("spring.struts.cont ext);
So I can gen my beans like MyManager m = (MyManager)ctx.getBean("myManager");![]()
Please remember that I'm doing this from a tag library
Any Help is greatly appreciated
Andres


Reply With Quote