Jasper Template in Java Action

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
2 answers

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.


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.