日期:2014-05-19  浏览次数:20682 次

cglib异常
applicationContex.xml

XML code

    <context:component-scan base-package="forum.zf"></context:component-scan>
    <tx:annotation-driven proxy-target-class="true" transaction-manager="transactionManager" />
    
    <!-- 定义一个c3p0数据源 -->
    <bean  id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close">
        <property name="driverClass" value="com.mysql.jdbc.Driver" />    
        <property name="jdbcUrl" value="jdbc:mysql://localhost/forum" />
        <property name="user"  value="root" />
        <property name="password" value="123" />
        <property name="maxPoolSize" value="40" />
        <property name="minPoolSize" value="1" />
        <property name="initialPoolSize" value="1"></property>
        <property name="maxIdleTime" value="20"></property>
    </bean>
    
    <!-- 定义hibernate的SessionFactory -->
    <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
        <!-- 制定数据源 -->
        <property name="dataSource" ref="dataSource" />
        <!-- 指定hibernate配置文件路径 -->
         <property name="configLocation" value="classpath:hibernate.cfg.xml" />
    </bean>
    
    <bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
        <property name="sessionFactory" ref="sessionFactory"></property>
    </bean>  
    
    <tx:advice id="transactionAdvice" transaction-manager="transactionManager" > 
        <tx:attributes>
            <tx:method name="*" read-only="false" propagation="REQUIRED" rollback-for="java.lang.Exception" />
        </tx:attributes>
    </tx:advice>   
    
    <aop:config>
        <aop:pointcut expression="execution(* forum.zf.service..*.*(..))" id="servicePointCut"/>
        <aop:advisor advice-ref="transactionAdvice" pointcut-ref="servicePointCut" />
    </aop:config>
      



异常

Java code

Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'PlateService' defined in file [E:\myeclipse_new\forum\WebRoot\WEB-INF\classes\forum\zf\service\PlateService.class]: Initialization of bean failed; nested exception is java.lang.VerifyError: class net.sf.cglib.core.DebuggingClassWriter overrides final method visit.(IILjava/lang/String;Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;)V
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:527)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
    at org.springframe