2

Have a newly installed Tomcat-9, I'm trying to run a project with IntelliJ IDEA, It throws an error Directory is invalid saying:

Error running 'Tomcat 9.0.40': Error copying configuration files from /opt/apache-tomcat-9/conf to /home/saad/.IntelliJIdea2019.3/system/tomcat/Tomcat_9_0_40_CS_IS_1_20170212_Assignment1/conf: Directory is invalid /opt/apache-tomcat-9/conf/Catalina

I made sure that both directories mentioned in error exist, What is the problem here?

Thanks in advance.

zyydoosh
  • 387
  • 2
  • 14

2 Answers2

0

I also faced such situation Directory is invalid /opt/apache-tomcat-9/conf/Catalina. So what I did is basically I remove all tomcat apt packages

sudo apt remove --purge tomcat9 tomcat9-docs
sudo apt autoremove
sudo apt autoclean

After that I download tomcat9 binary link and extract it and create a soft link for easy use

sudo tar -xvf ~/Downloads/<binary-name> -C /usr/local
cd /usr/local
sudo ln -s <tomcat-9-directory-name> tomcat9

change the mod of the tomcat9 directory

sudo chmod -R 777 tomcat9/

Then goto intelliJ and navigateFile > Settings > Build, Execution, Deployment > Application Servers. Remove tomcat settings if available(minus icon). Then add new Tomcat server by pressing plus icon. Set Tomcat home path as/usr/local/tomcat9 and press ok.

enter image description here

Once you finished it, open the configuration dialog Run > Edit Configurations and remove Tomcat servers if there any. And Press plus icon and select Tomcat Server. Then goto the Deployment tab and press plus sign and add the artifact that you want to deploy. Then press ok and re-run the application.

Rasika Weragoda
  • 936
  • 14
  • 15
0

In my case, all I did was change some permissions:

sudo chmod +rx /usr/share/tomcat10/conf/Catalina

Though that might just be a temporary solution, I'm not sure.

gardenapple
  • 146
  • 1
  • 12