Starting Tomcat within IntelliJ
I'm trying to run (or more specifically debug) a servlet through IntelliJ, but cannot get Tomcat to start. I get the following error:
Error running Tomcat: Cannot load C:\Documents and Settings\MooreJ\.IntelliJIdea50\system\tomcat_Unnamed_a3e0a9e\conf\Catalina\localhost\myWebApp.xml (Access is denied)
I'm using version 5.1.1 but have downloaded an evaluation of 6.0.2 and have the same problem. I've gone back to basics and have a new project, with a new web module MyWebApp containing a simple servlet TestServlet. I've set up a Tomcat 5 run configuration that should deploy MyWebApp and set the startup script to C:\jakarta-tomcat-5.0.27\bin\catalina.bat. I also pass in an environment variable CATALINA_BASE=C:\jakarta-tomcat-5.0.27\ (on advice I found trawling the net) though I'm not sure if this is correct.
Does anyone have any ideas what's going wrong?
Thanks in advance
Jon
请先登录再写评论。
Hello Jonathan,
You should specify path to CATALINA_BASE in "Tomcat base directory" field
in Settings |Application Servers dialog instead of setting enviroment variable.
Hello Nikolay,
Thanks but that hasn't helped. I've now deleted the module MyWebApp completely. I've uninstalled IntelliJ, clearing the cache, and reinstalled. I've searched the file system and registry for MyWebApp. When I try and set up another web module called MyTestApp I still get the original error message about MyWebApp. IntelliJ must be caching it somewhere but I can't think where else to look. This means that I can't run or debug Tomcat at all.
Any further suggestions gratefully received.
Jon
Have you checked in the tomcat webapps directory if there are any leftovers ?
Also, the .IntelliJIdea50 directory in your home directory, that contains both a tomcat deployment tree and caches. Maybe you'd want to clean that out ? ( not recommended on a regular basis since I presume it contains your settings as well )
There's nothing in the webapps dirctory. I also completely uninstalled IntelliJ and removed .IntelliJIdea50. When I try and start Tomcat it creates a directory called C:\Documents and Settings\MooreJ\.IntelliJIdea50\system\tomcat_Tomcat_e0aa52fb\conf\Catalina\localhost\MyWebApp.xml (Note MyWebApp.xml is a directory name, not a file name), then complains that it cannot load that directory (I'm assuming it should be trying to load a file not a directory).
So the two questions are:
1. Why is it trying to create anything with the name MyWebApp, since there is no project or module anywhere with that name?
2. Why is it creating a directory with an .xml extension then trying to load it?
This is very frustrating...
Thanks for any further suggestions.
Jon
Hello Jonathan,
Please check whether directory ]]>/conf/Catalina/localhost contains
directory MyWebApp.xml. If it does try to remove this MyWebApp.xml directory.
Thank you, that seems to have solved the problem. I thought I'd searched the whole file system but must have missed that one...
Cheers
Jon