KB-1030 "velocity.log (Permission denied)" error thrown during JBoss startup

Symptoms

When starting the application server, the following errors will appear in the application server log:

15:17:42,365 INFO  [stdout] (ServerService Thread Pool -- 81) 2015-10-07 15:17:42,357 [ServerService Thread Pool -- 81] ERROR com.appiancorp.common.config.ConfigObject - An error occurred while trying to initialize the config object com.appiancorp.common.crypto.KeyStoreConfig
15:17:42,365 INFO  [stdout] (ServerService Thread Pool -- 81) org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'velocityEngine' defined in class path resource [com/appiancorp/security/auth/saml/SamlBindingSpringConfig.class]: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.apache.velocity.app.VelocityEngine com.appiancorp.security.auth.saml.SamlBindingSpringConfig.velocityEngine()] threw exception; nested exception is org.apache.velocity.exception.VelocityException: Error initializing log: Failed to initialize an instance of org.apache.velocity.runtime.log.Log4JLogChute with the current runtime configuration.
...
15:17:42,400 INFO  [stdout] (ServerService Thread Pool -- 81) Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.apache.velocity.app.VelocityEngine com.appiancorp.security.auth.saml.SamlBindingSpringConfig.velocityEngine()] threw exception; nested exception is org.apache.velocity.exception.VelocityException: Error initializing log: Failed to initialize an instance of org.apache.velocity.runtime.log.Log4JLogChute with the current runtime configuration.
...
15:17:42,402 INFO  [stdout] (ServerService Thread Pool -- 81) Caused by: org.apache.velocity.exception.VelocityException: Error initializing log: Failed to initialize an instance of org.apache.velocity.runtime.log.Log4JLogChute with the current runtime configuration.
...
15:17:42,416 INFO  [stdout] (ServerService Thread Pool -- 81) Caused by: org.apache.velocity.exception.VelocityException: Failed to initialize an instance of org.apache.velocity.runtime.log.Log4JLogChute with the current runtime configuration.
...
15:17:42,416 INFO  [stdout] (ServerService Thread Pool -- 81) Caused by: java.lang.RuntimeException: Error configuring Log4JLogChute : 
...
15:17:42,422 INFO  [stdout] (ServerService Thread Pool -- 81) Caused by: java.io.FileNotFoundException: velocity.log (Permission denied)

As a result of these errors, the application server will fail to start up.

Cause

The user running the application server process does not have permission to read or write to the velocity.log file. For JBoss, this log is located in the <JBOSS_HOME>/bin directory. For Tomcat, this log is located in the <APPIAN_HOME>/tomcat/apache-tomcat/bin directory.

The velocity.log file corresponds to the Velocity engine, a Java-based template engine used to generate SQL, XML, and other output that many web applications can use.

A class that calls the Velocity engine in JBoss was added with Appian 7.10 and is required for startup.

To ensure that any issues with the Velocity engine are appropriately recorded in the velocity.log file, the application server will attempt to write to this file. If the user running the application server process does not have both read and write access over this log file, the application server will return the above error and fail to start up.

Action

Grant the application server user permission to both read and write the velocity.log file located in:

JBoss: <JBOSS_HOME>/bin

Tomcat: <APPIAN_HOME>/tomcat/apache-tomcat/bin

Affected Versions

This article applies to Appian 7.10 and later.

Last Reviewed: November 2018

Related
Recommended