Search code examples
tomcatintellij-ideaconfigurationtomcat8run-configuration

IntelliJ Tomcat Server plugin fails to auto-populate my empty external Tomcat `base` folder


When I point the Tomcat and TomEE Integration plugin in IntelliJ Ultimate 2017.2 via menu item Run > Edit Configurations to a fresh download of Tomcat 8.5.16, my Vaadin 8.1 app runs successfully. Good.

enter image description here

But when I optionally point the configuration’s Server > Application Server > Configure button > Tomcat base directory to an empty folder, I get a message:

Cant find directory 'Users/basilbourque/apache-tomcat-base-dev/conf'

➠ Must I create this conf folder?

In contrast to IntelliJ, when I point NetBeans IDE to an empty folder when running Tomcat externally, it automatically populates the empty folder with the entire hierarchy of folders and files needed to run the app.

So, okay, I create a conf folder in my otherwise empty folder. This satisfies the Edit Configurations panel. Next, I run my app by running this configuration.

Notice how Unnamed_ is prepended to my application name (timepiece), I get this message in a floating dark-red box within the IntelliJ IDE window:

Error running 'Tomcat 8.5.16'

Cannot load /Users/basilbourque/Library/Caches/IntelliJIdea2017.2/Unnamed_timepiece/conf/server.xml: /Users/basilbourque/Library/Caches/IntelliJIdea2017.2/tomcat/Unnamed_timepiece/conf/server.xml (No such file or directory) (5 minutes ago)

➠ Must I create a server.xml?

Such a requirement confuses me given that as I said above, NetBeans simply populates the external Tomcat "base" empty folder as needed entirely and automatically.

I am also curious why the message repeats the same path with a colon in the middle, though that is a minor issue.


Solution

  • This directory is used to have the configuration that is different from the default Tomcat conf in the root of the server installation.

    1. Copy TOMCAT_HOME/conf into CATALINA_BASE/conf.
    2. Select this new CATALINA_BASE in the IntelliJ Run > Edit Configurations dialog.

    This way you can have the same physical installation of the server, but run multiple server instances with different configurations. IntelliJ IDEA expects the pre-configured CATALINA_BASE from you, it will not populate it automatically.

    screenshot of copying "conf" folder from a Tomat folder into an empty base folder