You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Consider using javassist for proxy generation [SPR-5654] #10325
has: votes-jiraIssues migrated from JIRA with more than 10 votes at the time of importin: coreIssues in core modules (aop, beans, core, context, expression)status: declinedA suggestion or change that we don't feel we should currently applytype: enhancementA general enhancement
cglib doesn't appear to be an active project anymore. It'd be nice if there was a way we could specify javassist as our bytecode instrumentation utility.
For users which use another framework already using javassist (like hibernate, seam) this would be a nice addition to the framework, that way they would only have to rely in 1 bytecode library instead of 2.
I suggest to use my patch for Javassist (3.12 and higher) support.
If you don't want to wait of 3.1 release or patch Spring you could just copy (JavassistAopProxy.java, JavassistAopProxyFactory.java, JavassistApplicationContext.java) sources to your own project and use JavassistApplicationContext as spring application context.
For example, if you use ContextLoaderListener in web.xml just add follow lines:
There have indeed been a number of requests within and without the team to either replace CGLIB or at least allow for alternatives such as javassist. We'll look at this during the 3.2 timeline.
Interesting, James - thanks for the heads-up. Are you seeing a changelog anywhere? Looks like there's been some serious modification to support ASM 4, but beyond that I'm not sure what's included in the release.
cglib now uses ASM4. Due to API incompatibilities in ASM4, we've bumped the cglib version number to 3.0. If you still need ASM3 or earlier, we recommend that you continue to use cglib 2.2.2.
2012-05-25 16:05:05 PDT by jmanson
has: votes-jiraIssues migrated from JIRA with more than 10 votes at the time of importin: coreIssues in core modules (aop, beans, core, context, expression)status: declinedA suggestion or change that we don't feel we should currently applytype: enhancementA general enhancement
Activity
spring-projects-issues commentedon Jul 13, 2010
Marten Deinum commented
There seem to be multiple requests (#7964, #9663) for adding javassist proxies to the spring framework instead of only cglib. Also in the forum there is some activity/questions regarding that support. Someone also implemented a working version (http://forum.springsource.org/showthread.php?t=77971) and provided it to the community.
For users which use another framework already using javassist (like hibernate, seam) this would be a nice addition to the framework, that way they would only have to rely in 1 bytecode library instead of 2.
spring-projects-issues commentedon Jul 22, 2010
Ricardo Tercero Lozano commented
Cglib has side effects handling signed jars. See
https://jira.jboss.org/browse/JBPAPP-2971
and due to activity on proyect, it can be considered dead. I added a vote on supporting javassist instead of cglib.
spring-projects-issues commentedon Dec 22, 2010
Nikita Koksharov commented
I suggest to use my patch for Javassist (3.12 and higher) support.
If you don't want to wait of 3.1 release or patch Spring you could just copy (JavassistAopProxy.java, JavassistAopProxyFactory.java, JavassistApplicationContext.java) sources to your own project and use JavassistApplicationContext as spring application context.
For example, if you use ContextLoaderListener in web.xml just add follow lines:
<context-param>
<param-name>contextClass</param-name>
<param-value>org.springframework.aop.framework.JavassistApplicationContext</param-value>
</context-param>
spring-projects-issues commentedon Mar 11, 2011
Chris Beams commented
There have indeed been a number of requests within and without the team to either replace CGLIB or at least allow for alternatives such as javassist. We'll look at this during the 3.2 timeline.
spring-projects-issues commentedon Mar 23, 2012
Nikita Koksharov commented
New patch version added, use 0001-from-CGLIB-to-Javassist-migration.patch.
spring-projects-issues commentedon Mar 23, 2012
Nikita Koksharov commented
Use sources standalone-sources.zip to begin javassist usage without spring patching. Also you could send me feedback about how it works for you.
spring-projects-issues commentedon Mar 26, 2012
Chris Beams commented
Thanks Nikita. Will take a look when we get to handling this issue.
spring-projects-issues commentedon Mar 30, 2012
Nikita Tovstoles commented
hello, please don't ditch cglib altogether (leave an option to keep using it, or at least profile before making the switch). we're seeing considerable perf problems with javassist in current form:
https://issues.jboss.org/browse/JASSIST-163
spring-projects-issues commentedon May 26, 2012
James Shaw commented
FWIW, cglib 3.0 appears to have been released yesterday: http://sourceforge.net/projects/cglib/files/cglib3/3.0/
spring-projects-issues commentedon May 26, 2012
Chris Beams commented
Interesting, James - thanks for the heads-up. Are you seeing a changelog anywhere? Looks like there's been some serious modification to support ASM 4, but beyond that I'm not sure what's included in the release.
spring-projects-issues commentedon May 26, 2012
James Shaw commented
Sorry, I couldn't find any more information than you have already.
spring-projects-issues commentedon May 26, 2012
Eduardo Macarron commented
Chris, James, all I could find is this:
http://sourceforge.net/news/?group_id=56933
cglib now uses ASM4. Due to API incompatibilities in ASM4, we've bumped the cglib version number to 3.0. If you still need ASM3 or earlier, we recommend that you continue to use cglib 2.2.2.
2012-05-25 16:05:05 PDT by jmanson
spring-projects-issues commentedon Apr 12, 2013
Will Hoover commented
MAT shows memory leaks caused by org.springframework.cglib.proxy.Enhancer using 3.2.0.RELEASE.
spring-projects-issues commentedon Apr 13, 2013
Chris Beams commented
Will Hoover, do you see the same against 3.2.2.RELEASE? There have been recent changes in this area. /cc Phil Webb
spring-projects-issues commentedon Jan 2, 2014
Juergen Hoeller commented
CGLIB recently saw a 3.1 release, so it is at least somewhat active...
We generally stick with our use of repackaged CGLIB, ASM and Objenesis variants for the time being. There are no concrete plans for a migration here.