Jasper Reports fails after stop/start
Name and Version
bitnami/jasperreports:latest
What architecture are you using?
amd64
What steps will reproduce the bug?
- Run a container with
-e JASPERREPORTS_USE_ROOT_URL=true docker stop container-name-heredocker start container-name-here
See attached file for full docker command (only sensitive information is replaced). bitnami-jasper-run-command.txt
What is the expected behavior?
I am expecting the container to start normally.
What do you see instead?
I am getting an error
...
sed: can't read /opt/bitnami/tomcat/webapps/ROOT/index.jsp: No such file or directory
See attached log (I've used -e BITNAMI_DEBUG=true
bitnami-jasper-debug-error.txt
Additional information
The Jasper Reports version is 8.1.
Please, note that the Bitnami team is not actively monitoring GitHub Issues for this project. This issue will stay open for 20 days to allow the community to contribute, after 15 days without activity the issue will be marked as stale, being closed after 5 days.
If you would like to contribute to this container image by fixing a bug or adding a new feature, feel free to create a PR, the Bitnami team will be happy to review it and provide feedback.
If you would like to contribute to this container image by fixing a bug or adding a new feature, feel free to create a PR, the Bitnami team will be happy to review it and provide feedback.
Sure @carrodher, I would like to do it, but unfortunately I'm not able to do is due to my superficial knowledge of how your scripts are made. The only clue for me is: https://github.com/bitnami/containers/blob/f52e9d9d91d6dd99ff243e40d3e0b210864f042d/bitnami/jasperreports/8/debian-11/rootfs/opt/bitnami/scripts/libjasperreports.sh#L421-L426
I am not sure why symlink doesn't work after stop / start.
If you could get me a further directions how I could debug it and/or fix it, I certainly will give my five cents to the project :smile:
This Issue has been automatically marked as "stale" because it has not had recent activity (for 15 days). It will be closed if no further activity occurs. Thanks for the feedback.
Due to the lack of activity in the last 5 days since it was marked as "stale", we proceed to close this Issue. Do not hesitate to reopen it later if necessary.
@kalatchev I experience the same issue as you described here with 8.2. have you found a solution for it?
@kalatchev
The issue was closed but without finding a solution. I also ran into this problem and even though it's late I would like to give you my solution.
I edited the file libjasperreports.sh and i change this lines:
# Make Tomcat redirect to /jasperserver
replace_in_file "$BITNAMI_ROOT_DIR/tomcat/webapps/ROOT/index.jsp" '<%\s*$' '<%\nresponse.sendRedirect("/jasperserver");'
# Move JasperServer to default Tomcat URL
if is_boolean_yes "${JASPERREPORTS_USE_ROOT_URL}"; then
rm -rf "$BITNAMI_ROOT_DIR/tomcat/webapps/ROOT"
rm "$BITNAMI_ROOT_DIR/tomcat/webapps/jasperserver"
ln -s "$JASPERREPORTS_BASE_DIR" "$BITNAMI_ROOT_DIR/tomcat/webapps/ROOT"
fi
with this:
# Move JasperServer to default Tomcat URL
if is_boolean_yes "${JASPERREPORTS_USE_ROOT_URL}"; then
rm -rf "$BITNAMI_ROOT_DIR/tomcat/webapps/ROOT"
rm "$BITNAMI_ROOT_DIR/tomcat/webapps/jasperserver"
ln -s "$JASPERREPORTS_BASE_DIR" "$BITNAMI_ROOT_DIR/tomcat/webapps/ROOT"
else
# Make Tomcat redirect to /jasperserver
replace_in_file "$BITNAMI_ROOT_DIR/tomcat/webapps/ROOT/index.jsp" '<%\s*$' '<%\nresponse.sendRedirect("/jasperserver");'
fi
Just copy libjasperreports.sh from /opt/bitnami/scripts to local dir, change the lines and remap the file in docker-compose.yml as volume:
volumes
- ./yourlocaldir/libjasperreports.sh:/opt/bitnami/scripts/libjasperreports.sh
Why tihs change? Because what happened step by step was:
First start:
index.jspedited with redirect to jasperserver --> OK- if JASPERREPORTS_USE_ROOT_URL=true, remove ROOT and jasperserver apps and link jasperserver to ROOT --> OK
Restart:
index.jspedited with redirect to jasperserver --> ERROR!! This is because the jasperserver app does not contain any index.jsp
I hope this helps someone again! Thanks