lujieni
小陆爱吃鱼
2015-09-06 01:10
采纳率: 50%
浏览 4.6k
已采纳

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条回答 默认 最新

  • testcs_dn
    微wx笑 2015-09-06 01:37
    已采纳
     &gt;
    
    点赞 评论
  • qq_26693145
    qq_26693145 2015-09-06 01:13

    其实我也不清楚。看看其他人

    点赞 评论
  • beacon_2011
    beaconD 2015-09-06 01:29

    Error creating bean with name 'person' defined in class path resource
    person没有被定义没有被定义

    点赞 评论
  • beacon_2011
    beaconD 2015-09-06 01:32

    Error creating bean with name 'person' defined in class path resource
    person没有被定义,没有代码也看不出具体问题,查一下接值实体是不是缺少定义变量

    点赞 评论

相关推荐