Jasper Template in Java Action

1
Hey guys, how are you doing? I develop a Java action that builds a report with a jasper template. Locally the app works well, but when I build a container and run the app, it crashes. In a container, the app can't find the jasper template.   I put the jasper template in that path:   Error when I execute the app in a container:   Can anyone help me:  Thanks
asked
2 answers
2

The best place to store files like this would be in your application’s resources folder. When the application is deployed these are copied into the deployment directory structure.

To access these from a Java Action you need to use the Core.getConfiguration().getResourcesPath() method. For example...
 

String filePath = Core.getConfiguration().getResourcesPath() + File.separator + filename;


Hope this helps.

answered
0

In addition to the previous answer, I believe the filepath on the cloud has forward slashes / instead of backslashes \. So you can try using forward slashes in the path.

answered