hibernate-Hibernate异常 java.lang.ClassNotFoundException

问题描述

Hibernate异常 java.lang.ClassNotFoundException

19-Oct-2015 23:24:58.329 SEVERE [http-apr-8080-exec-6] org.apache.catalina.core.StandardWrapperValve.invoke Allocate exception for servlet mvc-dispatcher
java.lang.ClassNotFoundException: org.hibernate.criterion.DetachedCriteria
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1333)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1167)
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
at java.lang.Class.getDeclaredMethods(Class.java:1975)
at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:571)
at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:490)
at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:474)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.determineCandidateConstructors(AutowiredAnnotationBeanPostProcessor.java:241)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.determineConstructorsFromBeanPostProcessors(AbstractAutowireCapableBeanFactory.java:1059)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1032)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:505)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:302)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:229)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:298)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:725)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:757)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:480)
at org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:663)
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:629)
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:677)
at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:548)
at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:489)
at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:136)
at javax.servlet.GenericServlet.init(GenericServlet.java:158)
at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1231)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1144)
at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:817)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:135)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:142)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:518)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1091)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:673)
at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2503)
at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2492)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:745)


解决方案

缺少jar包

import org.hibernate.criterion.DetachedCriteria;
import org.hibernate.criterion.MatchMode;
import org.hibernate.criterion.Order;
import org.hibernate.criterion.Restrictions;

这几个包有没有

解决方案二:

hibernate中异常:java.lang.ClassNotFoundException: org.hibernate.cache.internal.NoCacheProvider
Tomcat:java.lang.ClassNotFoundException
java异常总结---1.java.lang.ClassNotFoundException: org.springframework.orm.hibernate4.support.OpenSessio
----------------------

解决方案三:

类找不到,是否是包引用的不完整

解决方案四:

找不到类,可能是缺少jar包

解决方案五:

解决方案六:

org.hibernate.criterion.DetachedCriteria 就应该在hibernate-core里,你的路径貌似有问题。
lib应该在webapps/WEB-INF/下,而不是在webapps下

解决方案七:

依赖jar不全吧,检查下导入的jar。

时间: 2024-11-04 07:11:37

hibernate-Hibernate异常 java.lang.ClassNotFoundException的相关文章

eclipse 使用Hibernate出错 java.lang.ClassNotFoundException

问题描述 eclipse使用Hibernate出错java.lang.ClassNotFoundException调试了一天了,各位帮帮忙啊出错信息如下:java.lang.NoClassDefFoundError:org/dom4j/DocumentExceptionorg.util.HibernateSessionFactory.rebuildSessionFactory(HibernateSessionFactory.java:57)org.util.HibernateSessionFac

java.lang.ClassNotFoundException: org.hibernate.annotations.Entity

问题描述 最近要把hibernate从3.2升级到3.67.更换JAR包之后,报以下错误,但那个entity在hibernate3.jar包里面是有.先谢谢大家!gframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:282)atorg.springframework.web.context.ContextLoader.initWebApplicationContext(Context

java.lang.ClassNotFoundException: org.codehaus.jackson.JsonProcessingException 异常解决方案

问题: 在SpringMVC中使用Jackson实现json输出时配置如下: <!-- 输出对象转JSON支持 --> <bean id="stringConverter" class="org.springframework.http.converter.StringHttpMessageConverter"> <property name="supportedMediaTypes"> <list>

java web-javaweb运行出java.lang.ClassNotFoundException异常

问题描述 javaweb运行出java.lang.ClassNotFoundException异常 严重: Allocate exception for servlet Web.SearchK java.lang.ClassNotFoundException: Search.searchkey at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1333) at org.

java.lang.ClassNotFoundException异常有哪些可能

问题描述 java.lang.ClassNotFoundException异常有哪些可能 新手一枚,写了个Struts2的demo,导入Struts2.3.4的jar包,用MyEclipse10自带的tomcat跑然后报错 严重: Exception starting filter struts2base01 java.lang.ClassNotFoundException: org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExcu

刚学习JSF,出现java.lang.ClassNotFoundException的异常

问题描述 <?xml version="1.0" encoding="UTF-8"?><web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.5" xsi:schemaLocation="http://ja

maven spring3 hibernate4 Caused by: java.lang.ClassNotFoundException: org.hibe

问题描述 org.hibernate.engine.SessionFactoryImplementor三月13,201511:43:07上午org.apache.catalina.core.StandardContextlistenerStart严重:Exceptionsendingcontextinitializedeventtolistenerinstanceofclassorg.springframework.web.context.ContextLoaderListenerorg.spr

【报错】spring整合activeMQ,pom.xml文件缺架包,启动报错:Caused by: java.lang.ClassNotFoundException: org.apache.xbean.spring.context.v2.XBeanNamespaceHandler

spring版本:4.3.13 ActiveMq版本:5.15 ======================================================== spring整合activeMQ,pom.xml文件缺架包,启动报错: [springDemo][INFO] [2017-12-11 14:54:57] org.springframework.web.context.ContextLoader.initWebApplicationContext(304) | Root

ECLIPSE插件开发 连接数据库失败 java.lang.ClassNotFoundException: com.mysql.jdbc.Driver

问题描述 在做ECLIPSE插件开发时,连接数据库失败,报java.lang.ClassNotFoundException:com.mysql.jdbc.Driver我知道报这个一般是因为没有引连接数据库驱动包但是我在插件开发项目包里写一个连接数据库的类就能连接上:在插件开发相关的类里写,在调试插件的时候就会报上面的异常请高手帮忙解答一下这个问题,多谢!!! 解决方案 解决方案二:你加上jar不就完了或者你是打包的问题解决方案三:什么叫"插件开发项目包",什么叫"插件开发相关