wood burning stoves 2.0*
The moose likes Spring and the fly likes  spring AOP aspect4j logger on the spring mvc application Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Frameworks » Spring
Bookmark " spring AOP aspect4j logger on the spring mvc application" Watch " spring AOP aspect4j logger on the spring mvc application" New topic
Author

spring AOP aspect4j logger on the spring mvc application

john wutka
Ranch Hand

Joined: Apr 14, 2011
Posts: 31


When running spring AOP aspect4j logger on the spring mvc application getting above exception.


java.lang.IllegalStateException: Failed to load ApplicationContext
at org.springframework.test.context.TestContext.getApplicationContext(TestContext.java:203)


Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'updateIndicatorClient' defined in class path resource [applicationContext-xyz.xml]: Initialization of bean failed; nested exception is org.springframework.aop.framework.AopConfigException: Could not generate CGLIB subclass of class [class $Proxy15]: Common causes of this problem include using a final class or a non-visible class; nested exception is java.lang.IllegalArgumentException: Cannot subclass final class class $Proxy15


How can i resolve it. Please advise.
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17249
    
    6

Do you have the cglib jar file in your class path? The class that you want a proxy for, is it a final class? CGLIB extends your class to create a proxy for it.

The best overall solution is to code to interfaces. Have interfaces for your classes and implement them then and allow Spring to create DynamicProxy objects to proxy your object.

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: spring AOP aspect4j logger on the spring mvc application
 
Similar Threads
Problem with Spring AOP
Spring MVC AOP Logger
AOP configuration seems to be invalid
Spring AOP with mvc
AOP Not working with Spring 3 MVC application