问题
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.
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.
回答1:
This directory is used to have the configuration that is different from the default Tomcat conf
in the root of the server installation.
- Copy
TOMCAT_HOME/conf
intoCATALINA_BASE/conf
. - 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.
来源:https://stackoverflow.com/questions/45477139/intellij-tomcat-server-plugin-fails-to-auto-populate-my-empty-external-tomcat-b