We have a Java app that we are running inside a container but we are seeing inconsistent behaviour depending on where the container is being run.
The container image contains all the files that make up the application and the ENTRYPOINT command that invokes Java specifies the class path using the -cp switch.
java -cp /some/folder/* com.mycompany.myclass
When run locally the container starts up fine, but when in an integration environment we see a java.lang.ClassNotFoundException
for com.mycompany.myclass
.
Obviously normally that kind of error would mean we have classes missing or we don’t have the class path set up correctly, but this should be part of the container image and everything works when the image is spun up on a different machine.
What externally factors outside the container could be causing this kind of issue?