org.springframework.dao.InvalidDataAccessResourceUsageException: could not execute query; nested exception is

org.springframework.dao.InvalidDataAccessResourceUsageException: could not execute query; nested exception is org.hibernate.exception.SQLGrammarException: could not execute query
 at org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:630) [spring.jar:2.5.6.SEC01]
 at org.springframework.orm.hibernate3.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:412) [spring.jar:2.5.6.SEC01]
 at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:424) [spring.jar:2.5.6.SEC01]
 at org.springframework.orm.hibernate3.HibernateTemplate.executeWithNativeSession(HibernateTemplate.java:374) [spring.jar:2.5.6.SEC01]
 at com.metinform.modules.orm.hibernate.BaseDAO.findPageByCriteria(BaseDAO.java:154) [BaseDAO.class:na]
 at com.metinform.zxzj.persistence.TraceProjectDAO.findPageList(TraceProjectDAO.java:331) [TraceProjectDAO.class:na]
 at com.metinform.zxzj.service.ProjectService.traceProjectPage(ProjectService.java:5351) [ProjectService.class:na]
 at com.metinform.zxzj.service.ProjectService$$FastClassByCGLIB$$4715dfff.invoke(<generated>) [cglib-nodep-2.1_3.jar:na]
 at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149) [cglib-nodep-2.1_3.jar:na]
 at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:700) [spring.jar:2.5.6.SEC01]
 at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) [spring.jar:2.5.6.SEC01]
 at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106) [spring.jar:2.5.6.SEC01]
 at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) [spring.jar:2.5.6.SEC01]
 at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89) [spring.jar:2.5.6.SEC01]
 at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) [spring.jar:2.5.6.SEC01]
 at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:635) [spring.jar:2.5.6.SEC01]
 at com.metinform.zxzj.service.ProjectService$$EnhancerByCGLIB$$819c4b2c.traceProjectPage(<generated>) [cglib-nodep-2.1_3.jar:na]
 at com.metinform.zxzj.projectstruct.action.ProjectAction.projectTraceList(ProjectAction.java:2582) [ProjectAction.class:na]
 at sun.reflect.GeneratedMethodAccessor170.invoke(Unknown Source) [na:na]
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [na:1.6.0_12]
 at java.lang.reflect.Method.invoke(Method.java:597) [na:1.6.0_12]
 at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:269) [struts-extras-1.3.10.jar:1.3.10]
 at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:170) [struts-extras-1.3.10.jar:1.3.10]
 at org.apache.struts.chain.commands.servlet.ExecuteAction.execute(ExecuteAction.java:58) [struts-core-1.3.10.jar:1.3.10]
 at org.apache.struts.chain.commands.AbstractExecuteAction.execute(AbstractExecuteAction.java:67) [struts-core-1.3.10.jar:1.3.10]
 at org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:51) [struts-core-1.3.10.jar:1.3.10]
 at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190) [commons-chain-1.1.jar:1.1]
 at org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:304) [commons-chain-1.1.jar:1.1]
 at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190) [commons-chain-1.1.jar:1.1]
 at org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283) [struts-core-1.3.10.jar:1.3.10]
 at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913) [struts-core-1.3.10.jar:1.3.10]
 at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:449) [struts-core-1.3.10.jar:1.3.10]
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:617) [servlet-api.jar:na]
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:723) [servlet-api.jar:na]
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) [catalina.jar:6.0.45]
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) [catalina.jar:6.0.45]
 at com.opensymphony.sitemesh.webapp.SiteMeshFilter.obtainContent(SiteMeshFilter.java:129) [sitemesh-2.4.1-weblogic-UTF-8.jar:na]
 at com.opensymphony.sitemesh.webapp.SiteMeshFilter.doFilter(SiteMeshFilter.java:77) [sitemesh-2.4.1-weblogic-UTF-8.jar:na]
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) [catalina.jar:6.0.45]
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) [catalina.jar:6.0.45]
 at com.metinform.zxzj.web.filter.MDCFilter.doFilter(MDCFilter.java:86) [MDCFilter.class:na]
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) [catalina.jar:6.0.45]
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) [catalina.jar:6.0.45]
 at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:378) [spring-security-core-2.0.5.jar:na]
 at org.springframework.security.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:109) [spring-security-core-2.0.5.jar:na]
 at org.springframework.security.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83) [spring-security-core-2.0.5.jar:na]
 at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390) [spring-security-core-2.0.5.jar:na]
 at org.springframework.security.ui.SessionFixationProtectionFilter.doFilterHttp(SessionFixationProtectionFilter.java:67) [spring-security-core-2.0.5.jar:na]
 at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53) [spring-security-core-2.0.5.jar:na]
 at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390) [spring-security-core-2.0.5.jar:na]
 at org.springframework.security.ui.ExceptionTranslationFilter.doFilterHttp(ExceptionTranslationFilter.java:101) [spring-security-core-2.0.5.jar:na]
 at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53) [spring-security-core-2.0.5.jar:na]
 at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390) [spring-security-core-2.0.5.jar:na]
 at org.springframework.security.providers.anonymous.AnonymousProcessingFilter.doFilterHttp(AnonymousProcessingFilter.java:105) [spring-security-core-2.0.5.jar:na]
 at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53) [spring-security-core-2.0.5.jar:na]
 at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390) [spring-security-core-2.0.5.jar:na]
 at org.springframework.security.ui.rememberme.RememberMeProcessingFilter.doFilterHttp(RememberMeProcessingFilter.java:116) [spring-security-core-2.0.5.jar:na]
 at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53) [spring-security-core-2.0.5.jar:na]
 at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390) [spring-security-core-2.0.5.jar:na]
 at org.springframework.security.wrapper.SecurityContextHolderAwareRequestFilter.doFilterHttp(SecurityContextHolderAwareRequestFilter.java:91) [spring-security-core-2.0.5.jar:na]
 at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53) [spring-security-core-2.0.5.jar:na]
 at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390) [spring-security-core-2.0.5.jar:na]
 at org.springframework.security.ui.basicauth.BasicProcessingFilter.doFilterHttp(BasicProcessingFilter.java:174) [spring-security-core-2.0.5.jar:na]
 at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53) [spring-security-core-2.0.5.jar:na]
 at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390) [spring-security-core-2.0.5.jar:na]
 at org.springframework.security.ui.AbstractProcessingFilter.doFilterHttp(AbstractProcessingFilter.java:278) [spring-security-core-2.0.5.jar:na]
 at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53) [spring-security-core-2.0.5.jar:na]
 at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390) [spring-security-core-2.0.5.jar:na]
 at com.metinform.modules.security.springsecurity.SpringSecurityLogFilter.doFilterHttp(SpringSecurityLogFilter.java:39) [SpringSecurityLogFilter.class:na]
 at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53) [spring-security-core-2.0.5.jar:na]
 at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390) [spring-security-core-2.0.5.jar:na]
 at org.springframework.security.ui.logout.LogoutFilter.doFilterHttp(LogoutFilter.java:89) [spring-security-core-2.0.5.jar:na]
 at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53) [spring-security-core-2.0.5.jar:na]
 at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390) [spring-security-core-2.0.5.jar:na]
 at org.springframework.security.context.HttpSessionContextIntegrationFilter.doFilterHttp(HttpSessionContextIntegrationFilter.java:235) [spring-security-core-2.0.5.jar:na]
 at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53) [spring-security-core-2.0.5.jar:na]
 at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390) [spring-security-core-2.0.5.jar:na]
 at org.springframework.security.concurrent.ConcurrentSessionFilter.doFilterHttp(ConcurrentSessionFilter.java:99) [spring-security-core-2.0.5.jar:na]
 at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53) [spring-security-core-2.0.5.jar:na]
 at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390) [spring-security-core-2.0.5.jar:na]
 at org.springframework.security.util.FilterChainProxy.doFilter(FilterChainProxy.java:175) [spring-security-core-2.0.5.jar:na]
 at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:236) [spring.jar:2.5.6.SEC01]
 at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167) [spring.jar:2.5.6.SEC01]
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) [catalina.jar:6.0.45]
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) [catalina.jar:6.0.45]
 at com.metinform.modules.web.struts.AntiSqlInjectionfilter.doFilter(AntiSqlInjectionfilter.java:54) [AntiSqlInjectionfilter.class:na]
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) [catalina.jar:6.0.45]
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) [catalina.jar:6.0.45]
 at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:96) [spring.jar:2.5.6.SEC01]
 at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) [spring.jar:2.5.6.SEC01]
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) [catalina.jar:6.0.45]
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) [catalina.jar:6.0.45]
 at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) [catalina.jar:6.0.45]
 at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) [catalina.jar:6.0.45]
 at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) [catalina.jar:6.0.45]
 at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103) [catalina.jar:6.0.45]
 at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [catalina.jar:6.0.45]
 at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293) [catalina.jar:6.0.45]
 at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:879) [tomcat-coyote.jar:6.0.45]
 at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:610) [tomcat-coyote.jar:6.0.45]
 at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1777) [tomcat-coyote.jar:6.0.45]
 at java.lang.Thread.run(Thread.java:619) [na:1.6.0_12]
