服务器遇到了一个意外的情况,阻止它完成请求。

例外情况

org.springframework.dao.InvalidDataAccessResourceUsageException: could not execute query; SQL [select papers0_.id as id6_, papers0_.createtime as createtime6_, papers0_.info as info6_, papers0_.title as title6_ from f_Papers papers0_ where url='非人非任飞' or papers0_.title='null']; nested exception is org.hibernate.exception.SQLGrammarException: could not execute query org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:629) org.springframework.orm.hibernate3.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:412) org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:411) org.springframework.orm.hibernate3.HibernateTemplate.executeWithNativeSession(HibernateTemplate.java:374) org.springframework.orm.hibernate3.HibernateTemplate.find(HibernateTemplate.java:912) org.springframework.orm.hibernate3.HibernateTemplate.find(HibernateTemplate.java:904) com.hdfix.dao.impl.PapersDaoImpl.selectBean(PapersDaoImpl.java:29) com.hdfix.action.PaperAction.Paperssave(PaperAction.java:141) 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) com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:452) com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:291) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:254) com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:176) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248) com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:263) org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68)

报错,解决内容:

这个错误是由于执行的SQL查询语句中存在语法错误导致的。具体来说,查询语句中的条件部分存在问题。

错误的查询语句是:select papers0_.id as id6_, papers0_.createtime as createtime6_, papers0_.info as info6_, papers0_.title as title6_ from f_Papers papers0_ where url='非人非任飞' or papers0_.title='null'

根据错误信息,可以看出其中的两个条件部分是有问题的:

  1. url='非人非任飞':可能是url这个字段没有定义,或者是查询条件中的值不正确。
  2. papers0_.title='null':可能是title这个字段没有定义,或者是查询条件中的值不正确。

要解决这个错误,你需要检查数据库表的结构,确保查询的字段都存在,并且查询条件中的值正确。

SQL 语法错误导致的查询失败 - '非人非任飞' 和 'null' 条件问题

原文地址: http://www.cveoy.top/t/topic/fAQA 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录