小陆爱吃鱼 2015-09-05 17:10 采纳率: 50%
浏览 5218
已采纳

spring报错 mismatched input 'gt' expecting EOF

代码如下:
<?xml version="1.0" encoding="UTF-8"?>
xmlns:p="http://www.springframework.org/schema/p"
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-3.0.xsd">




在使用#{100 gt 80}也就是100>80这一代码时报错,异常如下:
Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'person' defined in class path resource [ApplicationContext.xml]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanExpressionException: Expression parsing failed; nested exception is org.springframework.expression.ParseException: Parsing problem: EL1066E:(pos 4): Error occurred during expression parse: mismatched input 'gt' expecting EOF
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:482)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:411)
at java.security.AccessController.doPrivileged(Native Method)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:382)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:271)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:268)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:170)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:470)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:719)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:378)
at org.springframework.context.support.ClassPathXmlApplicationContext.(ClassPathXmlApplicationContext.java:139)
at org.springframework.context.support.ClassPathXmlApplicationContext.(ClassPathXmlApplicationContext.java:83)
at com.springinaction.springido1.TestPerson.main(TestPerson.java:10)
Caused by: org.springframework.beans.factory.BeanExpressionException: Expression parsing failed; nested exception is org.springframework.expression.ParseException: Parsing problem: EL1066E:(pos 4): Error occurred during expression parse: mismatched input 'gt' expecting EOF
at org.springframework.context.expression.StandardBeanExpressionResolver.evaluateExpression(StandardBeanExpressionResolver.java:64)
at org.springframework.context.expression.AbstractBeanExpressionResolver.evaluate(AbstractBeanExpressionResolver.java:86)
at org.springframework.beans.factory.support.AbstractBeanFactory.evaluateBeanDefinitionString(AbstractBeanFactory.java:1156)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.evaluate(BeanDefinitionValueResolver.java:184)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:155)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1237)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1005)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:474)
... 13 more
Caused by: org.springframework.expression.ParseException: Parsing problem: EL1066E:(pos 4): Error occurred during expression parse: mismatched input 'gt' expecting EOF
at org.springframework.expression.spel.SpelExpressionParser.doParseExpression(SpelExpressionParser.java:79)
at org.springframework.expression.common.TemplateAwareExpressionParser.parseExpression(TemplateAwareExpressionParser.java:31)
at org.springframework.expression.spel.SpelExpressionParser.parseExpression(SpelExpressionParser.java:89)
at org.springframework.expression.spel.SpelExpressionParser.parseExpression(SpelExpressionParser.java:1)
at org.springframework.context.expression.StandardBeanExpressionResolver.evaluateExpression(StandardBeanExpressionResolver.java:56)
... 20 more
Caused by: org.springframework.expression.spel.SpelException: EL1066E:(pos 4): Error occurred during expression parse: mismatched input 'gt' expecting EOF
at org.springframework.expression.spel.internal.SpringExpressionsParserExtender.displayRecognitionError(SpringExpressionsParserExtender.java:52)
at org.antlr.runtime.BaseRecognizer.reportError(BaseRecognizer.java:144)
at org.springframework.expression.spel.generated.SpringExpressionsParser.expr(SpringExpressionsParser.java:158)
at org.springframework.expression.spel.SpelExpressionParser.doParseExpression(SpelExpressionParser.java:70)
... 24 more
Caused by: MismatchedTokenException(36!=-1)
at org.antlr.runtime.BaseRecognizer.mismatch(BaseRecognizer.java:117)
at org.antlr.runtime.BaseRecognizer.match(BaseRecognizer.java:99)
at org.springframework.expression.spel.generated.SpringExpressionsParser.expr(SpringExpressionsParser.java:145)
... 25 more

展开全部

  • 写回答

4条回答 默认 最新

  • 微wx笑 Java领域优质创作者 2015-09-05 17:37
    关注
     &gt;
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(3条)
编辑
预览

报告相同问题?

手机看
程序员都在用的中文IT技术交流社区

程序员都在用的中文IT技术交流社区

专业的中文 IT 技术社区,与千万技术人共成长

专业的中文 IT 技术社区,与千万技术人共成长

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

客服 返回
顶部