Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

javassit linkage error with spring-aop while deploying on websphere java 8 [SPR-16019] #20568

Closed
spring-projects-issues opened this issue Sep 27, 2017 · 1 comment
Assignees
Labels
in: core status: invalid

Comments

@spring-projects-issues
Copy link
Collaborator

@spring-projects-issues spring-projects-issues commented Sep 27, 2017

vkp opened SPR-16019 and commented

I have tried to deploy JDK1.8 compatible .EAR file on websphere java 8 . I am getting following exception

Caused by: java.lang.IllegalStateException: javassist.CannotCompileException: by java.lang.LinkageError: org.springframework.aop.framework.ProxyCreatorSupport
        at org.springframework.aop.framework.JavassistApplicationContext.<clinit>(JavassistApplicationContext.java:61)
        ... 114 more
Caused by: javassist.CannotCompileException: by java.lang.LinkageError: org.springframework.aop.framework.ProxyCreatorSupport
        at javassist.ClassPool.toClass(ClassPool.java:1120)
        at javassist.ClassPool.toClass(ClassPool.java:1063)
        at javassist.ClassPool.toClass(ClassPool.java:1021)
        at javassist.CtClass.toClass(CtClass.java:1259)
        at org.springframework.aop.framework.JavassistApplicationContext.<clinit>(JavassistApplicationContext.java:59)
        ... 114 more
Caused by: java.lang.LinkageError: org.springframework.aop.framework.ProxyCreatorSupport
        at java.lang.ClassLoader.defineClassImpl(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:346)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:283)
        at sun.reflect.GeneratedMethodAccessor17.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
        at java.lang.reflect.Method.invoke(Method.java:508)
        at javassist.ClassPool.toClass2(ClassPool.java:1133)
        at javassist.ClassPool.toClass(ClassPool.java:1114)
        ... 118 more    

I am using spring

<properties>
        <spring.version>4.2.5.RELEASE</spring.version>
        <spring-ws.version>2.4.0.RELEASE</spring-ws.version>
        <spring-security.version>4.0.0.RELEASE</spring-security.version>
        <slf4jVersion>1.6.1</slf4jVersion>
        <maven.test.skip>true</maven.test.skip>
        <junit.version>4.8.2</junit.version>
        <hibernate.version>3.5.6-Final</hibernate.version>
   </properties>

and javassit

<!-- Javassist -->
        <dependency>
            <groupId>javassist</groupId>
            <artifactId>javassist</artifactId>
            <version>3.19.0-GA</version>
        </dependency>

But when i deploy same application on JDK 1.6 , it was working fine with out any exception error .

I am getting errors on

package org.spring.aop.framework;

import javassist.ClassPool;
import javassist.CtClass;
import javassist.CtConstructor;
import javassist.LoaderClassPath;
import org.springframework.web.context.support.XmlWebApplicationContext;

public class JavassistApplicationContext extends XmlWebApplicationContext {

    static {
        ClassPool classPool = ClassPool.getDefault();
        try {
            ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
            classPool.appendClassPath(new LoaderClassPath(classLoader));

            CtClass cc = classPool.get("org.spring.aop.framework.ProxyCreatorSupport");
            CtConstructor c = cc.getConstructors()[0];
            c.insertAfter("$0.aopProxyFactory = new org.spring.aop.framework.JavassistAopProxyFactory();");
            cc.toClass();
        } catch (Exception e) {
            throw new IllegalStateException(e);
        }
    }
}

Any idea ? Anything i am missing ?


Affects: 4.3.5

@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Sep 27, 2017

Juergen Hoeller commented

Please note that we do not support Javassist proxies in the Spring AOP framework. Such custom Javassist setup classes are effectively part of your project, even if they got derived from somebody's Spring support classes. Since they are not an official part of Spring, we cannot provide any support for them and cannot spend any time debugging them either.

@spring-projects-issues spring-projects-issues added type: bug status: invalid in: core labels Jan 11, 2019
@spring-projects-issues spring-projects-issues removed the type: bug label Jan 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core status: invalid
Projects
None yet
Development

No branches or pull requests

2 participants