SEVERE: Servlet.service() for servlet [SpringMVC] in context with path [] threw exception ........

时间:2019-02-28 18:34:00 来源:互联网 作者: 神秘的大神 字体:

 

 运行项目项目后,因为前端用了layui框架,所以页面显示接口异常,

 

 查看tomcat日志,发现报了这个错误,关键是我犯了不止一次这个错误。所以记下来。

Feb 28, 2019 5:18:39 PM org.apache.catalina.core.ApplicationContext log
SEVERE: Servlet.service() for servlet [SpringMVC] in context with path [] threw exception 
[Request processing failed; nested exception is org.mybatis.spring.MyBatisSystemException:
nested exception is org.apache.ibatis.builder.BuilderException: Error evaluating expression ''.
Cause: org.apache.ibatis.ognl.ExpressionSyntaxException: Malformed OGNL expression:
[org.apache.ibatis.ognl.ParseException: Encountered "<EOF>" at line 1, column 0. Was expecting one of: ":" ... "not" ... "+" ... "-" ... "~" ... "!" ... "(" ... "true" ... "false" ... "null" ... "#this" ... "#root" ... "#" ... "[" ... "{" ... "@" ... "new" ... <IDENT> ... <DYNAMIC_SUBSCRIPT> ... "\'" ... "`" ... "\"" ... <INT_LITERAL> ... <FLT_LITERAL> ... ]] with root cause org.apache.ibatis.ognl.ParseException: Encountered "<EOF>" at line 1, column 0.

 

原因是Mapper.xml文件中if判断条件没有写

          <if test="">// test="aaa!=null" 不写报错
              AND LOCATE(#{Parameter},字段)>0
      </if>

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

---恢复内容结束---