Share on Google+Share on Google+

Spring asm Dependency

The asm Dependency in Spring applications.

Spring 3 ASM - Spring asm Dependency


In earlier version of Spring (Spring version 2.5) the asm library was included. But the current version of Spring 3 does not contains the asm library. So, you have to download and add the asm library to your project.

In this section you will find the instruction to download and add the asm library into your project.

What is ASM?

The ASM is very small framework that is used to analyze and manipulate Java byte codes. It is used in Spring 3 framework to dynamically modify the Java bytecode and generate the new bye code in runtime. The ASM framework is easy to use and fast. Its performance is good. You can read more about the asm framework at The latest version of asm library can be downloaded from If you getting any error in your Spring framework then you can get the latest version of asm library from the asm official website.

If you don't include the asm dependency in your Spring 3 project you might get the following error:

Jan 2, 2010 2:49:26 PM prepareRefresh

INFO: Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@1a05308:
startup date [Sat Jan 02 14:49:26 IST 2010]; root of context hierarchy

Exception in thread "main" java.lang.IllegalStateException: Cannot load configuration class: net.roseindia.Spring3HelloWorldConfig

at org.springframework.context.annotation.ConfigurationClassPostProcessor.enhanceConfiguration

at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBean




at org.springframework.context.annotation.Annotation

at net.roseindia.Spring3HelloWorldConfigTest.main(

Caused by: java.lang.NoClassDefFoundError: org/objectweb/asm/Type

at net.sf.cglib.core.TypeUtils.parseType(

at net.sf.cglib.core.KeyFactory.<clinit>(

at net.sf.cglib.proxy.Enhancer.<clinit>(

at org.springframework.context.annotation.ConfigurationClass

at org.springframework.context.annotation.Configuration

at org.springframework.context.annotation.Configuration

... 6 more

Caused by: java.lang.ClassNotFoundException: org.objectweb.asm.Type

at$ Source)

at Method)

at Source)

at java.lang.ClassLoader.loadClass(Unknown Source)

at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)

at java.lang.ClassLoader.loadClass(Unknown Source)

at java.lang.ClassLoader.loadClassInternal(Unknown Source)

... 12 more

If you are using the maven to for development of your project then following entry can be added to pom.xml


The above dependency entry will add include asm library into your project.



Posted on: January 2, 2010 If you enjoyed this post then why not add us on Google+? Add us to your Circles

Share this Tutorial Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Discuss: Spring asm Dependency  

Post your Comment

Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
May 2, 2011

Hi, Good really useful information on Spring asm Dependency. Thanks