在 Tomcat 8.5 中,我在哪里定义“.properties”文件?
Where do I define ".properties" file in Tomcat 8.5?
我有一个 HsmCredentials.properties 文件,我不知道把它放在哪里以便 tomcat 可以访问它? HsmCredentials 具有 LoginManager.java 正在寻找的凭据。
2020-02-07 20:27:00,976 INFO [main] cfm2.LoginManager (LoginManager.java:238) - Looking for credentials in HsmCredentials.properties
2020-02-07 20:27:00,977 INFO [main] cfm2.LoginManager (LoginManager.java:256) - Looking for credentials in System.properties
2020-02-07 20:27:00,978 INFO [main] cfm2.LoginManager (LoginManager.java:264) - Looking for credentials in System.env
2020-02-07 20:27:00,980 ERROR [main] store.CaviumKeyStore (CaviumKeyStore.java:253) - Catchingcom.cavium.key.store.CaviumKeyStore: null
at com.cavium.key.store.CaviumKeyStore.engineGetKey(CaviumKeyStore.java:130) ~[cloudhsm-3.0.0.jar:3.0.0]
at com.cavium.key.store.CaviumKeyStore.engineGetEntry(CaviumKeyStore.java:229) ~[cloudhsm-3.0.0.jar:3.0.0]
at com.cavium.key.store.CaviumKeyStore.engineIsKeyEntry(CaviumKeyStore.java:250) [cloudhsm-3.0.0.jar:3.0.0]
at java.security.KeyStore.isKeyEntry(KeyStore.java:1294) [?:1.8.0_242]
at org.apache.tomcat.util.net.SSLUtilBase.getKeyManagers(SSLUtilBase.java:326) [tomcat-coyote.jar:8.5.50]
at org.apache.tomcat.util.net.SSLUtilBase.createSSLContext(SSLUtilBase.java:246) [tomcat-coyote.jar:8.5.50]
at org.apache.tomcat.util.net.AbstractJsseEndpoint.createSSLContext(AbstractJsseEndpoint.java:98) [tomcat-coyote.jar:8.5.50]
at org.apache.tomcat.util.net.AbstractJsseEndpoint.initialiseSsl(AbstractJsseEndpoint.java:72) [tomcat-coyote.jar:8.5.50]
at org.apache.tomcat.util.net.NioEndpoint.bind(NioEndpoint.java:246) [tomcat-coyote.jar:8.5.50]
at org.apache.tomcat.util.net.AbstractEndpoint.init(AbstractEndpoint.java:1118) [tomcat-coyote.jar:8.5.50]
at org.apache.tomcat.util.net.AbstractJsseEndpoint.init(AbstractJsseEndpoint.java:223) [tomcat-coyote.jar:8.5.50]
at org.apache.coyote.AbstractProtocol.init(AbstractProtocol.java:581) [tomcat-coyote.jar:8.5.50]
at org.apache.coyote.http11.AbstractHttp11Protocol.init(AbstractHttp11Protocol.java:70) [tomcat-coyote.jar:8.5.50]
at org.apache.catalina.connector.Connector.initInternal(Connector.java:993) [catalina.jar:8.5.50]
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:136) [catalina.jar:8.5.50]
at org.apache.catalina.core.StandardService.initInternal(StandardService.java:552) [catalina.jar:8.5.50]
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:136) [catalina.jar:8.5.50]
at org.apache.catalina.core.StandardServer.initInternal(StandardServer.java:848) [catalina.jar:8.5.50]
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:136) [catalina.jar:8.5.50]
at org.apache.catalina.startup.Catalina.load(Catalina.java:639) [catalina.jar:8.5.50]
at org.apache.catalina.startup.Catalina.load(Catalina.java:662) [catalina.jar:8.5.50]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_242]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_242]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_242]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_242]
at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:303) [bootstrap.jar:8.5.50]
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:473) [bootstrap.jar:8.5.50]
Caused by: com.cavium.cfm2.CFM2Exception: Could not find credentials to login to the HSM.
at com.cavium.cfm2.LoginManager.getInstanceWithLogin(LoginManager.java:206) ~[cloudhsm-3.0.0.jar:3.0.0]
at com.cavium.cfm2.Util.findFirstCaviumKey(Util.java:1170) ~[cloudhsm-3.0.0.jar:3.0.0]
at com.cavium.key.store.CaviumKeyStore.engineGetKey(CaviumKeyStore.java:118) ~[cloudhsm-3.0.0.jar:3.0.0]
看起来像
vi /opt/tomcat/bin/setenv.sh
有效!
如果有another/better选项,请告诉我。谢谢
我有一个 HsmCredentials.properties 文件,我不知道把它放在哪里以便 tomcat 可以访问它? HsmCredentials 具有 LoginManager.java 正在寻找的凭据。
2020-02-07 20:27:00,976 INFO [main] cfm2.LoginManager (LoginManager.java:238) - Looking for credentials in HsmCredentials.properties
2020-02-07 20:27:00,977 INFO [main] cfm2.LoginManager (LoginManager.java:256) - Looking for credentials in System.properties
2020-02-07 20:27:00,978 INFO [main] cfm2.LoginManager (LoginManager.java:264) - Looking for credentials in System.env
2020-02-07 20:27:00,980 ERROR [main] store.CaviumKeyStore (CaviumKeyStore.java:253) - Catchingcom.cavium.key.store.CaviumKeyStore: null
at com.cavium.key.store.CaviumKeyStore.engineGetKey(CaviumKeyStore.java:130) ~[cloudhsm-3.0.0.jar:3.0.0]
at com.cavium.key.store.CaviumKeyStore.engineGetEntry(CaviumKeyStore.java:229) ~[cloudhsm-3.0.0.jar:3.0.0]
at com.cavium.key.store.CaviumKeyStore.engineIsKeyEntry(CaviumKeyStore.java:250) [cloudhsm-3.0.0.jar:3.0.0]
at java.security.KeyStore.isKeyEntry(KeyStore.java:1294) [?:1.8.0_242]
at org.apache.tomcat.util.net.SSLUtilBase.getKeyManagers(SSLUtilBase.java:326) [tomcat-coyote.jar:8.5.50]
at org.apache.tomcat.util.net.SSLUtilBase.createSSLContext(SSLUtilBase.java:246) [tomcat-coyote.jar:8.5.50]
at org.apache.tomcat.util.net.AbstractJsseEndpoint.createSSLContext(AbstractJsseEndpoint.java:98) [tomcat-coyote.jar:8.5.50]
at org.apache.tomcat.util.net.AbstractJsseEndpoint.initialiseSsl(AbstractJsseEndpoint.java:72) [tomcat-coyote.jar:8.5.50]
at org.apache.tomcat.util.net.NioEndpoint.bind(NioEndpoint.java:246) [tomcat-coyote.jar:8.5.50]
at org.apache.tomcat.util.net.AbstractEndpoint.init(AbstractEndpoint.java:1118) [tomcat-coyote.jar:8.5.50]
at org.apache.tomcat.util.net.AbstractJsseEndpoint.init(AbstractJsseEndpoint.java:223) [tomcat-coyote.jar:8.5.50]
at org.apache.coyote.AbstractProtocol.init(AbstractProtocol.java:581) [tomcat-coyote.jar:8.5.50]
at org.apache.coyote.http11.AbstractHttp11Protocol.init(AbstractHttp11Protocol.java:70) [tomcat-coyote.jar:8.5.50]
at org.apache.catalina.connector.Connector.initInternal(Connector.java:993) [catalina.jar:8.5.50]
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:136) [catalina.jar:8.5.50]
at org.apache.catalina.core.StandardService.initInternal(StandardService.java:552) [catalina.jar:8.5.50]
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:136) [catalina.jar:8.5.50]
at org.apache.catalina.core.StandardServer.initInternal(StandardServer.java:848) [catalina.jar:8.5.50]
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:136) [catalina.jar:8.5.50]
at org.apache.catalina.startup.Catalina.load(Catalina.java:639) [catalina.jar:8.5.50]
at org.apache.catalina.startup.Catalina.load(Catalina.java:662) [catalina.jar:8.5.50]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_242]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_242]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_242]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_242]
at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:303) [bootstrap.jar:8.5.50]
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:473) [bootstrap.jar:8.5.50]
Caused by: com.cavium.cfm2.CFM2Exception: Could not find credentials to login to the HSM.
at com.cavium.cfm2.LoginManager.getInstanceWithLogin(LoginManager.java:206) ~[cloudhsm-3.0.0.jar:3.0.0]
at com.cavium.cfm2.Util.findFirstCaviumKey(Util.java:1170) ~[cloudhsm-3.0.0.jar:3.0.0]
at com.cavium.key.store.CaviumKeyStore.engineGetKey(CaviumKeyStore.java:118) ~[cloudhsm-3.0.0.jar:3.0.0]
看起来像
vi /opt/tomcat/bin/setenv.sh
有效!
如果有another/better选项,请告诉我。谢谢