Results 1 to 3 of 3

Thread: Failed to lazy load object with Hibernate when using AspectJ

  1. #1
    Join Date
    Sep 2006
    Posts
    10

    Default Failed to lazy load object with Hibernate when using AspectJ

    Hi,
    I am using AspectJ to dependency inject a domain object (domain.report.Report) and I'm using Hibernate for persistency.

    When I run a test that loads my object it worked fine, but when I try to load it using lazy loading I notice that the CGLIBLazyInitializer in his getProxy() method failed to create a Proxy to my object, and eventually The following exception is thrown:
    Code:
    org.springframework.beans.factory.NoSuchBeanDefinitionException: 
    No bean named 'domain.report.Report$$EnhancerByCGLIB$$ea01d7bc' is defined.
    Well... indeed no such bean (domain.report.Report$$EnhancerByCGLIB$$ea01d7bc) is defined in my spring's context files, my xmls populate bean for the real domain object which is domain.report.Report.

    I'm using Spring 2.0, @Configurable and <aop:spring-configured/>

    Thanks in advance.
    Guy.

  2. #2
    Join Date
    Sep 2004
    Location
    Texas
    Posts
    155

    Default

    If you are declaring a bean with id of domain.report.Report as a prototype in your applicationContext, then use the following annotation in your report class:

    @Configurable( "domain.report.Report" )

    If I understand your question correctly, this should cause it to find the correct prototype definition in your application context.
    Corby

  3. #3
    Join Date
    Sep 2006
    Posts
    10

    Smile Thank you very much

    Hi Corby,
    Thanks for your fast reply ,it solved my problem.

    Guy

Posting Permissions

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