Caused by: org.hibernate.exception.SQLGrammarException: could not execute query
 at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:90) [hibernate3.jar:na]
 at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66) [hibernate3.jar:na]
 at org.hibernate.loader.Loader.doList(Loader.java:2235) [hibernate3.jar:na]
 at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2129) [hibernate3.jar:na]
 at org.hibernate.loader.Loader.list(Loader.java:2124) [hibernate3.jar:na]
 at org.hibernate.loader.criteria.CriteriaLoader.list(CriteriaLoader.java:118) [hibernate3.jar:na]
 at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1597) [hibernate3.jar:na]
 at org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:306) [hibernate3.jar:na]
 at com.metinform.modules.orm.hibernate.BaseDAO$6.doInHibernate(BaseDAO.java:212) [BaseDAO$6.class:na]
 at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:419) [spring.jar:2.5.6.SEC01]
 ... 99 common frames omitted
Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: 列名 ‘userStr4Date‘ 无效。
 at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:196) [sqljdbc4.jar:na]
 at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(SQLServerStatement.java:1454) [sqljdbc4.jar:na]
 at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.doExecutePreparedStatement(SQLServerPreparedStatement.java:388) [sqljdbc4.jar:na]
 at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement$PrepStmtExecCmd.doExecute(SQLServerPreparedStatement.java:338) [sqljdbc4.jar:na]
 at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:4026) [sqljdbc4.jar:na]
 at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:1416) [sqljdbc4.jar:na]
 at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQLServerStatement.java:185) [sqljdbc4.jar:na]
 at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(SQLServerStatement.java:160) [sqljdbc4.jar:na]
 at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.executeQuery(SQLServerPreparedStatement.java:281) [sqljdbc4.jar:na]
 at org.apache.tomcat.dbcp.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:96) [tomcat-dbcp.jar:6.0.45]
 at org.apache.tomcat.dbcp.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:96) [tomcat-dbcp.jar:6.0.45]
 at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:208) [hibernate3.jar:na]
 at org.hibernate.loader.Loader.getResultSet(Loader.java:1812) [hibernate3.jar:na]
 at org.hibernate.loader.Loader.doQuery(Loader.java:697) [hibernate3.jar:na]
 at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:259) [hibernate3.jar:na]
 at org.hibernate.loader.Loader.doList(Loader.java:2232) [hibernate3.jar:na]
 ... 106 common frames omitted

