Re: LambdaJ and ClassNotFoundException: net.sf.cglib.proxy.MethodInterceptor

628 views
Skip to first unread message

Mario Fusco

unread,
Jul 11, 2012, 9:57:30 AM7/11/12
to lam...@googlegroups.com
Hi Alexandre,

are you sure you don't have another version of cglib in your classpath different from the one used by lambdaj? In an indirect dependency maybe?

Mario

Alexandre Bizeau

unread,
Jul 11, 2012, 10:00:48 AM7/11/12
to lam...@googlegroups.com
Hello Mario,

No, I'm really sure. There my full pom :

<dependencies>

        <dependency>
            <groupId>groupelti</groupId>
            <artifactId>expertisepersistence</artifactId>
            <version>0.1</version>
        </dependency>

        <dependency>
            <groupId>groupelti</groupId>
            <artifactId>portailpersistence</artifactId>
            <version>0.1</version>
        </dependency>         

        <dependency>
            <groupId>com.groupelti.sio</groupId>
            <artifactId>limspersistence</artifactId>
            <version>1.2</version>
         </dependency>

        <!--<dependency>
            <groupId>groupelti</groupId>
            <artifactId>laboratoireslti</artifactId>
            <version>1.0</version>
        </dependency>-->

        <dependency>
            <groupId>org.apache.struts</groupId>
            <artifactId>struts2-core</artifactId>
            <version>2.3.1.2</version>
        </dependency>

        <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
            <version>1.2.16</version>
        </dependency>

        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>servlet-api</artifactId>
            <version>2.5</version>
        </dependency>

        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-core</artifactId>
            <version>3.6.10.Final</version>
        </dependency>

        <dependency>
            <groupId>com.jgeppert.struts2.jquery</groupId>
            <artifactId>struts2-jquery-plugin</artifactId>
            <version>3.3.1</version>
        </dependency>
   
        <dependency>
            <groupId>com.jgeppert.struts2.jquery</groupId>
            <artifactId>struts2-jquery-tree-plugin</artifactId>
            <version>3.3.1</version>
        </dependency>

        <dependency>
            <groupId>com.jgeppert.struts2.jquery</groupId>
            <artifactId>struts2-jquery-grid-plugin</artifactId>
            <version>3.3.1</version>
            </dependency>
   
        <dependency>
            <groupId>org.apache.struts</groupId>
            <artifactId>struts2-junit-plugin</artifactId>
            <version>2.3.1.2</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.apache.struts</groupId>
            <artifactId>struts2-json-plugin</artifactId>
            <version>2.3.4</version>
        </dependency>
        <dependency>
            <groupId>org.apache.struts</groupId>
            <artifactId>struts2-convention-plugin</artifactId>
            <version>2.3.1.2</version>
        </dependency>

        <!--<dependency>
                <groupId>com.googlecode.lambdaj</groupId>
                <artifactId>lambdaj</artifactId>
                <version>2.3.3</version>
        </dependency>-->

        <dependency>
                <groupId>com.googlecode.lambdaj</groupId>
                <artifactId>lambdaj</artifactId>
                <version>2.4</version>
             <scope>system</scope>
            <systemPath>${basedir}/src/main/webapp/WEB-INF/lib/lambdaj-2.4-with-dependencies.jar</systemPath>
        </dependency>

        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest-integration</artifactId>
            <version>1.2.1</version>
        </dependency>           
          

    </dependencies>

2012/7/11 Mario Fusco <mario...@gmail.com>

Uwe Schäfer

unread,
Jul 11, 2012, 10:03:54 AM7/11/12
to lam...@googlegroups.com
On 07/11/2012 04:00 PM, Alexandre Bizeau wrote:

Hi Alexandre
> No, I'm really sure. There my full pom :

you may want to check the effective pom:

mvn help:effective-pom

cu uwe

Mario Fusco

unread,
Jul 11, 2012, 10:07:24 AM7/11/12
to lam...@googlegroups.com
For sure at least hibernate uses cglib internally.

Alexandre Bizeau

unread,
Jul 11, 2012, 10:21:07 AM7/11/12
to lam...@googlegroups.com
Okay, so What can I do ? I'm not really sure to understand.

2012/7/11 Mario Fusco <mario...@gmail.com>

Mario Fusco

unread,
Jul 11, 2012, 10:27:48 AM7/11/12
to lam...@googlegroups.com
lambdaj uses version 2.2.2 of cglib.
Try to explicitly add it to your pom.

Alexandre Bizeau

