1

I am trying to move an existing web application from Windows to run in a Docker container. I started with Centos 7 and OpenJDK 11 as a starting point. Put Tomcat 9 on top and to starts fine. I started adding the pieces for my web application with all the pieces for our current Windows deployment (war file, jaas.config, setenv.sh, etc.). The docker container starts fine but when I try to log in I get the following error..

04-Jan-2021 13:27:30.381 SEVERE [http-nio-8080-exec-9] org.apache.catalina.realm.JAASRealm.authenticate Unexpected error
    java.lang.SecurityException: java.io.IOException: /opt/tomcat/latest/conf/jaas.config
 (No such file or directory)
        at java.base/sun.security.provider.ConfigFile$Spi.<init>(ConfigFile.java:137)

I stop the container and start in interactive mode I confirm that the file is in that location.

root@eac3366e9b83:/# ls -ltr /opt/tomcat/latest/conf/
total 236
-rwxrwxrwx 1 root   root      107 Jul 13  2019 jaas.config

What could be causing the problem?

Mike Rother
  • 591
  • 4
  • 16

1 Answers1

1

The problem was that the jaas.config file and setenv.sh that were copied from windows to the docker image and contained windows line termination. So when tomcat tried to load the jaas config file, the name had extra character at end and failed in File.exists. Once the file contents were fixed, the authentication module loaded fine.

Mike Rother
  • 591
  • 4
  • 16