Pages

Sunday, September 29, 2013

java.lang.NoSuchMethodError: antlr.collections.AST.getLine()

After adding Velocity to my Spring Web Application, I'm getting this error:


29.09.2013 22:44:26  WARN (AbstractMessageListenerContainer.java:696) - Execution of JMS message listener failed, and no ErrorHandler has been set.
java.lang.NoSuchMethodError: antlr.collections.AST.getLine()I

...

The error is due by the conflicts between two differents version of "antlr". You need to exclude the version from velocity-tool.

So add the following exclusion to the velocity-tools maven dependency.


  <dependency>
            <groupId>org.apache.velocity</groupId>
            <artifactId>velocity-tools</artifactId>
            <version>2.0</version>
            <exclusions>
                <exclusion>
                    <artifactId>antlr</artifactId>
                    <groupId>antlr</groupId>
                </exclusion>
            </exclusions>
   </dependency>

No comments:

Post a Comment