• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Handling Exception in Spring

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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.
 
Hey, sticks and stones baby. And maybe a wee mention of my stuff:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic