Question

Hope you can help with this. I'm using the Spring @Transactional annotation to mark a method transactional, and I have the requisite <tx:annotation-driven transaction-manager="txManager"/>. I'm including Spring 2.5.6 and cglib 2.1_3 in my build.

On deployment (to a Websphere 7 runtime), I see bean creation exceptions, with the root cause:

Caused by: java.lang.AbstractMethodError: net/sf/cglib/core/ClassGenerator.generateClass(Lnet/sf/cglib/asm/ClassVisitor;)V
    at net.sf.cglib.core.DefaultGeneratorStrategy.generate(DefaultGeneratorStrategy.java:25)
    at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:216)
    at net.sf.cglib.proxy.Enhancer.createHelper(Enhancer.java:377)
...and so on

I figure that this means that we are calling the generateClass(...) method on an instance of AbstractClassGenerator, which does not implement that method. As all that stuff seems to be transparently set up in Spring, I'm not sure where to go from here to fix the problem though... any ideas?

Was it helpful?

Solution

I'm guessing you have multiple copies of cglib kicking around. Does your app server have it's own copy? if so, you're better not including it in your application as well.

Another possibility is that you're missing asm.jar, although the error would likely say something different in that case.

OTHER TIPS

As Skaffman suggested check if there is a duplicate copy of cglib. I don't have a WAS 7 handy with me but i looked at my WPS 7 which is built on top of WAS 7 and noticed that there is a JAR - cglib-nodep-2.1_3.jar which is part of the SCA feature pack.

Do you have the SCA feature pack on your machine and see if this file exists there.

I would turn on class loading trace to see which Jar is this class being picked up from and do a cavaj on it to see what are the methods supported by it.

It beats me too when you say that concrete subclass seems to solve this problem!. As mentioned above, i would first locate the Jar that loads these classes during runtime and then figure out what is happening.

HTH Manglu

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top