• 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
  • Tim Cooke
  • Devaka Cooray
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Martijn Verburg
  • Frits Walraven
  • Himai Minh

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.
 
Have you no shame? Have you no decency? Have you no tiny ad?
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic