Tomcat manager.xml error
Using Intellij12:
In my Tomcat configuration I've added an external war, and an artifact from my current project. Tomcat manages to deploy the project artifact fine, but when it gets to the external war intellij pops up a dialog saying 'Cannot load /home/xxx/.IntellijIdea12/.../conf/Catalina/localhost/manager.xml'. It appears it's something to do with the artifact deploy deleting and recreating the conf directory. I managed to work around this by moving the external war above the project artifact in the deploy order. Is this a known bug?
请先登录再写评论。
Hello,
I can't reproduce locally, but we know about some race condition-related bug (IDEA-107191) which may be related to your problem.
Can you please confirm that your problem may be workarounded as described in this comment for IDEA-107191, that is, by unchecking all logs from the logs tab of run configuration.
Regards,
Michael
it seems not to fix it, at least not reliably as i still get the errors occasionally.
Well, a few more questions then:
1. What is your Tomcat version?
2. Please check filesystem permissions -- it is best to change Tomcat installation directory owner to one used to run the IDEA.
3. Tell if "Deploy applications configured in Tomcat instance" checkbox in Run Configuration is checked. Please uncheck it if so.
4. What are your external war and your project artifact context paths? If one of them is "/manager", this could lead to a conflict with Tomcat built-in manager app.
5. Could it be that one of your artifacts depends on or somehow uses Tomcat built-in manager app?
Regards,
Michael
It's pretty clearly happening because intellij (or something) is deleting and recreating the conf directory while tomcat is trying to run.
Hello,
You should check filesystem permissions for the Tomcat Home (the installation directory) and Tomcat base directory (if it's different) as they are specified at the Application Servers dialog.
There's no need to check permissions for the runtime Tomcat base (/home/xxx/.IntellijIdea12/...) directory, because it's created by IDEA.
Indeed, IDEA cleans up the 'conf' (and the whole runtime Tomcat base) directory. However, this is performed *before* Tomcat run configuration start.
In fact, on deploy of each application, IDEA scans all the context files in the 'conf' directory but in your case it's unable to scan 'manager.xml' file, which is put there by Tomcat itself.
The most probable reason for that is the filesystem permissions of 'manager.xml'.
Regards,
Michael
ok where does it copy/create the manager.xml from?
if it is file permissions wouldn't it not work all the time, rather than sometimes?
the installation directory (and in particular webapps/host-manager/manager.xml) is readable but not writable by the intellij user. the base directory is owned by (and readable) by the intellij user.
when i looked at it it wasn't that it didn't have permissions, it's that the file doesn't exist yet. when it gets the error i can see the directory conf/Catalina/localhost but it has no manager.xml in it, straight afterwards the manager.xml is created and then if you manually deploy the WAR it works.
Hello,
The manager.xml file is put into the 'conf' folder by Tomcat, it is not controlled by IDEA in any way.
So it looks like a competitive between manager.xml creation/deletion in the 'conf' folder by Tomcat and
deploy of an artifact by IDEA -- that's why it is reproducable only sometimes.
So, I've added the workaround, which just ignores a read error specifically for manager.xml.
Please try to use the attached jar with the fix:
1) close IDEA
2) replace the jar at <IDEA home>/plugins/Tomcat/lib/tomcatIntegration.jar with the attached one
3) open IDEA
Please let me know whether it works for you
Regards,
MIchael
Attachment(s):
tomcatIntegration.jar
sorry to be paranoid but are you a Jetbrains dev? Nothing on your profile says who you are :).
Hi Christopher,
Paranoia is a good thing to reasonable extent ;)
We've updated Michael's account to avoid further doubts :)
Denis
Thanks, Denis,
I also raised the more generic youtrack http://youtrack.jetbrains.com/issue/IDEA-108742 about the possibility of internal JetBrains service for signing the jars originated from local developer builds.
Regards,
Michael
fyi, haven't had the error since i installed the patched jar. i'll let you know if it happens again.