Announcement Announcement Module
Collapse
No announcement yet.
Failed to lazy load object with Hibernate when using AspectJ Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    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.

    Comment


    • #3
      Thank you very much

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

      Guy

      Comment

      Working...
      X