• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Tim Cooke
  • Devaka Cooray
  • Ron McLeod
  • Jeanne Boyarsky
  • Liutauras Vilda
  • paul wheaton
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
  • Tim Holloway
  • Martijn Verburg
  • Frits Walraven
  • Himai Minh

Spring-Hibernate: proxy Session closed

Ranch Hand
Posts: 148
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi guys,

I'm using Spring and Hibernate in my Web application. When I try to access a hibernate object from my struts action class or my JSP page, I get an exception stating:

Uncaught exception thrown in one of the service methods of the servlet: action. Exception thrown : javax.servlet.ServletException: could not initialize proxy - the owning Session was closed

Does anyone know what I'm doing wrong and how to solve the problem.

Here's my code:


<!-- =================== Define Spring Bean Definition Files to be loaded ================== -->



<!-- =================== Spring Context Loader Servlet ================== -->

////JAVA CODE//////

BusinessServiceCbo businessServiceCbo = new
BusinessCbo businessCbo = new BusinessCbo();
businessCbo = businessDao.findById(businessId);

List serviceList = new ArrayList( businessCbo.getBusinessServices());


System.out.println("Service List: " + businessDetailDto.getServiceList()); //error occurs here!!!

///APPLiCATION Context.xml /////

<bean id="businessBSTarget" class="com.PBCoreApp.business.impl.BusinessBSImpl">
<property name="businessDao"><ref local="businessDao" /></property>
<bean id="businessBS" class="org.springframework.aop.framework.ProxyFactoryBean">
<property name="proxyInterfaces">
<property name="target">
<ref local="businessBSTarget" />
<property name="interceptorNames">


<!-- ============================= Spring Plugin ================================== -->

<plug-in className="org.springframework.web.struts.ContextLoaderPlugIn">
value="/WEB-INF/presentationContext.xml classpath*:com/PBCoreApp/architecture/applicationContext.xml" />

The only taste of success some people get is to take a bite out of you. Or this tiny ad:
the value of filler advertising in 2021
    Bookmark Topic Watch Topic
  • New Topic