• 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 ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Handling Exception in Spring

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

How do I handle exception in the spring 1.2.7 framework.

Regards,
Karthik.
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You handle exceptions as you would with any Java program. Or do you have anything more specific in mind ?
 
Karthik Revanasiddan
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Am using struts 1.2.8 + spring 1.2.7 + hibernate 3 in my project.

Handling StaleObjectStateException

I want to handle above mentioned exception in the service layer(spring). I have done necessary configuration in the spring configuration file. But still the exception is not handle. I came to know this by the stack trace which is printed on my console. I have created an advice or Interceptor which implemets the ThrowsAdvice interface which consists of the method afterThrowing(). I have performed necessary configuration in the spring configuration as shown below but the still stack trace is thrown.

Code in Advice or Interceptor class:

public void afterThrowing(StaleObjectStateException sose)
{
System.out.println("StaleObjectStateException exception is thrown");
}

<bean id="entityObjectStateExceptionAdvice" class="com.deemsys.elearn.arch.throwsadvice.EntityObjectStateExceptionAdvice"/>

<bean id="baseService" class="org.springframework.aop.framework.ProxyFactoryBean" abstract="true">
<property name="interceptorNames">
<list>
<value>globalDebugInterceptor</value> <value>globalPerformanceMonitorInterceptor</value>
<value>serviceInterceptor</value>
<value>transactionInterceptor</value>
<value>serviceSecurityInterceptor</value>
<value>entityObjectStateExceptionAdvice</value>
</list>
</property>
</bean>

How to handle this issue.

Regards,
Karthik.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic