参考: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. vue 环境的搭建及初始化项目

    其实超级简单,虽然网上很多,但是我顺便记录下相当于做笔记吧 1nodejs 的安装, 在node官网下载,点击安装,安装的时候最好选择路径在d盘 2设置环境变量 我的电脑-->属性-->系 ...

  2. Universal-ImageLoader,Picasso,Fresco,Glide对比

    Universal-ImageLoader:(估计由于HttpClient被Google放弃,作者就放弃维护这个框架)优点:1.支持下载进度监听2.可以在 View 滚动中暂停图片加载,通过 Paus ...

  3. JavaScript变量提升的理解

    变量提升 先说三句总结性的话: let 的「创建」过程被提升了,但是初始化没有提升. var 的「创建」和「初始化」都被提升了. function 的「创建」「初始化」和「赋值」都被提升了. 所以,我 ...

  4. [20171107]dbms_shared_pool.pin补充.txt

    [20171107]dbms_shared_pool.pin补充.txt --//上午的测试,做一些补充,主要还是一些理解问题. 1.环境:SCOTT@book> @ &r/ver1 P ...

  5. js判断IE浏览器及版本

    function isIE(_version){ _version = _version || ''; var b = document.createElement('b'); b.innerHTML ...

  6. 进程间通信——LINUX

    1.编写一段程序,使用系统调用fork( )创建两个子进程,再用系统调用signal( )让父进  程捕捉键盘上来的中断信号(即按ctrl+c键),当捕捉到中断信号后,父进程用系统调用kill( )向 ...

  7. MySQL基本操作命令

    数据库的基本操作命令 1.登录MySQL -- 进入数据库的方法一 mysql -uroot -pmysql # mysql 数据库密码(显示) -- 进入数据库的方法二 mysql -uroot - ...

  8. 从研发到市场,一个C#程序员半年神奇之旅

    序 距离上次在博客园发布文章已经过了大约有一年了,由于最近一系列神奇的际遇,让我非常强烈意愿的提起笔来给大家描述我最近一段时间的经历,希望大家根据我的经历做一些参考,我尽量写的逻辑通顺,如果各位兄弟阅 ...

  9. 简单Nginx下防跨站、跨目录安全设置,支持PHP 5.3.3以上版本

    Nginx下存在跨站和跨目录的问题,跨站和跨目录影响同服务器/VPS上的其他网站. PHP在5.3.3以上已经增加了HOST配置,可以起到防跨站.跨目录的问题. 如果你是PHP 5.3.3以上的版本, ...

  10. bootstrap-datepicker default value

    $('.selectDate').datepicker({ format : "yyyy/mm/dd", autoclose : true, startDate : new Dat ...