mybatis 异常处理Cause: java.lang.IllegalStateException: Cannot enable lazy loading because CGLIB is not
来源:互联网 发布:千牛 卖家工作台 mac 编辑:程序博客网 时间:2024/06/06 00:49
mybatis 异常解决办法,刚开始写,写的不好,后续会不断优化
1:Cause: java.lang.IllegalStateException: Cannot enable lazy loading because CGLIB is not available. Add CGLIB to your classpath.
原因:缺失 cglib-nodep-3.1.jar 包
HTTP Status 500 - Request processing failed; nested exception is org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException: type Exception reportmessage Request processing failed; nested exception is org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException: description The server encountered an internal error that prevented it from fulfilling this request.exception org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: java.lang.IllegalStateException: Cannot enable lazy loading because CGLIB is not available. Add CGLIB to your classpath.### The error may exist in file [E:\software\apache-tomcat-6.0.43-windows-x86\apache-tomcat-6.0.43\webapps\springMvc\WEB-INF\classes\com\mqsyoung\mapper\lockMapper.xml]### The error may involve com.mqsyoung.mapper.LockMapper.getLockById### The error occurred while handling results### SQL: select * from tbl_lock where id =?### Cause: java.lang.IllegalStateException: Cannot enable lazy loading because CGLIB is not available. Add CGLIB to your classpath. org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:973) org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:852) javax.servlet.http.HttpServlet.service(HttpServlet.java:617) org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:837) javax.servlet.http.HttpServlet.service(HttpServlet.java:723)root cause org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: java.lang.IllegalStateException: Cannot enable lazy loading because CGLIB is not available. Add CGLIB to your classpath.### The error may exist in file [E:\software\apache-tomcat-6.0.43-windows-x86\apache-tomcat-6.0.43\webapps\springMvc\WEB-INF\classes\com\mqsyoung\mapper\lockMapper.xml]### The error may involve com.mqsyoung.mapper.LockMapper.getLockById### The error occurred while handling results### SQL: select * from tbl_lock where id =?### Cause: java.lang.IllegalStateException: Cannot enable lazy loading because CGLIB is not available. Add CGLIB to your classpath. org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:75) org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:371) com.sun.proxy.$Proxy81.selectOne(Unknown Source) org.mybatis.spring.SqlSessionTemplate.selectOne(SqlSessionTemplate.java:163) org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:68) org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:52) com.sun.proxy.$Proxy86.getLockById(Unknown Source) sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) java.lang.reflect.Method.invoke(Method.java:498) org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317) org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190) org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157) org.springframework.aop.framework.adapter.MethodBeforeAdviceInterceptor.invoke(MethodBeforeAdviceInterceptor.java:52) org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92) org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207) com.sun.proxy.$Proxy87.getLockById(Unknown Source) com.mqsyoung.service.impl.LockServiceImpl.getLockById(LockServiceImpl.java:28) sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) java.lang.reflect.Method.invoke(Method.java:498) org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317) org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190) org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157) org.springframework.aop.framework.adapter.MethodBeforeAdviceInterceptor.invoke(MethodBeforeAdviceInterceptor.java:52) org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92) org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207) com.sun.proxy.$Proxy88.getLockById(Unknown Source) com.mqsyoung.controller.UserController.getLock(UserController.java:34) sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) java.lang.reflect.Method.invoke(Method.java:498) org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:215) org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:132) org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104) org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:749) org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:689) org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:83) org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:938) org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:870) org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:961) org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:852) javax.servlet.http.HttpServlet.service(HttpServlet.java:617) org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:837)
阅读全文
0 0
- mybatis 异常处理Cause: java.lang.IllegalStateException: Cannot enable lazy loading because CGLIB is not
- Mybatis延迟加载问题( Cannot enable lazy loading because CGLIB is not available)
- springMvc+myBatis报错Cannot enable lazy loading because CGLIB is not available. Add CGLIB to your
- 异常:java.lang.IllegalStateException: Cannot deactivate transaction synchronization - not active
- java.lang.IllegalStateException异常处理
- xfire webservice异常 java.lang.IllegalStateException: Can't overwrite cause
- 异常:java.lang.IllegalStateException: EntityManager is closed
- Mybatis Cause: java.lang.ClassNotFoundException: Cannot find class: BaseResultMap
- 异常处理:Caused by: Java.lang.IllegalStateException
- 异常处理:nested exception is java.lang.NoClassDefFoundError: net/sf/cglib/proxy/CallbackFilter
- Cannot proxy target class because CGLIB2 is not available. Add CGLIB to the...
- nested exception is java.lang.IllegalStateException: Ambiguous mapping. Cannot map ***
- java.lang.IllegalStateException 异常
- 异常:java.lang.IllegalStateException
- 异常java.lang.IllegalStateException: Ambiguous mapping. Cannot map 'xxx' method
- Cannot proxy target class because CGLIB is not available. Add CGLIB to the class path or specify pr
- java.lang.IllegalStateException: Can't overwrite cause webservice访问异常 解决方案
- java.lang.IllegalStateException: Cannot perform this operation because the connection pool has been
- 【2018将成为AGI元年】13名专家盘点2017最重要AI事件,预测AGI将取代AI
- 柱形图
- c语言练习(4)
- java实现基于TCP的socket通信实例(客户端)
- 《The Linux Command Line》中的命令
- mybatis 异常处理Cause: java.lang.IllegalStateException: Cannot enable lazy loading because CGLIB is not
- php,mysql登录(session,无加密版,js)
- c# ArryList 键值对
- java获取HTML纯文本内容 body
- BASIC-23VIP试题 芯片测试
- 通用串口测试工具 使用方法
- JAVA 建立线程ThreadDemo类
- python 多线程就这么简单
- Java小功能(4)--java代码运行exe文件