开发者社区> 问答> 正文

spring异常。。。。

org.springframework.beans.factory.BeanCreationException: 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.hibernate.cfg.annotations.reflection.XMLContext$Default.getDelimitedIdentifier()Ljava/lang/Boolean;

Caused by: java.lang.NoSuchMethodError: org.hibernate.cfg.annotations.reflection.XMLContext$Default.getDelimitedIdentifier()Ljava/lang/Boolean;

哪位大神帮我看看,这个是spring的什么异常,需要怎么做?谢谢了!

展开
收起
a123456678 2016-03-19 09:40:42 2230 0
1 条回答
写回答
取消 提交回答
  • <?xml version="1.0" encoding="UTF-8"?>
    <!-- Spring配置文件 -->
    <beans xmlns="http://www.springframework.org/schema/beans"
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            xmlns:context="http://www.springframework.org/schema/context"
            xmlns:tx="http://www.springframework.org/schema/tx"
            xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
                    http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd
                    http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd">
     
        <bean id="sessionFactory"
            class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
            <property name="configLocation"
                value="classpath:hibernate.cfg.xml">
            </property>
        </bean>
         
        <!-- Dao层配置 -->
        <bean id="baseDao" class="tang.sys.dao.impl.BaseDao">
            <property name="sessionFactory">
                <ref bean="sessionFactory" />
            </property>
        </bean>
        <bean id="userDao" class="tang.sys.dao.impl.UserDao">
            <property name="sessionFactory">
                <ref bean="sessionFactory" />
            </property>
        </bean>
        <!-- 
        <bean id="userService" class="tang.sys.service.UserService">
            <property name="userDao" ref="userDao"></property>  
        </bean>
        <bean id="userAction" class="tang.sys.action.UserAction">
            <property name="userService" ref="userService"></property>  
        </bean>
        <bean id="saveUserAction" class="com.cqut.edu.action.user.SaveUserAction" scope="prototype">
            <property name="service" ref="userService"></property>
        </bean>
         
        <bean id="listUserAction" class="com.cqut.edu.action.user.ListUserAction" scope="prototype">
            <property name="service" ref="userService"></property>
         
         
        </bean>
        <bean id="removeUserAction" class="com.cqut.edu.action.user.RemoveUserAction" scope="prototype">
            <property name="service" ref="userService"></property>
        </bean>
         
        <bean id="updateUserAction" class="com.cqut.edu.action.user.UpdateUserAction" scope="prototype">
            <property name="service" ref="userService"></property>
        </bean>
        <bean id="updatePUserAction" class="com.cqut.edu.action.user.UpdatePUserAction" scope="prototype">
            <property name="service" ref="userService"></property>
        </bean>
         -->
    </beans> <span></span> <span></span> <?xml version='1.0' encoding='UTF-8'?>
    <!DOCTYPE hibernate-configuration PUBLIC
              "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
              "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"> <span></span> <!-- Generated by MyEclipse Hibernate Tools.                   -->
    <!-- Hibernate配置文件 -->
    <hibernate-configuration> <span></span> <session-factory>
        <property name="connection.url">
            jdbc:oracle:thin:@localhost:1521:XE
        </property>
        <property name="connection.username">SANSYO</property>
        <property name="connection.password">SANSYO</property>
        <property name="connection.driver_class">
            oracle.jdbc.driver.OracleDriver
        </property>
        <property name="dialect">
            org.hibernate.dialect.OracleDialect
        </property>
        <property name="show_sql">true</property>
        <mapping resource="tang/sys/entity/User.hbm.xml" class="tang.sys.entity.User"/>
     
    </session-factory>
     
    </hibernate-configuration>
    2019-07-17 19:07:18
    赞同 展开评论 打赏
问答分类:
问答标签:
问答地址:
相关产品:
问答排行榜
最热
最新

相关电子书

更多
云栖社区特邀专家徐雷Java Spring Boot开发实战系列课程(第20讲):经典面试题与阿里等名企内部招聘求职面试技巧 立即下载
微服务架构模式与原理Spring Cloud开发实战 立即下载
阿里特邀专家徐雷Java Spring Boot开发实战系列课程(第18讲):制作Java Docker镜像与推送到DockerHub和阿里云Docker仓库 立即下载

相关实验场景

更多