Skip to content

Consider using javassist for proxy generation [SPR-5654] #10325

Closed

Description

@spring-projects-issues

Chris Koch opened SPR-5654 and commented

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.


Affects: 2.5.6

Attachments:

Issue Links:

39 votes, 42 watchers

Activity

  1. spring-projects-issues commented on Jul 13, 2010

    @spring-projects-issues
    CollaboratorAuthor

    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.

  2. spring-projects-issues commented on Jul 22, 2010

    @spring-projects-issues
    CollaboratorAuthor

    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.

  3. spring-projects-issues commented on Dec 22, 2010

    @spring-projects-issues
    CollaboratorAuthor

    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>

  4. spring-projects-issues commented on Mar 11, 2011

    @spring-projects-issues
    CollaboratorAuthor

    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.

  5. spring-projects-issues commented on Mar 23, 2012

    @spring-projects-issues
    CollaboratorAuthor

    Nikita Koksharov commented

    New patch version added, use 0001-from-CGLIB-to-Javassist-migration.patch.

  6. spring-projects-issues commented on Mar 23, 2012

    @spring-projects-issues
    CollaboratorAuthor

    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.

  7. spring-projects-issues commented on Mar 26, 2012

    @spring-projects-issues
    CollaboratorAuthor

    Chris Beams commented

    Thanks Nikita. Will take a look when we get to handling this issue.

  8. spring-projects-issues commented on Mar 30, 2012

    @spring-projects-issues
    CollaboratorAuthor

    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

  9. spring-projects-issues commented on May 26, 2012

    @spring-projects-issues
    CollaboratorAuthor

    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.

  10. spring-projects-issues commented on May 26, 2012

    @spring-projects-issues
    CollaboratorAuthor

    James Shaw commented

    Sorry, I couldn't find any more information than you have already.

  11. spring-projects-issues commented on May 26, 2012

    @spring-projects-issues
    CollaboratorAuthor

    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

  12. spring-projects-issues commented on Apr 12, 2013

    @spring-projects-issues
    CollaboratorAuthor

    Will Hoover commented

    MAT shows memory leaks caused by org.springframework.cglib.proxy.Enhancer using 3.2.0.RELEASE.

  13. spring-projects-issues commented on Apr 13, 2013

    @spring-projects-issues
    CollaboratorAuthor

    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

  14. spring-projects-issues commented on Jan 2, 2014

    @spring-projects-issues
    CollaboratorAuthor

    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.

  15. added
    status: declined
    type: enhancement
    in: core
    has: votes-jira
    on Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

has: votes-jirain: corestatus: declinedtype: enhancement

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions