Announcement Announcement Module
No announcement yet.
Throws Advice Problem- At least one handler method must be f Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Throws Advice Problem- At least one handler method must be f

    Hi All,

    I have defined the throws advice like this -

    public class ExceptionAdvice implements ThrowsAdvice {

    private static final String ERROR = "An unexpected error ";
    private static long incidentSeed = 1;
    private transient Log logger = LoggingInit.getLog(ExceptionAdvice.class.getName() );

    * Public constructor required as per coding standards, but not for general consumption.
    public ExceptionAdvice() {

    void afterThrowing(Throwable throwable) {

    void afterThrowing(BusinessException be){

    if(logger.isInfoEnabled()) {;


    Please provide solution to following problem -
    When I configure this interceptor for my services bean, and start the app, I get following exception -

    org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'CachePopulator' defined in class path resource [global_beans.xml]: Initialization of bean failed; nested exception is org.aopalliance.aop.AspectException: null
    java.lang.IllegalArgumentException: At least one handler method must be found in class class com.mftl.gfas.common.ExceptionAdvice
    at org.springframework.aop.framework.adapter.ThrowsAd viceInterceptor.<init>(ThrowsAdviceInterceptor.jav a:77)
    at org.springframework.aop.framework.adapter.ThrowsAd viceAdapter.getInterceptor(ThrowsAdviceAdapter.jav a:41)
    at org.springframework.aop.framework.adapter.DefaultA dvisorAdapterRegistry.getInterceptor(DefaultAdviso
    at org.springframework.aop.framework.AdvisorChainFact oryUtils.calculateInterceptorsAndDynamicIntercepti onAdvice(
    at org.springframework.aop.framework.HashMapCachingAd visorChainFactory.getInterceptorsAndDynamicInterce ptionAdvice( :46)
    at org.springframework.aop.framework.Cglib2AopProxy$P roxyCallbackFilter.accept(
    at net.sf.cglib.proxy.Enhancer.emitMethods(Enhancer.j ava:950)
    at net.sf.cglib.proxy.Enhancer.emit( )
    at net.sf.cglib.proxy.Enhancer.generateClass(Enhancer .java:481)
    at net.sf.cglib.transform.TransformingClassGenerator. generateClass(
    at net.sf.cglib.core.DefaultGeneratorStrategy.generat e(
    at net.sf.cglib.core.AbstractClassGenerator.create(Ab
    at net.sf.cglib.proxy.Enhancer.createHelper(Enhancer. java:368)
    at net.sf.cglib.proxy.Enhancer.create( 80)
    at org.springframework.aop.framework.Cglib2AopProxy.g etProxy(
    at org.springframework.aop.framework.Cglib2AopProxy.g etProxy(
    at org.springframework.aop.framework.ProxyFactoryBean .getSingletonInstance(
    at org.springframework.aop.framework.ProxyFactoryBean .setBeanFactory(
    at AutowireCapableBeanFactory.createBean(AbstractAuto
    at AutowireCapableBeanFactory.createBean(AbstractAuto
    at BeanFactory.getBean(
    at BeanFactory.getBean(
    at istableBeanFactory.preInstantiateSingletons(Defaul
    at ationContext.refresh(AbstractApplicationContext.ja va:317)
    at plicationContext.<init>(ClassPathXmlApplicationCon
    at plicationContext.<init>(ClassPathXmlApplicationCon
    at com.mftl.gfas.util.BeanFactory.<init>(BeanFactory. java:41)
    at com.mftl.gfas.util.BeanFactory.instance(BeanFactor
    at com.mftl.gfas.servlet.initialisation.Initialisatio n.init(

  • #2
    Have you tried making the handler methods public?



    • #3
      Thanks Rob, for your timely help.

      Could please tell me from your experience for the following issues -
      1. In some scenarios we need to choose to go for Web Service or EJB.
      When should we be chossing one over another ?

      2. Could you be able to tell us about Hibernate - when we should
      look for JDBC based solution over Hibernate as for some complex
      queries and large results sets Hibernate doesn't perform well ?