邵跑跑 2017-03-30 13:06 采纳率: 100%
浏览 1689
已采纳

spring获取不到hibernate的sessionFactory

错误信息如下
信息: Initializing Spring root WebApplicationContext

  • Root WebApplicationContext: initialization started
  • Refreshing Root WebApplicationContext: startup date [Thu Mar 30 21:02:38 CST 2017]; root of context hierarchy
  • Loading XML bean definitions from file [D:\apache-tomcat-7.0.47\webapps\WorkOrder\WEB-INF\classes\applicationContext.xml]
  • Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@78f77c8e: defining beans [sessionFactory,txManager,txAdvice,org.springframework.aop.config.internalAutoProxyCreator,pointcut,org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor#0]; root of factory hierarchy
  • Hibernate Commons Annotations 3.2.0.Final
  • Hibernate 3.6.8.Final
  • hibernate.properties not found
  • Bytecode provider name : javassist
  • using JDK 1.4 java.sql.Timestamp handling
  • configuring from url: file:/D:/apache-tomcat-7.0.47/webapps/WorkOrder/WEB-INF/classes/hibernate.cfg.xml
  • Configured SessionFactory: null
  • Hibernate Validator not found: ignoring
  • Building new Hibernate SessionFactory
  • Unable to find org.hibernate.search.event.FullTextIndexEventListener on the classpath. Hibernate Search is not enabled.
  • Using Hibernate built-in connection pool (not for production use!)
  • Hibernate connection pool size: 20
  • autocommit mode: false
  • using driver: oracle.jdbc.driver.OracleDriver at URL: jdbc:oracle:thin:@localhost:1521:orcl
  • connection properties: {user=system, password=****}
  • Using dialect: org.hibernate.dialect.Oracle10gDialect
  • Disabling contextual LOB creation as createClob() method threw error : java.lang.reflect.InvocationTargetException
  • Database ->

下面是hibernate
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">


none

oracle.jdbc.driver.OracleDriver


jdbc:oracle:thin:@localhost:1521:orcl

system
a123

org.hibernate.dialect.Oracle10gDialect

true
true

</session-factory>


下面是spring
<?xml version="1.0" encoding="UTF-8"?>
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:context="http://www.springframework.org/schema/context" xmlns:p="http://www.springframework.org/schema/p"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-3.2.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.2.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-3.2.xsd">

<bean id="sessionFactory"
    class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
    <property name="configLocation">
        <value>classpath:hibernate.cfg.xml</value>
    </property>
</bean>
  • 写回答

2条回答 默认 最新

  • 邵跑跑 2017-03-30 13:11
    关注

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE hibernate-configuration PUBLIC
    "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
    "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">


    none

    oracle.jdbc.driver.OracleDriver


    jdbc:oracle:thin:@localhost:1521:orcl

    system
    a123

    org.hibernate.dialect.Oracle10gDialect

    true
    true

    </session-factory>
    

    这是hibernate的配置文件

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 WPF动态创建页面内容
  • ¥15 如何对TBSS的结果进行统计学的分析已完成置换检验,如何在最终的TBSS输出结果提取除具体值及如何做进一步相关性分析
  • ¥15 SQL数据库操作问题
  • ¥100 关于lm339比较电路出现的问题
  • ¥15 Matlab安装yalmip和cplex功能安装失败
  • ¥15 加装宝马安卓中控改变开机画面
  • ¥15 STK安装问题问问大家,这种情况应该怎么办
  • ¥15 关于罗技鼠标宏lua文件的问题
  • ¥15 halcon ocr mlp 识别问题
  • ¥15 已知曲线满足正余弦函数,根据其峰值,还原出整条曲线