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

Problem

In Hibernate development, it hits…


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

Solution

This is caused by the missing of asm.jar, you can get it from asm official website, or get it via Maven


<dependency>
	<groupId>asm</groupId>
	<artifactId>asm</artifactId>
	<version>3.3.1</version>
</dependency>

About the Author

author image
mkyong
Founder of Mkyong.com, love Java and open source stuff. Follow him on Twitter. If you like my tutorials, consider make a donation to these charities.

Comments

avatar
4 Comment threads
0 Thread replies
0 Followers
 
Most reacted comment
Hottest comment thread
4 Comment authors
Isuru GunawardanaDerrickNikhil DetheAJ Recent comment authors
newest oldest most voted
Isuru Gunawardana
Guest
Isuru Gunawardana

Hi Mkyong,

You always save our time :)
I had the same issue with a jax-rs (cxf | jsr311-api) application deployed in wso2 application server, and adding this dependency solve my problem.
Thank you verymuch.

Derrick
Guest
Derrick

Hi mkyong:

I got the same exception when i used Struts2-conversion-plugin.
Now it’s get working now.
Thanks very much

Nikhil Dethe
Guest
Nikhil Dethe

SEVERE: Unable to read class [org.action.BankmasterAction]
java.lang.NoClassDefFoundError: org/objectweb/asm/FieldVisitor
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
at org.glassfish.web.loader.WebappClassLoader.findClass(WebappClassLoader.java:927)
at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1476)
at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1359)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
at org.glassfish.web.loader.WebappClassLoader.findClass(WebappClassLoader.java:927)
at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1476)
at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1359)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
at com.opensymphony.xwork2.util.finder.ClassFinder.readClassDef(ClassFinder.java:782)
at com.opensymphony.xwork2.util.finder.ClassFinder.(ClassFinder.java:165)
at org.apache.struts2.convention.PackageBasedActionConfigBuilder.findActions(PackageBasedActionConfigBuilder.java:386)
at org.apache.struts2.convention.PackageBasedActionConfigBuilder.buildActionConfigs(PackageBasedActionConfigBuilder.java:344)
at org.apache.struts2.convention.ClasspathPackageProvider.loadPackages(ClasspathPackageProvider.java:53)
at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:245)
at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:66)
at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:390)
at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:437)
at org.apache.struts2.dispatcher.FilterDispatcher.init(FilterDispatcher.java:193)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:264)
at org.apache.catalina.core.ApplicationFilterConfig.(ApplicationFilterConfig.java:120)

AJ
Guest
AJ

As of April 2012, ASM can be downloaded from : http://forge.ow2.org/projects/asm/