今天在完成Spring项目的时候遇到了一个类似于下面的异常:

10.03.2010 13:53:53 org.apache.catalina.core.StandardWrapperValve invoke
SCHWERWIEGEND: Servlet.service() for servlet default threw exception
org.springframework.expression.spel.SpelEvaluationException: EL1005E:(pos 0): Type cannot be found 'com.example.Comparison.Operator'
at org.springframework.expression.spel.support.StandardTypeLocator.findType(StandardTypeLocator.java:79)
at org.springframework.expression.spel.ExpressionState.findType(ExpressionState.java:136)
at org.springframework.expression.spel.ast.TypeReference.getValueInternal(TypeReference.java:45)
at org.springframework.expression.spel.ast.CompoundExpression.getValueInternal(CompoundExpression.java:52)
at org.springframework.expression.spel.ast.SpelNodeImpl.getValue(SpelNodeImpl.java:93)
at org.springframework.expression.spel.standard.SpelExpression.getValue(SpelExpression.java:88)
at org.springframework.web.servlet.tags.EvalTag.doEndTag(EvalTag.java:118)

大致描述一下场景:

<?xml version="1.0" encoding="UTF-8"?>

<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/util
http://www.springframework.org/schema/util/spring-util.xsd"> <util:map id="contractQueryStrategyHolder">
<entry key="#{T(com.example.Comparison.Operator).xxx}" value-ref="bbbb" />
</util:map> </beans>

OperatorComparison的内部类。后来启动失败就出现上面的异常。解决方案其实很简单,只需要把配置修改为下面的就好:

    <util:map id="contractQueryStrategyHolder">
<entry key="#{T(com.example.Comparison$Operator).xxx}" value-ref="bbbb" />
</util:map>

org.springframework.expression.spel.SpelEvaluationException: EL1005E:(pos 0): Type cannot be found的更多相关文章

  1. org.springframework.expression.spel.SpelEvaluationException: EL1011E: Method call: Attempted to call method test() on null context object

    前言 本文中提到的解决方案,源码地址在:springboot-thymeleaf,希望可以帮你解决问题. 至于为什么已经写了一篇文章thymeleaf模板引擎调用java类中的方法,又多此一举的单独整 ...

  2. org.springframework.expression.spel.SpelEvaluationException: EL1004E: Method call: Method service() cannot be found on com.my.blog.springboot.thymeleaf.util.MethodTest type

    前言 本文中提到的解决方案,源码地址在:springboot-thymeleaf,希望可以帮你解决问题. 至于为什么已经写了一篇文章thymeleaf模板引擎调用java类中的方法,又多此一举的单独整 ...

  3. 【spring data jpa】使用jpa的@Query,自己写的语句,报错:org.springframework.expression.spel.SpelEvaluationException: EL1007E: Property or field 'status' cannot be found on null

    报错: org.springframework.expression.spel.SpelEvaluationException: EL1007E: Property or field 'status' ...

  4. 【spring data jpa】jpa中使用in查询或删除 在@Query中怎么写 ,报错:org.springframework.expression.spel.SpelEvaluationException: EL1007E: Property or field 'goodsConfigUid' cannot be found on null 怎么处理

    示例代码如下: @Modifying @Transactional @Query("delete from GoodsBindConfigMapping gbc " + " ...

  5. org.springframework.expression.spel.SpelEvaluationException: EL1030E

    问题与分析 在本地开发项目时发现报错如下: org.springframework.expression.spel.SpelEvaluationException: EL1030E: The oper ...

  6. spring-boot 集成ehcache报错:org.springframework.expression.spel.SpelEvaluationException: EL1008E:

    错误信息:org.springframework.expression.spel.SpelEvaluationException: EL1008E: Property or field 'pageab ...

  7. Caused by: java.lang.ClassNotFoundException: org.springframework.expression.ExpressionParser

    1.错误描述 usage: java org.apache.catalina.startup.Catalina [ -config {pathname} ] [ -nonaming ] { -help ...

  8. 腾讯云提示invalid pos, pos is bigger than filesize! pos: 0, file_size: 0错误

    腾讯云提示invalid pos, pos is bigger than filesize! pos: 0, file_size: 0错误 起因 使用hdfs dfs -text xxx命令提示下面错 ...

  9. java.lang.NoClassDefFoundError: org/springframework/expression/PropertyAccessor

    这个异常原因种类不一,网上有各个版本,本人的是因为缺少了spring-expression-3.2.1.RELEASE.jar 2015-9-18 23:19:11 org.apache.catali ...

随机推荐

  1. 利用ActiveX实现web页面设置本地默认打印机、纸张大小

    通常web技术无法设置本地计算机的默认打印机,包括用代码设置纸张大小,如果业务系统中真遇到这种需求,只能通过其它辅助手段(比如ActiveX)实现.下面这段代码,出自网上被广泛使用的"泥人张 ...

  2. 利用Canvas进行绘制XY坐标系

    首先来一发图 绘制XY的坐标主要是利用Canvas setLeft和setBottom功能(Canvas内置坐标的功能) 1.首先WPF中的坐标系都是从左到右,从上到下的 即左上角位置(0,0)点,所 ...

  3. Android Stduio统计项目的代码行数

    android studio统计项目的代码行数的步骤如下: 1)按住Ctrl+Shift+A,在弹出的框输入‘find’,然后选择Find in Path.(或者使用快捷键Ctrl+Shift+F) ...

  4. PowerShell Script to Deploy Multiple VM on Azure in Parallel #azure #powershell

    Since I need to deploy, start, stop and remove many virtual machines created from a common image I c ...

  5. WinForm程序执行JS代码的多种方法以及使用WebBrowser与JS交互

    方法一 使用微软官方组件Interop.MSScriptControl 1.msscript.ocx下载的地址   http://www.microsoft.com/downloads/details ...

  6. Recommending branded products from social media -RecSys 2013-20160422

    1.Information publication:RecSys 2013 author:zhengyong zhang 2.What 是对上一篇论文的拓展:利用社交媒体中用户信息 对用户购买的类别排 ...

  7. spring mvc处理静态资源

    servlet的url映射定义为'/'表示映射全部路径 struts的过滤器是*.action,在spring mvc中设置成*.action或者*.do......也是可以的,但是spring mv ...

  8. shell 实现Linux 控制台下树形显示目录

    #!/bin/bash function main(){      local pre=$1    local name=$2    echo "$pre$name"    tes ...

  9. 【CSS3】 线性渐变

    参考地址:http://www.w3cplus.com/css3/new-css3-linear-gradient.html background-image: linear-gradient(to ...

  10. .NET中的GDI+

    GDI:Graphics Device Interface. System. Windows. Shapes 命名空间: 类 Ellipse 绘制一个椭圆. Line 在两个点之间绘制一条直线. Pa ...