org.springframework.expression.spel.SpelParseException: EL1035E:(pos 14): The value '5000000000' cannot be parsed as an int

Spring JIRA | Sven Smets | 3 years ago
  1. 0

    When I use this tag {noformat} <form:input path="myMap[${entry.key}]..." /> Map<Long, MyViewModel> myMap;{noformat} and entry.key is bigger then an int (ex. 5,000,000,000), I get following error {noformat} org.springframework.expression.spel.SpelParseException: EL1035E:(pos 14): The value '5000000000' cannot be parsed as an int at org.springframework.expression.spel.ast.Literal.getIntLiteral(Literal.java:79) at org.springframework.expression.spel.standard.InternalSpelExpressionParser.maybeEatLiteral(InternalSpelExpressionParser.java:688)...{noformat} In the maybeEatLiteral method it seems that Long should be supported, but int is chosen. {noformat} private boolean maybeEatLiteral() { Token t = peekToken(); if (t == null) { return false; } if (t.kind == TokenKind.LITERAL_INT) push(Literal.getIntLiteral(t.data, toPos(t), 10)); else if (t.kind == TokenKind.LITERAL_LONG) push(Literal.getLongLiteral(t.data, toPos(t), 10)); else if (t.kind == TokenKind.LITERAL_HEXINT) push(Literal.getIntLiteral(t.data, toPos(t), 16)); else if (t.kind == TokenKind.LITERAL_HEXLONG) push(Literal.getLongLiteral(t.data, toPos(t), 16)); else if (t.kind == TokenKind.LITERAL_REAL) push(Literal.getRealLiteral(t.data, toPos(t), false)); else if (t.kind == TokenKind.LITERAL_REAL_FLOAT) push(Literal.getRealLiteral(t.data, toPos(t), true)); else if (peekIdentifierToken("true")) push(new BooleanLiteral(t.data, toPos(t), true)); else if (peekIdentifierToken("false")) push(new BooleanLiteral(t.data, toPos(t), false)); else if (t.kind == TokenKind.LITERAL_STRING) push(new StringLiteral(t.data, toPos(t), t.data)); else { return false; } nextToken(); return true; } {noformat} When I add an L to make it a java Long -> 5000000000L {noformat} <form:input path="myMap[${entry.key}L]..." />{noformat} I got an other error: {noformat} java.lang.IllegalArgumentException: The field type is required at org.springframework.util.Assert.notNull(Assert.java:112) at org.springframework.webflow.mvc.view.ConvertingPropertyEditorAdapter.<init>(ConvertingPropertyEditorAdapter.java:48) at org.springframework.webflow.mvc.view.BindingModel.findSpringConvertingPropertyEditor(BindingModel.java:277) at org.springframework.webflow.mvc.view.BindingModel.findEditor(BindingModel.java:183) at org.springframework.web.servlet.support.BindStatus.<init>(BindStatus.java:125) at org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag.getBindStatus(AbstractDataBoundFormElementTag.java:179) at org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag.getPropertyPath(AbstractDataBoundFormElementTag.java:199)... {noformat}

    Spring JIRA | 3 years ago | Sven Smets
    org.springframework.expression.spel.SpelParseException: EL1035E:(pos 14): The value '5000000000' cannot be parsed as an int
  2. 0

    When I use this tag {noformat} <form:input path="myMap[${entry.key}]..." /> Map<Long, MyViewModel> myMap;{noformat} and entry.key is bigger then an int (ex. 5,000,000,000), I get following error {noformat} org.springframework.expression.spel.SpelParseException: EL1035E:(pos 14): The value '5000000000' cannot be parsed as an int at org.springframework.expression.spel.ast.Literal.getIntLiteral(Literal.java:79) at org.springframework.expression.spel.standard.InternalSpelExpressionParser.maybeEatLiteral(InternalSpelExpressionParser.java:688)...{noformat} In the maybeEatLiteral method it seems that Long should be supported, but int is chosen. {noformat} private boolean maybeEatLiteral() { Token t = peekToken(); if (t == null) { return false; } if (t.kind == TokenKind.LITERAL_INT) push(Literal.getIntLiteral(t.data, toPos(t), 10)); else if (t.kind == TokenKind.LITERAL_LONG) push(Literal.getLongLiteral(t.data, toPos(t), 10)); else if (t.kind == TokenKind.LITERAL_HEXINT) push(Literal.getIntLiteral(t.data, toPos(t), 16)); else if (t.kind == TokenKind.LITERAL_HEXLONG) push(Literal.getLongLiteral(t.data, toPos(t), 16)); else if (t.kind == TokenKind.LITERAL_REAL) push(Literal.getRealLiteral(t.data, toPos(t), false)); else if (t.kind == TokenKind.LITERAL_REAL_FLOAT) push(Literal.getRealLiteral(t.data, toPos(t), true)); else if (peekIdentifierToken("true")) push(new BooleanLiteral(t.data, toPos(t), true)); else if (peekIdentifierToken("false")) push(new BooleanLiteral(t.data, toPos(t), false)); else if (t.kind == TokenKind.LITERAL_STRING) push(new StringLiteral(t.data, toPos(t), t.data)); else { return false; } nextToken(); return true; } {noformat} When I add an L to make it a java Long -> 5000000000L {noformat} <form:input path="myMap[${entry.key}L]..." />{noformat} I got an other error: {noformat} java.lang.IllegalArgumentException: The field type is required at org.springframework.util.Assert.notNull(Assert.java:112) at org.springframework.webflow.mvc.view.ConvertingPropertyEditorAdapter.<init>(ConvertingPropertyEditorAdapter.java:48) at org.springframework.webflow.mvc.view.BindingModel.findSpringConvertingPropertyEditor(BindingModel.java:277) at org.springframework.webflow.mvc.view.BindingModel.findEditor(BindingModel.java:183) at org.springframework.web.servlet.support.BindStatus.<init>(BindStatus.java:125) at org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag.getBindStatus(AbstractDataBoundFormElementTag.java:179) at org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag.getPropertyPath(AbstractDataBoundFormElementTag.java:199)... {noformat}

    Spring JIRA | 3 years ago | Sven Smets
    org.springframework.expression.spel.SpelParseException: EL1035E:(pos 14): The value '5000000000' cannot be parsed as an int
  3. 0

    Hashmap in Spring form

    Stack Overflow | 3 years ago | user1128017
    org.springframework.expression.spel.SpelParseException: EL1035E:(pos 14): The value '5000000000' cannot be parsed as an int
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Parsing Generics with Spring Expression Language(SpEL)

    Stack Overflow | 9 months ago | Prem Kumar
    org.springframework.expression.spel.SpelParseException: EL1050E:(pos 8): The arguments (...) for the constructor call are missing
  6. 0

    Problem with Jasig CAS webflow

    Stack Overflow | 6 years ago | Priit
    org.springframework.expression.spel.SpelParseException: EL1041E:(pos 33): After parsing a valid expression, there is still more data in the expression: 'neq'

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. org.springframework.expression.spel.SpelParseException

      EL1035E:(pos 14): The value '5000000000' cannot be parsed as an int

      at org.springframework.expression.spel.ast.Literal.getIntLiteral()
    2. Spring Expression Language (SpEL)
      Literal.getIntLiteral
      1. org.springframework.expression.spel.ast.Literal.getIntLiteral(Literal.java:79)
      1 frame