3

I encountered problem with my IDE Idea 2016.1

It says:

Error running run spring: Cannot load /home/sergei-rudenkov/.IntelliJIdea2016.1/system/tomcat//conf/server.xml: /home/sergei-rudenkov/.IntelliJIdea2016.1/system/tomcat//conf/server.xml (No such file or directory)

Actually my tomcat situated at /opt/tomcat directory and idea kmows about it. What can be a reason of this exception?

Rudziankoŭ
  • 10,681
  • 20
  • 92
  • 192

2 Answers2

2

First, be sure you understand the difference between TOMCAT_HOME and TOMCAT_BASE. This SO answer gives a good description: https://stackoverflow.com/a/29398713/1348743

With that in mind, some explanation of how IDEA creates a TOMCAT_BASE directory for Tomcat run configurations... When you create a Tomcat Run/Debug configuration, IntelliJ IDEA creates a TOMCAT_BASE directory as {intellij_system_directory}\tomcat\{run_configuration_name}_{project_name}. (TOMCAT_HOME identifies where the binary files are and TOMCAT_BASE defines where an instance of tomcat is. Sometimes they are the same. In this case, they are not.) The {intellij_system_directory} directory is usually in ~/.IntelliJIdea2016.1/system. See Directories used by the IDE to store settings, caches, plugins and logs for more info).

That's why the path is where it is. But it looks like your path (as you show in the message) is missing the run configuration portion: .../tomcat//conf/... That should be something like .../tomcat/foo_bar/conf/.... So it seems like a config has gotten corrupt. There is a bug, IDEA-133536, I reported a couple of years ago that can this type of corruption under certain conditions. You may be hitting that.

There are two potential solutions:

  1. Recreate your run/debug configurations ensuring you give them a unique name when you first create and save them
  2. Manually edit the run/debug configuration file and modify the value for the BASE_DIRECTORY_NAME option (just search for that string). If you have shared the run/debug configuration (via the "share" option in the upper right corner), the configuration file will be in ${project_directory}/.idea/runConfigurations/${runConfigurationName}.xml. If it is not shared, it will be in the file ${project_directory}/.idea/workspace.xml. You should close the project before editing either of those files (and make a backup just in case).

For some additional information, take a look at my post: https://intellij-support.jetbrains.com/hc/en-us/community/posts/206837735--How-To-Specify-Tomcat-Cache-Directory-For-Webapp#community_comment_206857039

Community
  • 1
  • 1
Javaru
  • 30,412
  • 11
  • 93
  • 70
0

For me the problem was that I made java point to JDK instead of JRE - because of a new project, which required JDK. So the old project stopped building and gave the error above.

After returning java to point back to JRE - the old project builds fine.

=====

So:

  1. when working on new project - java => JDK
  2. when working on old project - java => JRE

:D

pesho hristov
  • 1,946
  • 1
  • 25
  • 43