邵跑跑 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 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料