org.springframework.dao.InvalidDataAccessResourceUsageException: could not execute query; nested exception is org.hibernate.exception.SQLGrammarException: could not execute query

原因:

这个问题的解决方案很简单,主要是因为数据库中不存在相关的表或者列。

时间: 2024-10-13 03:29:11

org.springframework.dao.InvalidDataAccessResourceUsageException: could not execute query; nested exception is的相关文章

[Spring Data JPA问题]Executing an update/delete query; nested exception is javax.persistence.TransactionRequiredException

JPQL如下: @Modifying(clearAutomatically = true) @Query("UPDATE SyncTestFromTKDO SET stuAns = '' where typeId = ?1") public void updateStuAns(Integer typeid); 项目运行时报错,提示: Executing an update/delete query; nested exception is javax.persistence.Trans

HTTP Status 500 - JDBC exception on Hibernate data access: SQLException for SQL [n/a]; SQL state [HY000]; error code [1364]; could not execute statement; nested exception is org.hibernate.exception.Ge

HTTP Status 500 - JDBC exception on Hibernate data access: SQLException for SQL [n/a]; SQL state [HY000]; error code [1364]; could not execute statement; nested exception is org.hibernate.exception.GenericJDBCException: could not execute statement 翻译

关于SpringBoot中jpa org.springframework.dao.InvalidDataAccessResourceUsageException: could not excute statement解决办法

