Toseef Zafar
Toseef Zafar

Reputation: 1767

Intellij Idea: Tomcat configuration removed each time the IDE is restarted

I am using Intellij Idea 2016.1 and I recently started to get this issue where each time I start/restart the IDE it forgets the tomcat conrfiguration and I have to reconfigure it. Any ideas why that might be and how can I fix it? Thanks in advance.

Upvotes: 0

Views: 1270

Answers (2)

Toseef Zafar
Toseef Zafar

Reputation: 1767

I just checked that "Share" checkbox and it started working for me, now when I restart the IDE it doens't forget that tomcat configuration. enter image description here

Upvotes: 0

Javaru
Javaru

Reputation: 31936

Try taking a look at this bug report -- https://youtrack.jetbrains.com/issue/IDEA-130886 -- which reported a similar issue back in 2014. It turned out to be an errant PATH VARIABLE definition causing the problem.

If not, some other recommendations:

  • Check the idea.log file for any errors (Help > Show Logs)
  • Disable any third party plugins and see if the behavior persists (Over my 14 years of using IDEA, I've seen a bug in 3rd party plugins cause all sorts of strange behaviors). If this solves it, track down the problematic plugin.
  • If the issue only happens in one project, I'd recommend recreating the project from scratch. Perhaps something is just corrupted in project's configuration file. You can also try just exiting IDEA, and moving the .idea/workspace.xml so that DEA recreates it when you open the project. This is the file where IDEA saves run configurations (among other things). If that fixes it but you "lost" too many other configurations, you can try editing the original file to remove the element <component name="RunManager" (There will be other attributes in it, so just search for name="RunManager" to find it.)
  • Make sure you are using the the latest patch level of 2016.1 (v2016.1.4 available here) or upgrade to the latest version permitted by your license (which you can check on your JetBrains Account)
  • Make sure you "save" the run/debug configuration, rather than letting it be a temporary run/debug configuration. You may also want to check the setting for "Temporary configurations limit" (defaults to 5) to see if perhaps it got set to zero. (Select the "Defaults" node in the Run/Debug configuration dialog).
  • Try using a different name for the run/debug configurations than you have been using.
  • As a workaround, in the run/debug configuration, select the "Share" option on the top right corner. Doing such will cause IDEA to save the configuration in a different location.. Normally they are saved as elements in the Project's .idea/workspace.xml file. Selecting "Share" results in them being saved in the .idea/runConfigurations directory (with the thought that you can commit that to version control to share whereas you (normally) do not save the workspace.xml file to version control.) If nothing else, this gives you a way to easily back up the configuration since it will be in a single XML file in that directory.
  • If you are feeling adventurous and want to troubleshoot the issue a bit, with idea closed, save a copy of the project's /idea/workspace.xml file. Crete the configuration and save another copy of the workspace,xnl file. Exit IDEA. Diff the previously saved two workspace.xml files to the current one. It may provide a clue as to what the issue is.

Upvotes: 2

Related Questions