项目配置了spring 4.0.6.RELEASE 和hibernate4.2.0.Final ,出错原因是因为在Spring 3.1开始没有了HibernateDaoSupport类,而我的却Dao类继承了这个类。

直接使用 sessionFactory.getCurrentSession().方法或者sessionFactory.openSession().

getCurrentSession 时要记得配置。还有的就是openSession()每次都需要关闭。(至于两种方法的不同点可以再深入了解)介绍文章


 

java.lang.NoSuchMethodError:org.hibernate.SessionFactory.openSession()Lorg/hibernate/classic/Session的更多相关文章

  1. Exception in thread "main" java.lang.NoSuchMethodError: org.testng.TestNG.configure(Lorg/testng/CommandLineArgs;)V

    TestNG运行时报以下错误: Exception in thread "main" java.lang.NoSuchMethodError: org.testng.TestNG. ...

  2. Caused by: java.lang.NoSuchMethodError: org.slf4j.impl.StaticLoggerBinder.getSingleton()Lorg/slf4j/i

    Caused by: java.lang.NoSuchMethodError: org.slf4j.impl.StaticLoggerBinder.getSingleton()Lorg/slf4j/i ...

  3. java.lang.NoSuchMethodError: org.apache.tomcat.util.res.StringManager.getManager(Ljava/lang/Class;)Lorg/apache/tomcat/util/res/StringManager

    问题: 使用Springboot打包为war部署于Tomcat7中报错 java.lang.NoSuchMethodError: org.apache.tomcat.util.res.StringMa ...

  4. Java.lang.NoSuchMethodError: org.slf4j.spi.LocationAwareLogger.log(Lorg/slf4j/Marker;Ljava/lang/String;ILjava/lang/String;[Ljava/lang/Object;Ljava/lang/Throwable;)V

    今天接入激光推送,一直报错: Java.lang.NoSuchMethodError: org.slf4j.spi.LocationAwareLogger.log(Lorg/slf4j/Marker; ...

  5. java.lang.NoSuchMethodError: org.apache.neethi.Policy.normalize(Z)Lorg/apache/neethi/PolicyComponent

    记录一个org.apache.neethi包的异常 java.lang.NoSuchMethodError: org.apache.neethi.Policy.normalize(Z)Lorg/apa ...

  6. cxf 报错:java.lang.NoSuchMethodError: org.apache.ws.commons.schema.XmlSchemaCollection.read(Lorg/w3c/dom/Document;Ljava/lang/String;)

    由于没有仔细查看官方提供的文档,由jdk版本不一致导致的出错: http://cxf.apache.org/cxf-316-release-notes.html 自己使用的是jdk1.8. 报Exce ...

  7. 解决java.lang.NoSuchMethodError:org.joda.time.DateTime.withTimeAtStartOfDay() Lorg/joda/time/DateTime

    问题:项目放在weblogic运行,报错 java.lang.NoSuchMethodError: org.joda.time.DateTime.withTimeAtStartOfDay()Lorg/ ...

  8. java.lang.NoSuchMethodError: org.apache.curator.framework.api.CreateBuilder.creatingParentsIfNeeded()Lorg/apache/curator/framework/api/ProtectACLCreateModeStatPathAndBytesable;

    1 错误信息 java.lang.NoSuchMethodError: org.apache.curator.framework.api.CreateBuilder.creatingParentsIf ...

  9. java.lang.NoSuchMethodError: org.springframework.web.context.ConfigurableWebApplicationContext.getEnvironment()Lorg/springframework/core/env/ConfigurableEnvironment;问题

    在springsecurity学习中,在加入spring有关的jar包后,出现java.lang.NoSuchMethodError: org.springframework.web.context. ...

随机推荐

  1. Java的Properties使用及格式定义

    java.util.Properties extends Hashtable<Object,Object> 方便读取 键值对 格式的文本资源工具 常用方法一览 初始化对象 new Prop ...

  2. shell脚本应用

    解析乱的日志文件到临时文件中,然后用awk  1004  cd /usr/local  1005  ll  1006  cd pttmsg/  1007  ll  1008  cd msgbin-2/ ...

  3. mysql_存储过程和函数

    存储过程和函数 1.什么是存储过程和函数 存储过程和函数是事先经过编译并存储在数据库中的一段SQL语句集合,调用存储过程和函数可以简化应用开发人员的很多工作,减少数据在数据库和应用服务器之间的传输,对 ...

  4. SQL性能分析

    MySQL常见瓶颈: CPU:CPU在饱和的时候一般发生在数据装入内存或从磁盘上读取数据的时候. IO:磁盘I/O瓶颈发生在装入数据远大于内存容量的时候. 服务器硬件的性能瓶颈:top.free.io ...

  5. [洛谷P3501] [POI2010]ANT-Antisymmetry

    洛谷题目链接:[POI2010]ANT-Antisymmetry 题目描述 Byteasar studies certain strings of zeroes and ones. Let be su ...

  6. apache工作模式

    查看当前apache的工作模式 apachectl -l prefork模式 <IfModule prefork.c>StartServers 5MinSpareServers 5MaxS ...

  7. pyhton发送邮件

    # import smtplib # from email.mime.text import MIMEText # _user = "你的qq邮箱" # _pwd = " ...

  8. linux内核同步之信号量、顺序锁、RCU、完成量、关闭中断【转】

    转自:http://blog.csdn.net/goodluckwhh/article/details/9006065 版权声明:本文为博主原创文章,未经博主允许不得转载.   目录(?)[-] 一信 ...

  9. 【洛谷P1343】地震逃生

    一道傻吊的网络流题,wori我写的读入优化怎么老T? 远离读入优化报平安? #include<bits/stdc++.h> #define N 4005 #define inf 10000 ...

  10. java小工具——timer

    定时器Timer 用途:做定时器用的. public static void main(String[] args) { Timer timer = new Timer(); timer.schedu ...