1. Home
  2. Troubleshooting
  3. java.io.FileNotFoundException

java.io.FileNotFoundException

Issue

Application does not start and the following errors are seen in the logs.

21-Oct-2018 03:35:52.154 SEVERE [http-nio-8080-exec-3] org.apache.catalina.core.ApplicationContext.log FAIL - Application at context path [/falcon-deploy-1.0] could not be started
 org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/falcon-deploy-1.0]]

Caused by: java.lang.IllegalStateException: Logback configuration error detected:
ERROR in ch.qos.logback.core.rolling.RollingFileAppender[FILE] - Failed to create parent directories for [/falcon_deploy/app/log/falconDeploy.log]
ERROR in ch.qos.logback.core.rolling.RollingFileAppender[FILE] - openFile(/falcon_deploy/app/log/falconDeploy.log,true) call failed. java.io.FileNotFoundException: /falcon_deploy/app/log/falconDeploy.log (No such file or directory)

Solution

Application is unable to start since it cannot create the required directories. Make sure the required directories exist have 770 permission. Refer to Pre-Install Step document from Falcon Deploy Knowledge Base.

> sudo mkdir -p /falcon_deploy/app
> sudo chown -R falcon:deploy /falcon_deploy/app
> sudo chmod -R 770 /falcon_deploy/app

> sudo mkdir -p /falcon_deploy/primary
> sudo chown -R falcon:deploy /falcon_deploy/primary
> sudo chmod -R 770 /falcon_deploy/primary

> sudo mkdir -p /falcon_deploy/backup
> sudo chown -R falcon:deploy /falcon_deploy/backup
> sudo chmod -R 770 /falcon_deploy/backup

# SetGiD to falcon directories
> sudo chmod g+s /falcon_deploy/app
> sudo chmod g+s /falcon_deploy/primary
> sudo chmod g+s /falcon_deploy/backup

# Note, group permissions are now set to rws
> cd /falcon_deploy
> ls -ltr
total 0
drwxrws--- 2 falcon deploy 6 Oct 22 05:31 backup
drwxrws--- 2 falcon deploy 6 Oct 23 02:26 primary
drwxrws--- 2 falcon deploy 6 Oct 23 02:26 app

Also make sure tomcat user is added to tomcat and deploy group. 

# Create the 'tomcat' group.                                            
> sudo groupadd tomcat

# Create the 'tomcat' user and add to groups 'tomcat' and 'deploy'
> sudo /usr/sbin/useradd -M -s /bin/nologin -g tomcat -G deploy tomcat
Updated on March 10, 2019

Related Articles