KEY  NAME 保留关键字 不能作为  mysql建表 语句  导致一直iinsert报错  修改表字段即可 原文地址:https://www.cnblogs.com/cpbm/p/12142744.html

error:org.springframework.web.util.NestedServletException: Request processing failed; nested exception is java.lang.NullPointerException

问题:调用的方法在一个接口类中,但我并没有注入那个被调用的类 解决:在UserEntity前加上@Autowired @Controller public class MainController { // 自动装配数据库接口,不需要再写原始的Connection来操作数据库 @Autowired UserRepository userRepository; @RequestMapping(value = "/",method = RequestMethod.GET) public S

org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.jboss.resteasy.plug

之前做的项目是resteasy的上传,代码没有问题,断点都不进来呢. 我以为可以直接移植到SpringMVC,但是SpringMVC不支持MultipartFormDataInput , 用MultipartFile就可以了.老的无法兼容新的.正确代码如下 @RequestMapping(value = "/importExcelForEduQuestion",produces = "application/json; charset=utf-8")@Respons

HTTP Status 500 - Request processing failed; nested exception is org.springframework.jdbc.BadSqlGram

HTTP Status 500 - Request processing failed; nested exception is org.springframework.jdbc.BadSqlGrammarException: type Exception report message Request processing failed; nested exception is org.springframework.jdbc.BadSqlGrammarException: descriptio

sping异常记录----Could not execute JDBC batch update; nested exception is org.hibernate.excepti

今天在练习如何SSH中进行单元测试的时候出现下列异常: org.springframework.dao.DataIntegrityViolationException: Could not execute JDBC batch update; nested exception is org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update at org.springframe

org.springframework.dao.InvalidDataAccessApiUsageException报错

2018-01-09 18:12:29,980 [qtp1501019626-21] ERROR - 外部接口调用方法[TestController$$EnhancerBySpringCGLIB$$825c015b.testDemo6]异常:org.springframework.dao.InvalidDataAccessApiUsageException: No EntityManager with actual transaction available for current thread

java.lang.NoSuchMethodError: org.springframework.dao.IncorrectResultSizeDataAccessException

spring data jpa  运用,在dao类中写自己新增的方法,使用@query写hql语句,出现以下异常: Caused by: java.lang.NoSuchMethodError: org.springframework.dao.IncorrectResultSizeDataAccessException.<init>(Ljava/lang/String;ILjava/lang/Throwable;)V at org.springframework.orm.jpa.EntityM