Results 1 to 2 of 2

Thread: AopConfigException - Superclass has no null constructors but no arguments were given

  1. #1

    Question AopConfigException - Superclass has no null constructors but no arguments were given

    After upgrading to the 3.1.3, I run into the following error during the start up.

    Code:
    org.springframework.aop.framework.AopConfigException: Could not generate CGLIB subclass of class [class com.abc.myapp.mypackage.service.aop.BeforeDoingIt]: Common causes of this problem include using a final class or a non-visible class; nested exception is java.lang.IllegalArgumentException: Superclass has no null constructors but no arguments were given
    This problem is solved after adding a non-argument constructor.

    Any document on this change?

    Is the following the reason? If so, why it didn't occur before?
    Since Spring AOP uses either J2SE dynamic proxies basing on an interface or aspectj CGLIB proxies, every class will either need an interface (for simple proxy based aspect weaving) or a constructor without any parameters (for cglib weaving). The constructor can be private.
    Thanks.
    Last edited by vw729; Nov 21st, 2012 at 06:39 PM.
    [URL="http://vicina.info"] 新闻,社区新闻,分类广告

  2. #2
    Join Date
    Dec 2009
    Location
    India
    Posts
    108

    Default

    There can be a lot of reasons why it wasn't happening before, but as mentioned youself, for class-based proxying, you gotto have a zero-arg constructor. Did you change the pointcut expressions after upgrade or enabled class based proxying just after this upgrade? Can you confirm?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •