Velocity
  1. Velocity
  2. VELOCITY-272

EOF exception when last line is commented out and has no new line at end

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.5
    • Component/s: Engine
    • Labels:
      None
    • Environment:
      Operating System: other
      Platform: Other

      Description

      So if this is the last line of a template:

        1. something....<EOF>

      Then we'll get an exception:

      org.apache.velocity.exception.ParseErrorException: Lexical error:
      org.apache.velocity.runtime.parser.TokenMgrError: Lexical error at line 8,
      column 110. Encountered: <EOF> after : ""
      at org.apache.velocity.Template.process(Template.java:181)
      at
      org.apache.velocity.runtime.resource.ResourceManagerImpl.loadResource(ResourceManagerImpl.java:466)
      at
      org.apache.velocity.runtime.resource.ResourceManagerImpl.getResource(ResourceManagerImpl.java:384)
      at
      org.apache.velocity.runtime.RuntimeInstance.getTemplate(RuntimeInstance.java:814)
      at org.apache.velocity.runtime.directive.Parse.render(Parse.java:196)
      at
      org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:153)
      at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:94)
      at
      org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:109)
      at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:94)

        Issue Links

          Activity

          Mark Thomas made changes -
          Workflow Default workflow, editable Closed status [ 12551794 ] jira [ 12552290 ]
          Mark Thomas made changes -
          Workflow jira [ 12325147 ] Default workflow, editable Closed status [ 12551794 ]
          Jean Seurin made changes -
          Link This issue is blocked by VELOCITY-535 [ VELOCITY-535 ]
          Henning Schmiedehausen made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Will Glass-Husain made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Will Glass-Husain made changes -
          Affects Version/s 1.4 [ 12310249 ]
          Environment Operating System: other
          Platform: Other
          Operating System: other
          Platform: Other
          Assignee Velocity-Dev List [ velocity-dev@jakarta.apache.org ]
          Bugzilla Id 29674
          Fix Version/s 1.5 [ 12310253 ]
          Description So if this is the last line of a template:
          ## something....<EOF>

          Then we'll get an exception:


          org.apache.velocity.exception.ParseErrorException: Lexical error:
          org.apache.velocity.runtime.parser.TokenMgrError: Lexical error at line 8,
          column 110. Encountered: <EOF> after : ""
          at org.apache.velocity.Template.process(Template.java:181)
          at
          org.apache.velocity.runtime.resource.ResourceManagerImpl.loadResource(ResourceManagerImpl.java:466)
          at
          org.apache.velocity.runtime.resource.ResourceManagerImpl.getResource(ResourceManagerImpl.java:384)
          at
          org.apache.velocity.runtime.RuntimeInstance.getTemplate(RuntimeInstance.java:814)
          at org.apache.velocity.runtime.directive.Parse.render(Parse.java:196)
          at
          org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:153)
          at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:94)
          at
          org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:109)
          at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:94)
          So if this is the last line of a template:
          ## something....<EOF>

          Then we'll get an exception:


          org.apache.velocity.exception.ParseErrorException: Lexical error:
          org.apache.velocity.runtime.parser.TokenMgrError: Lexical error at line 8,
          column 110. Encountered: <EOF> after : ""
          at org.apache.velocity.Template.process(Template.java:181)
          at
          org.apache.velocity.runtime.resource.ResourceManagerImpl.loadResource(ResourceManagerImpl.java:466)
          at
          org.apache.velocity.runtime.resource.ResourceManagerImpl.getResource(ResourceManagerImpl.java:384)
          at
          org.apache.velocity.runtime.RuntimeInstance.getTemplate(RuntimeInstance.java:814)
          at org.apache.velocity.runtime.directive.Parse.render(Parse.java:196)
          at
          org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:153)
          at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:94)
          at
          org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:109)
          at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:94)
          Jeff Turner made changes -
          Field Original Value New Value
          issue.field.bugzillaimportkey 29674 12315142
          Zoltan Luspai created issue -

            People

            • Assignee:
              Unassigned
              Reporter:
              Zoltan Luspai
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development