我正在尝试将现有的web应用程序从Windows迁移到Docker容器中运行。我从CentOS7和OpenJDK 11开始。将Tomcat 9放在最上面,这样就可以很好地开始。我开始为我的web应用程序添加组件,其中包括当前Windows部署的所有组件(war文件、jaas.config、setenv.sh等)。docker容器启动正常,但当我尝试登录时,我收到以下错误。
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)我停止容器并以交互模式启动,确认文件在该位置。
root@eac3366e9b83:/# ls -ltr /opt/tomcat/latest/conf/
total 236
-rwxrwxrwx 1 root root 107 Jul 13 2019 jaas.config什么可能是导致问题的原因?
发布于 2021-02-12 02:01:17
问题是从windows复制到docker图像并包含windows行终止的jaas.config文件和setenv.sh。因此,当tomcat尝试加载jaas配置文件时,名称末尾有额外的字符,并且在File.exists中失败。一旦修复了文件内容,身份验证模块就可以正常加载。
https://stackoverflow.com/questions/65564662
复制相似问题