BeanFactory initial error !!Error creating bean with name 'SessionFactory' defined in class path resource [applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: org.objectweb.asm.ClassWriter.<init>(I)VSpring配置是这样的
<beans
xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:jdbc="http://www.springframework.org/schema/jdbc"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd">
     
   
    <bean id="dataSource"
class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"
p:driverClassName="${jdbc.driverClassName}" p:url="${jdbc.url}"
p:username="${jdbc.username}" p:password="${jdbc.password}" />
 <bean id="SessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
    
<property name="configLocation" value="classpath:hibernate.cfg.xml"></property>

     </bean>
     
      <bean id="userDao" class="com.yeahwap.bbs.dao.UserDao">
      <property name="sessionFactory" ref="SessionFactory"></property>
     </bean>
     <bean id="topicDao" class="com.yeahwap.bbs.dao.TopicDao">
      <property name="sessionFactory" ref="SessionFactory"></property>
     </bean>
     </beans>
     我是新手,拜托了~~~~~

解决方案 »

  1.   

    http://kui418882361.blog.163.com/blog/static/103216412010744319643/
      

  2.   

    BeanFactory initial error !!Error creating bean with name 'SessionFactory' defined in class path resource [applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: org.objectweb.asm.ClassWriter.<init>(I)V-------------
    SessionFactory这个beanId似乎没有init方法,可以仔细检查下。
      

  3.   

    这样的情况可能是缺少JAR包或者JAR包有重复、这两种情况都能引起一些奇怪的问题!仔细看看下了