unread,
Jul 11, 2012, 10:42:59 AM7/11/12
to lam...@googlegroups.com
It's still doesn't work right now. I added the cglib 2.2.2 dependency

2012/7/11 Mario Fusco <mario...@gmail.com>

Alexandre Bizeau

unread,
Jul 11, 2012, 10:53:42 AM7/11/12
to lam...@googlegroups.com

Try with lambdaj 2.3.3 and cglib 2.2.2. The error still there. I really don't understand this... Really strange.


<dependency>
            <groupId>com.googlecode.lambdaj</groupId>
            <artifactId>lambdaj</artifactId>
            <version>2.3.3</version>
         <exclusions>
          <exclusion>
           <artifactId>cglib-nodep</artifactId>
           <groupId>cglib</groupId>
          </exclusion>
          <exclusion>
           <artifactId>hamcrest-all</artifactId>
           <groupId>org.hamcrest</groupId>
          </exclusion>
         </exclusions>
        </dependency>

<dependency>
            <groupId>cglib</groupId>
            <artifactId>cglib</artifactId>
            <version>2.2.2</version>
        </dependency>






2012/7/11 Alexandre Bizeau <alexand...@gmail.com>

Uwe Schäfer

unread,
Jul 11, 2012, 10:55:47 AM7/11/12
to lam...@googlegroups.com
On 07/11/2012 04:42 PM, Alexandre Bizeau wrote:
> <dependency>
> <groupId>com.googlecode.lambdaj</groupId>
> <artifactId>lambdaj</artifactId>
> <version>2.4</version>
> <scope>system</scope>
> <systemPath>${basedir}/src/main/webapp/WEB-INF/lib/lambdaj-2.4-with-dependencies.jar</systemPath>
> </dependency>
i guess if you include the -with-dependencies artifact, there is a cglib
version already included, thus you'd need to exclude yours.

my suggestion: use the

<dependency>
<groupId>com.googlecode.lambdaj</groupId>
<artifactId>lambdaj</artifactId>
<version>2.4</version>
</dependency>

instead and keep your direct dependency to cglib in the pom.

cu uwe

Alexandre Bizeau

unread,
Jul 11, 2012, 10:59:39 AM7/11/12
to lam...@googlegroups.com
The 2.4 version it's not on maven repo right now. So i tried with the 2.3.3 because I'm not using new features right now. But with 2.3.3 and cglib 2.2.2, this still doesn't work and every dependency are compile well.

2012/7/11 Uwe Schäfer <u...@thomas-daily.de>

Mario Fusco

unread,
Jul 11, 2012, 11:23:42 AM7/11/12
to lam...@googlegroups.com
I guess you could try to also exclude cglib from the hibernate's dependencies and all other projects using it.
After that I don't know what else you could do :(

Alexandre Bizeau

unread,
Jul 11, 2012, 11:29:37 AM7/11/12
to lam...@googlegroups.com
I already looked and There no cglib include with hibernate dependecy

2012/7/11 Mario Fusco <mario...@gmail.com>

Raf

unread,
Jul 12, 2012, 3:09:32 AM7/12/12
to lam...@googlegroups.com
Try using  mvn dependency:tree to check the full tree of your dependencies.

Bye
Raf

Alexandre Bizeau

unread,
Jul 12, 2012, 8:39:43 AM7/12/12
to lam...@googlegroups.com
Everything looks good :

 --- maven-dependency-plugin:2.1:tree (default-cli) @ portailclient ---
