The moose likes Ant, Maven and Other Build Tools and the fly likes Facing a terrible problem with Maven update for an asm dependency Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Facing a terrible problem with Maven update for an asm dependency" Watch "Facing a terrible problem with Maven update for an asm dependency" New topic
Author

Facing a terrible problem with Maven update for an asm dependency

sandeeprajsingh tandon
Ranch Hand

Joined: Mar 06, 2009
Posts: 71
Hi,
I have the following jar added as a Maven dependecy C:\Documents and Settings\a161661\.m2\repository\cglib\cglib-nodep\2.1_3\cglib-nodep-2.1_3.jar.
Yet i am facing the following exception,.

Caused by: java.lang.NoClassDefFoundError: org/objectweb/asm/CodeVisitor
at net.sf.cglib.core.KeyFactory$Generator.generateClass(KeyFactory.java:165)
at net.sf.cglib.core.DefaultGeneratorStrategy.generate(DefaultGeneratorStrategy.java:25)
at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:216)


The Pom entry is as follows.
<dependency>
<groupId>asm</groupId>
<artifactId>asm</artifactId>
<version>2.2.3</version>
<scope>provided</scope>
</dependency>

The cglib-nodep-2.1_3.jar already contains the CodeVisitor class but it is net.sf.cglib.asm.CodeVisitor and not org/objectweb/asm/CodeVisitor as the Appllication Server seems to be searching for.
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5842
    
    7

You have the wrong dependency. Unfortunately, I could not find the ObjectWeb ASM library in the Maven repository (trying to find most things in there is like lookig for a needle in a haystack), so I cannot tell you what dependency you should have used. You can always download the JAR from the objectweb site and install it in your local repo.


JBoss In Action
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5842
    
    7

This is not and IDE issue, moving.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16233
    
  21

ObjectWeb may be maintaining its own Maven repository that needs adding to the POM. I haven't worked with any of their stuff since I got heavy into Maven, so I don't know.

You might consider asking in the appropriate ObjectWeb message forum, though. They're among the friendliest and helpful folks I've ever found supporting software.


Customer surveys are for companies who didn't pay proper attention to begin with.
sandeeprajsingh tandon
Ranch Hand

Joined: Mar 06, 2009
Posts: 71
You guys are the most helpful i have found on the net . I mean it.
Keep up the good work.

However, solved this issue with following entry. had to remove some entry. It was an expereiced guy who knew this error and the solution otherwise. i would have been lost. But only GOD knows what happened. This entry was done only to work the code on my machine. Rest all of my team mates didnot have to do the below entry. The entry that made it work on my machine is
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate</artifactId>
<version>3.2.5.ga</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>cglib</groupId>
<artifactId>cglib</artifactId>
</exclusion>
<exclusion>
<groupId>asm</groupId>
<artifactId>asm</artifactId>
</exclusion>
<exclusion>
<groupId>asm</groupId>
<artifactId>asm-attrs</artifactId>
</exclusion>
<exclusion>
<groupId>javax.transaction</groupId>
<artifactId>jta</artifactId>
</exclusion>
<exclusion>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
</exclusion>
</exclusions>
</dependency>
sandeeprajsingh tandon
Ranch Hand

Joined: Mar 06, 2009
Posts: 71
Not sure if the earlier message is posted.
You guys are the most helpful i have found on the net . I mean it.
Keep up the good work.

However, solved this issue with following entry. had to remove some entry. It was an expereiced guy who knew this error and the solution otherwise. i would have been lost. But only GOD knows what happened. This entry was done only to work the code on my machine. Rest all of my team mates didnot have to do the below entry. The entry that made it work on my machine is
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate</artifactId>
<version>3.2.5.ga</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>cglib</groupId>
<artifactId>cglib</artifactId>
</exclusion>
<exclusion>
<groupId>asm</groupId>
<artifactId>asm</artifactId>
</exclusion>
<exclusion>
<groupId>asm</groupId>
<artifactId>asm-attrs</artifactId>
</exclusion>
<exclusion>
<groupId>javax.transaction</groupId>
<artifactId>jta</artifactId>
</exclusion>
<exclusion>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
</exclusion>
</exclusions>
</dependency>
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Facing a terrible problem with Maven update for an asm dependency