I am having trouble adding the Java agent to Tomcat 8 running in docker. This is the exception I get:
Error opening zip file or JAR manifest missing : /usr/local/tomcat/apm/elastic-apm-agent-1.16.0.jar
Error occurred during initialization of VM
agent library failed to init: instrument
I have checked that the jar file is there and have read permissions.
It is the same error I get if I remove the file, so clearly the file is not visible by Tomcat.
This is my setenv.sh file:
export CATALINA_OPTS="$CATALINA_OPTS -javaagent:/usr/local/tomcat/apm/elastic-apm-agent-1.16.0.jar"
This is from my Dockerfile:
ADD ./lib/elastic-apm-agent-1.16.0.jar /usr/local/tomcat/apm/elastic-apm-agent-1.16.0.jar
ADD ./lib/setenv.sh /usr/local/tomcat/bin/setenv.sh
RUN chmod +x /usr/local/tomcat/bin/setenv.sh
It is running tomcat:8.5 (Have tried multiple images)
I am really stuck, so any help would be great.