[INFO] groupelti:portailclient:war:0.1
[INFO] +- groupelti:expertisepersistence:jar:0.1:compile
[INFO] +- groupelti:portailpersistence:jar:0.1:compile
[INFO] +- com.groupelti.sio:limspersistence:jar:1.2:compile
[INFO] +- org.apache.struts:struts2-core:jar:2.3.1.2:compile
[INFO] |  +- org.apache.struts.xwork:xwork-core:jar:2.3.1.2:compile
[INFO] |  |  \- asm:asm-commons:jar:3.3:compile
[INFO] |  |     \- asm:asm-tree:jar:3.3:compile
[INFO] |  +- org.freemarker:freemarker:jar:2.3.18:compile
[INFO] |  +- ognl:ognl:jar:3.0.4:compile
[INFO] |  |  \- javassist:javassist:jar:3.11.0.GA:compile
[INFO] |  +- commons-fileupload:commons-fileupload:jar:1.2.2:compile
[INFO] |  \- commons-io:commons-io:jar:2.0.1:compile
[INFO] +- log4j:log4j:jar:1.2.16:compile
[INFO] +- javax.servlet:servlet-api:jar:2.5:compile
[INFO] +- org.hibernate:hibernate-core:jar:3.6.10.Final:compile
[INFO] |  +- antlr:antlr:jar:2.7.6:compile
[INFO] |  +- commons-collections:commons-collections:jar:3.1:compile
[INFO] |  +- dom4j:dom4j:jar:1.6.1:compile
[INFO] |  +- org.hibernate:hibernate-commons-annotations:jar:3.2.0.Final:compile
[INFO] |  +- org.hibernate.javax.persistence:hibernate-jpa-2.0-api:jar:1.0.1.Final:compile
[INFO] |  +- javax.transaction:jta:jar:1.1:compile
[INFO] |  \- org.slf4j:slf4j-api:jar:1.6.1:compile
[INFO] +- com.jgeppert.struts2.jquery:struts2-jquery-plugin:jar:3.3.1:compile
[INFO] |  \- org.apache.velocity:velocity:jar:1.5:compile
[INFO] |     \- oro:oro:jar:2.0.8:compile
[INFO] +- com.jgeppert.struts2.jquery:struts2-jquery-tree-plugin:jar:3.3.1:compile
[INFO] |  \- commons-beanutils:commons-beanutils:jar:1.7.0:compile
[INFO] |     \- commons-logging:commons-logging:jar:1.0.3:compile
[INFO] +- com.jgeppert.struts2.jquery:struts2-jquery-grid-plugin:jar:3.3.1:compile
[INFO] +- org.apache.struts:struts2-junit-plugin:jar:2.3.1.2:test
[INFO] |  +- org.springframework:spring-test:jar:3.0.5.RELEASE:test
[INFO] |  +- org.springframework:spring-core:jar:3.0.5.RELEASE:test
[INFO] |  |  \- org.springframework:spring-asm:jar:3.0.5.RELEASE:test
[INFO] |  +- org.springframework:spring-context:jar:3.0.5.RELEASE:test
[INFO] |  |  +- org.springframework:spring-aop:jar:3.0.5.RELEASE:test
[INFO] |  |  |  \- aopalliance:aopalliance:jar:1.0:test
[INFO] |  |  +- org.springframework:spring-beans:jar:3.0.5.RELEASE:test
[INFO] |  |  \- org.springframework:spring-expression:jar:3.0.5.RELEASE:test
[INFO] |  \- junit:junit:jar:4.8.2:test
[INFO] +- org.apache.struts:struts2-json-plugin:jar:2.3.4:compile
[INFO] |  \- org.apache.commons:commons-lang3:jar:3.1:compile
[INFO] +- org.apache.struts:struts2-convention-plugin:jar:2.3.1.2:compile
[INFO] |  \- commons-lang:commons-lang:jar:2.5:compile
[INFO] +- cglib:cglib:jar:2.2.2:compile
[INFO] |  \- asm:asm:jar:3.3.1:compile
[INFO] +- com.googlecode.lambdaj:lambdaj:jar:2.3.3:compile
[INFO] |  \- org.objenesis:objenesis:jar:1.2:compile
[INFO] \- org.hamcrest:hamcrest-integration:jar:1.2.1:compile
[INFO]    \- org.hamcrest:hamcrest-library:jar:1.2.1:compile
[INFO]       \- org.hamcrest:hamcrest-core:jar:1.2.1:compile
[INFO] ------------------------------------------------------------------------


2012/7/12 Raf <r.ven...@gmail.com>

Alexandre Bizeau

unread,
Jul 12, 2012, 8:41:50 AM7/12/12
to lam...@googlegroups.com
cglib give asm:asm and my struts2-core gives asm:commons and asm:tree, Did you think that can conflict ? I'm really not sure because the error is a ClassNotFound on cglib/proxy



2012/7/12 Alexandre Bizeau <alexand...@gmail.com>

Alexandre Bizeau

unread,
Jul 13, 2012, 9:44:24 AM7/13/12
to lam...@googlegroups.com
FOUNDED FINALLY ! With this site :
http://javarevisited.blogspot.ca/2011/06/noclassdeffounderror-exception-in.html

I look on classpath and everything was good. Until i see : lambdaJ-2.4.jar into my JVM/JRE/ext.

I think there was a conflict between this lib and the lambdaJ loaded with my pom.xml !

It's work fine now ! :)

Alex


2012/7/12 Alexandre Bizeau <alexand...@gmail.com>
Reply all
Reply to author
Forward
0 new messages