我用spring2.5+Hibernate3.2做自动装配的一个例子,在applicationContext.xml中添加了<context:component-scan base-package="com.demo.mini.service" />后配置文件报错:
Unexpected exception parsing XML document from file [D:/JavaWork/workspace/mini/src/applicationContext.xml]; nested exception is java.lang.NoSuchMethodError: org.objectweb.asm.ClassReader.accept(Lorg/objectweb/asm/ClassVisitor;Z)Vasm2.2.3.jar已经删除了,程序可以正常运行.因为配置文件报错,没法生成Hibernate3.2提供的具有注解功能的POJO。Add Hibernate mapping annotations to POJO (Hibernate3.2 only)  这一项是没法选的,
如果把spring配置文件applicationContext.xml中的<context:component-scan base-package="com.demo.mini.service" />这段代码取掉,就不会出现上面的问题,请问如何解决这个问题呢?

解决方案 »

  1.   

    如果没猜错,应该是<context:component-scan base-package="com.demo.mini.service" />这里面的配置有问题吧,所以这个东西根本就没起作用,程序走的是其他的方式访问啊,因为代码太少,无法做出更多判断了哦
      

  2.   

    那个ssh的零配置struts2,spring,还好搞,hibernate的有一点麻烦
      

  3.   

    我用的自动装配, <context:component-scan base-package="com.demo.mini.service" />这个可以扫描com.demo.mini.service包下面的自动装配,运行也没问题,就是配置文件报错,还没无法解决,期待。
      

  4.   

    楼主:asm2.2.3.jar已经删除了这个不要删,删asm-2.2.3.jar