[MGNLMIGRATION-327] Error parsing [ in javascript embeded in freemarker template Created: 16/Nov/15  Updated: 15/Apr/16  Resolved: 14/Jan/16

Status: Closed
Project: Migration 4.4 to 4.5 (closed)
Component/s: Template Script Migration
Affects Version/s: None
Fix Version/s: 1.2.10

Type: Bug Priority: Critical
Reporter: Teresa Miyar Assignee: Robert Šiška
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: 0d
Time Spent: 2m
Original Estimate: Not Specified

Attachments: File mainLM.ftl    
Issue Links:
dependency
depends upon MGNLMIGRATION-332 Exclude machine-generated code from C... Closed
Template:
Acceptance criteria:
Empty
Date of First Response:
Sprint: Kromeriz 21, Kromeriz 26
Story Points: 1

 Description   
The script attached causes an error while parsing

It ends with a EOF, line 109:29 missing EOF at '[' 

line 47:2 no viable alternative at character '}'
info.magnolia.migration.task.templates.TemplateErrorException: java.lang.RuntimeException: NoViableAltException('}'@[1:1: Tokens : ( TAG_OPEN | TAG_CLOSE | INTAG_OPEN | INTAG_CLOSE | TAGNAME | INTERPOLATION_OPEN | INTERPOLATION_CLOSE | INTAG_DATA | JAVACODE | FLATTEXT | EXPRESSION | SCRIPTLET_OPEN | SCRIPTLET_CLOSE );])
at info.magnolia.migration.task.templates.TemplateReader.migrateScript(TemplateReader.java:119)
at info.magnolia.migration.task.templates.TemplateReader.migrateScript(TemplateReader.java:83)
at info.magnolia.migration.task.templates.TemplateReader.main(TemplateReader.java:169)
Caused by: java.lang.RuntimeException: NoViableAltException('}'@[1:1: Tokens : ( TAG_OPEN | TAG_CLOSE | INTAG_OPEN | INTAG_CLOSE | TAGNAME | INTERPOLATION_OPEN | INTERPOLATION_CLOSE | INTAG_DATA | JAVACODE | FLATTEXT | EXPRESSION | SCRIPTLET_OPEN | SCRIPTLET_CLOSE );])
at info.magnolia.migration.task.templates.jsp.JspLexer.recover(JspLexer.java:39)
at org.antlr.runtime.Lexer.nextToken(Lexer.java:104)
at org.antlr.runtime.BufferedTokenStream.fetch(BufferedTokenStream.java:143)
at org.antlr.runtime.BufferedTokenStream.sync(BufferedTokenStream.java:137)
at org.antlr.runtime.CommonTokenStream.consume(CommonTokenStream.java:68)
at org.antlr.runtime.BaseRecognizer.match(BaseRecognizer.java:106)
at info.magnolia.migration.task.templates.jsp.JspParser.flattext(JspParser.java:968)
at info.magnolia.migration.task.templates.jsp.JspParser.document(JspParser.java:149)
at info.magnolia.migration.task.templates.TemplateReader.migrateScript(TemplateReader.java:108)
... 2 more
Caused by: NoViableAltException('}'@[1:1: Tokens : ( TAG_OPEN | TAG_CLOSE | INTAG_OPEN | INTAG_CLOSE | TAGNAME | INTERPOLATION_OPEN | INTERPOLATION_CLOSE | INTAG_DATA | JAVACODE | FLATTEXT | EXPRESSION | SCRIPTLET_OPEN | SCRIPTLET_CLOSE );])
at info.magnolia.migration.task.templates.jsp.JspLexer$DFA8.specialStateTransition(JspLexer.java:1644)
at org.antlr.runtime.DFA.predict(DFA.java:80)
at info.magnolia.migration.task.templates.jsp.JspLexer.mTokens(JspLexer.java:632)
at org.antlr.runtime.Lexer.nextToken(Lexer.java:85)
... 9 more


 Comments   
Comment by Antonín Juran [ 02/Dec/15 ]

Elements <script></script> and their content is removed in migrated templates.

Comment by Philip Mundt [ 29/Dec/15 ]
  • Module (reactor) doesn't build
  • Causes failure:
    [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.3:compile (default-compile) on project magnolia-4-5-migration: Compilation failure: Compilation failure:
    [ERROR] /var/lib/jenkins/jobs/m_4-5-migration/workspace/magnolia-4-5-migration/target/clover/src/info/magnolia/migration/task/templates/freemarker/FreemarkerLexer.java:[1760,99] code too large for try statement
    [ERROR] /var/lib/jenkins/jobs/m_4-5-migration/workspace/magnolia-4-5-migration/target/clover/src/info/magnolia/migration/task/templates/freemarker/FreemarkerLexer.java:[1760,19] code too large
    [ERROR] -> [Help 1]
    [ERROR] 
    [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
    [ERROR] Re-run Maven using the -X switch to enable full debug logging.
    [ERROR] 
    [ERROR] For more information about the errors and possible solutions, please read the following articles:
    [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
    [ERROR] 
    [ERROR] After correcting the problems, you can resume the build with the command
    [ERROR]   mvn <goals> -rf :magnolia-4-5-migration
    

How can this be QA'd and closed if the build was not successful once since integration?

Comment by Robert Šiška [ 14/Jan/16 ]

The issue with failing build is fixed in MGNLMIGRATION-332.

Closing this issue without changes.

Generated at Mon Feb 12 10:19:15 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.