---
title: "解决异常：java.lang.NoSuchMethodError: org.objectweb.asm.ClassWriter.<init>(Z)V"
author: "jadethao"
date: "2013-08-01T21:02:55Z"
tags: []
categories: ["开源软件"]
slug: "java-lang-nosuchmethoderror-org-objectweb-asm-classwriter-init-z-v"
draft: false
lastmod: "2013-08-01T21:03:24Z"
id: 1917618
url: "https://jadethao.iteye.com/blog/1917618"
---

启动服务报一下错误：
    严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource : Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: org.objectweb.asm.ClassWriter.<init>(Z)V
Caused by: java.lang.NoSuchMethodError: org.objectweb.asm.ClassWriter.<init>(Z)V

因为cglib 包和asm包冲突
 
开始用的cglib包是cglib-2.1.3.jar  ,后来换了一个cglib-nodep-2.2.jar才测试通过。
cglib-2.1.3.jar下载地址
<http://dl.iteye.com/topics/download/480dc687-6870-3f12-8362-f01f7e07ee17>