It's not a secret anymore!*
The moose likes Spring and the fly likes Facing AopConfigException in a class where @Cacheable is used Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Facing AopConfigException in a class where @Cacheable is used" Watch "Facing AopConfigException in a class where @Cacheable is used" New topic

Facing AopConfigException in a class where @Cacheable is used

raghav prakasam

Joined: Jun 29, 2009
Posts: 23

Below is the Error which am facing while starting up the server(JBoss) while spring container is trying to create a bean.


org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'workspaceLabelProvider' defined in ServletContext resource [/WEB-INF/classes/applicationContext.xml]: Initialization of bean failed; nested exception is org.springframework.aop.framework.AopConfigException: Cannot proxy target class because CGLIB2 is not available. Add CGLIB to the class path or specify proxy interfaces.

Below is my applicationContext.xml entry for the bean 'workspaceLabelProvider'

Actually the code is properly working in Weblogic but its not in Jboss 6.0.Even i have included cglib2.2 and cglib-nodep2.2 jars in the project's lib folder.

As well I have tried with the below entries in the context xml too:

Please anyone try to provide me a possible workarounds.
Bill Gorder

Joined: Mar 07, 2010
Posts: 1648

The newest version of Spring should include this stuff for you. If you are using an older version you need to bring that dependency in explicitly.

[How To Ask Questions][Read before you PM me]
I agree. Here's the link:
subject: Facing AopConfigException in a class where @Cacheable is used
Similar Threads
Problem with @Transactional annotation
Instantiated bean with private Constructor
Context Initialization Failed
Spring AOP issue
Spring IOC issues in MVC WebApplication with JSF integration