Uploaded image for project: 'JBoss Web Server'
  1. JBoss Web Server
  2. JWS-793

tomcat-vault throws unnecessary exceptions when vault.properties isn't found

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Undefined Undefined
    • JWS 5.0_RHEL DR1
    • JWS 3.1.0 GA
    • tomcat-vault
    • None
    • Hide

      1) Install tomcat and tomcat-vault
      2) Setup tomcat to use tomcat-vault's PropertySourceVault by adding the following to catalina.properties:

      org.apache.tomcat.util.digester.PROPERTY_SOURCE=org.apache.tomcat.vault.util.PropertySourceVault
      

      3) Start tomcat without creating conf/vault.properties
      4) Observe the exceptions in the catalina.log noted above

      Show
      1) Install tomcat and tomcat-vault 2) Setup tomcat to use tomcat-vault's PropertySourceVault by adding the following to catalina.properties: org.apache.tomcat.util.digester.PROPERTY_SOURCE=org.apache.tomcat.vault.util.PropertySourceVault 3) Start tomcat without creating conf/vault.properties 4) Observe the exceptions in the catalina.log noted above

      If you don't create a vault.properties file when using vault you will see two exceptions logged:

      SEVERE [main] org.apache.tomcat.vault.util.PropertyFileManager.load /opt/rh/jws4/root/usr/share/tomcat/conf/vault.properties (No such file or directory)
       java.io.FileNotFoundException: /opt/rh/jws4/root/usr/share/tomcat/conf/vault.properties (No such file or directory)
              at java.io.FileInputStream.open(Native Method)
              at java.io.FileInputStream.<init>(FileInputStream.java:146)
              at java.io.FileInputStream.<init>(FileInputStream.java:101)
              at org.apache.tomcat.vault.util.PropertyFileManager.load(PropertyFileManager.java:46)
              at org.apache.tomcat.vault.util.PropertySourceVault.init(PropertySourceVault.java:45)
              at org.apache.tomcat.vault.util.PropertySourceVault.<init>(PropertySourceVault.java:37)
              at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
              at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
              at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
              at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
              at java.lang.Class.newInstance(Class.java:383)
              at org.apache.tomcat.util.digester.Digester.<clinit>(Digester.java:94)
              at org.apache.catalina.startup.Catalina.createStartDigester(Catalina.java:272)
              at org.apache.catalina.startup.Catalina.load(Catalina.java:514)
              at org.apache.catalina.startup.Catalina.load(Catalina.java:630)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              at java.lang.reflect.Method.invoke(Method.java:606)
              at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:311)
              at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:494)
      
      SEVERE [main] org.apache.tomcat.vault.util.PropertySourceVault.init Option [KEYSTORE_URL] is null or empty
       org.apache.tomcat.vault.security.vault.SecurityVaultException: Option [KEYSTORE_URL] is null or empty
              at org.apache.tomcat.vault.security.vault.PicketBoxSecurityVault.init(PicketBoxSecurityVault.java:164)
              at org.apache.tomcat.vault.util.PropertySourceVault.init(PropertySourceVault.java:55)
              at org.apache.tomcat.vault.util.PropertySourceVault.<init>(PropertySourceVault.java:37)
              at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
              at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
              at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
              at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
              at java.lang.Class.newInstance(Class.java:383)
              at org.apache.tomcat.util.digester.Digester.<clinit>(Digester.java:94)
              at org.apache.catalina.startup.Catalina.createStartDigester(Catalina.java:272)
              at org.apache.catalina.startup.Catalina.load(Catalina.java:514)
              at org.apache.catalina.startup.Catalina.load(Catalina.java:630)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              at java.lang.reflect.Method.invoke(Method.java:606)
              at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:311)
              at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:494)
      

      This could be confusing for users (hence the minor prio) because there are two exceptions instead of just the one FileNotFoundException. We should only log the FNFE because the other will always be present if the properties file isn't there.

            rhn-support-csutherl Coty Sutherland
            rhn-support-csutherl Coty Sutherland
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: