参考:https://stackoverflow.com/questions/9851528/java-lang-noclassdeffounderror-org-hibernate-cfg-configuration/9853106

You're getting the error because the hibernate libraries are not available to Tomcat. In your picture, below the hibernate library set there is an empty set called 'Web App Libraries' - this is the set your hibernate libraries need to be in.

Right click your project -> Build Path -> Configure Build Path, and remove the hibernate set from the build path. Now import the jars into the WEB-INF/lib folder. Refresh your project and now you should see them listed in the 'Web App Libraries' set (i appreciate this is somewhat annoying that you have to import them into your code base - someone else might know a better way to do this that doesn't involve copying the jars in)

这里要put into lib 一下(虽然以前不put影响的也只是打war包后的项目,没想到这里居然会导致找不到hibernate的jar包,以后只要有新包引入,一定会第一时间put into lib 进去)

然后再测试功能,功能正常

hibernate 解决 java.lang.NoClassDefFoundError: org/hibernate/cfg/Configuration的更多相关文章

  1. hibernate 解决 java.lang.NoClassDefFoundError: Could not initialize class org.hibernate.validator.internal.engine.xxx 这类的问题

    <!-- 解决 java.lang.NoClassDefFoundError: Could not initialize class org.hibernate.validator.intern ...

  2. java.lang.NoClassDefFoundError: org/hibernate/cfg/Configuration解决方法

    Autowiring of fields failed; nested exception is...........Error creating bean with name 'siteOperat ...

  3. Caused by: java.lang.NoClassDefFoundError: org/hibernate/cfg/Configuration

    1.错误描述 usage: java org.apache.catalina.startup.Catalina [ -config {pathname} ] [ -nonaming ] { -help ...

  4. java.lang.NoClassDefFoundError: org/hibernate/cfg/Configuration

    java.lang.NoClassDefFoundError: org/hibernate/cfg/Configuration 最近在做项目的时候遇到了这个问题,很是困扰,多次尝试后发现是jar包的问 ...

  5. 解决Could not open Hibernate Session for transaction; nested exception is java.lang.NoClassDefFoundError: org/hibernate/engine/transaction/spi/TransactionContext

    我使用的是5.2.8的hibernate的jar包,运行的时候却报错Could not open Hibernate Session for transaction; nested exception ...

  6. java.lang.NoClassDefFoundError: org/hibernate/service/ServiceRegistry] 类似问题

    使用Hibernate时出现以上错误,在Java Project中运行无误,但是来到Dynamic Web Project中却出现了如下错误: hibernate 报错:java.lang.NoCla ...

  7. java.lang.NoClassDefFoundError: org/hibernate/validator/internal/engine/DefaultClockProvider

    ①在springboot的spring-boot-starter-web默认引入了以下依赖: <dependency> <groupId>com.fasterxml.jacks ...

  8. java.lang.NoClassDefFoundError: org/hibernate/QueryTimeoutException

    在做ssh整合的时候报错:java.lang.NoClassDefFoundError: org/hibernate/QueryTimeoutException org.springframework ...

  9. 解决java.lang.NoClassDefFoundError: org.jdom.Content

    报错:java.lang.NoClassDefFoundError: org.jdom.Content 解决办法: 更新lib目录下的jdom.jar 至最新版本.

随机推荐

  1. Fiddler抓包使用教程-Https

    转载请标明出处:http://blog.csdn.net/zhaoyanjun6/article/details/72956016 本文出自[赵彦军的博客] 开启 Https 抓包 Fiddler 默 ...

  2. weblogic系列漏洞整理 -- 3. weblogic 后台提权

    目录 三. weblogic 后台提权 0. 思路分析 1. 利用过程 2. 提示和技巧 一.weblogic安装 http://www.cnblogs.com/0x4D75/p/8916428.ht ...

  3. 解决windows 挂载 nfs 驱动器中 中文乱码问题

    乱码问题,是由于 mount.nfs 命令不支持 utf-8字符集.所以是系统软件支持的问题.在网络上找了很多方案都没能解决. 网上主要有三种方案(1)换解决方案,使用smb 共享,这等于不是解决方法 ...

  4. 使用KeePass管理两步验证

    目录 使用KeePass管理两步验证 两步验证 KeePass中管理两步验证 KeeTrayTOTP插件使用 使用KeePass管理两步验证 文:铁乐与猫 2018-9-9 KeePass 是一款管理 ...

  5. nginx基础知识总结

    1.nginx的工作模式 master/worker工作模式: 一个master进程: 负载加载和分析配置文件.管理worker进程.平滑重启升级等. 一个或多个worker进程 处理并响应用户请求 ...

  6. ARC设置

    XCode兼容ARC和非ARC代码的方法 在ARC开发模式下引用非ARC文件或库需进行如下操作以告诉编译器此代码需按照非ARC模式对待: XCode中项目文件->TARGETS->Comp ...

  7. VS2015安装与C++进行简单单元测试

    1:VS2015是微软最新发布的编译器,http://www.itellyou.cn/这是我们的北航大神助教提供的下载网址,以前我们都是自己在网上找,找到的总不是那么如意,这下大神助教提供的网址就好好 ...

  8. Nginx服务器的图片防盗链

    全站的防盗链方法 在/usr/local/webserver/nginx/conf//vhost/xxxx.conf文件要添加防盗链的server段里添加下面的代码: location ~ .*\.( ...

  9. 拓普微智能TFT液晶显示模块

    关键词: 串口屏, 液晶屏, TFT,人机界面 概述: 智能模块(Smart LCD)是专为工业显示应用而设计的TFT液晶显示模块. 模块自带主控IC.Flash存储器.实时嵌入式操作系统,客户主机可 ...

  10. oracle sqlplus 回退键以及上下键

    Linux中安装完Oracle后,默认的 sqlplus 上下键是不能用的,安装了 rlwrap 之后就能通过上下键翻回历史命令了 下载地址 https://github.com/hanslub42/ ...