I have a Jasper template that consumes JSON data. I have a JsonQL as language for the datasource. The template compiles fine locally and generates a PDF preview.
But when we try to execute this on the server (standalone app using jasperreports 6.4.0 as a dependency), I get this error message:
org.springframework.web.util.NestedServletException: Handler processing failed; nested exception is java.lang.NoClassDefFoundError: antlr/TokenStream at org.springframework.web.servlet.DispatcherServlet.triggerAfterCompletionWithError(DispatcherServlet.java:1302) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:977) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:893) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:968)
I have checked the pom file for net.sf.jasperreports 6.4.0 and it has this as a dependency:
<dependency>
<groupId>antlr</groupId>
<artifactId>antlr</artifactId>
<version>2.7.5</version>
<optional>true</optional>
</dependency>
So I can't figure out why I get a NoClassDefFoundError for antrl.TokenStream. I found some posts online that say use Antlr 2.7.7 but this is the Jasper engine pom so I can't overwrite it easily. Could there be any other reason?
We have lots of other templates that work just fine. This is the first one that uses JsonQL. Is that a factor?