Pentaho

 View Only

 Not able to generate pentaho report when running a project from it's jar but it works when running it in an IDE

  • General
  • ReportingAndAnalytics
  • Pentaho
  • Pentaho
Aditya Tiwari's profile image
Aditya Tiwari posted 05-11-2020 20:30

Hey everyone,

Hope you all are safe and doing well. I am encountering this weird issue where i'm able to generate pentaho reports (in form of pdf) from my java project when i'm running it in an IDE but as soon as i build the project and generate a fat-jar for it, the reporting engine fails and is not able to parse the .prpt file which has my report template in it. I'm using gradle in my project. I've been stuck on this for many days now. I know there's something off when the jar is being built. One off thing which i saw while debugging this issue is when i run it in the IDE, the pentaho logs give the exact version of dependencies being loaded ex. "Pentaho Reporting Engine Classic 9.0.0.0-392 started" but the same log when i'm running the jar turn into "Pentaho Reporting Engine Classic TRUNK.development started". This happens for all the libraries which the pentaho reporting engine loads. Not sure if this "TRUNK.development" is causing it to fail. Here's my build.gradle file

plugins { id 'com.github.johnrengelman.shadow' version '5.2.0' id 'java'} apply plugin: 'com.github.johnrengelman.shadow'apply plugin: 'java' group 'com.test'version '1.0.0' sourceCompatibility = 1.8def mainClassName = "com.test.ui.Main"  repositories { maven { url 'https://public.nexus.pentaho.org/content/groups/omni/' } mavenCentral()} jar { manifest { attributes "Main-Class": "$mainClassName" }  from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }} dependencies { testCompile group: 'junit', name: 'junit', version: '4.12' compile group: 'log4j', name: 'log4j', version: '1.2.17' compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.25' testCompile group: 'org.slf4j', name: 'slf4j-log4j12', version: '1.7.25' testCompile group: 'org.slf4j', name: 'slf4j-simple', version: '1.7.25' compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.4' compile 'commons-io:commons-io:2.4' compile group: 'com.itextpdf', name: 'itextpdf', version: '5.5.13' compile 'org.pentaho.reporting.engine:classic-core:9.0.0.0-392' compile group: 'commons-beanutils', name: 'commons-beanutils', version: '1.9.3'}

I've attached the screenshot of the error too. You can see all thos logs with "TRUNK.development" in it. Just to reiterate, the same code works perfectly fine when running in an IDE. It'd be great if someone can help me with this.

pentaho_error

Thanks!


#ReportingandAnalytics
#Pentaho