server.xml context path
How do you get IDEA to respect context paths defined in the server.xml file? Whatever I put is ignored. I know I'm updating the correct server.xml since it's loading my resources and if I remove them the server is broken.
I also tried creating web resource directory entries for the web module but it won't let you specify a resource directory that is on a remote server. What's the secret?
I'm running IDEA 9.02 and Tomcat 6.0.16.
-- Marc
Please sign in to leave a comment.
Hi Marc,
Can I ask you to provide minimal but complete standalone example that illustrates the problem?
Regards, Denis
That would require more time than I have available right now and I don't know if it's possible since it requires a context path that touches resources on another server (that you wouldn't be able to see anyway). You should be able to just add a context that refers to an external path to your server.xml and see if you can load something from it. Here's the context declaration I was using in my server.xml:
<Context path="/Designer/collateral" docBase="\\vxis1-00\collateral\dev" caseSensitive="false" privileged="false" />
From a browser address bar, I should be able to simply paste that "path" onto my base URL (localhost:8080) and specify an img file to load (e.g., http://localhost:8080/Designer/collateral/mypic.png) but it fails. For fun I also tried adding the web context to the path but that doesn't work either. It should be noted that the exact same configuration works perfectly fine in Eclipse and outside of IDEA.
-- Marc
Currently IDEA excludes all contexts before starting Tomcat. There is an issue to support running additional web apps with local Tomcat configuration
(http://youtrack.jetbrains.net/issue/IDEA-47963).
--
Nikolay Chashnikov
Software Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"
Please note that I don't care about defining multiple context files for the same tomcat instance as is stated in that issue. However, it since that restriction is related to my issue I'm impacted anyway.
This is very unfortunate. This simple little thing means IntelliJ can't be used for this project. From what I can tell, this restriction has something to do with JSP debugging but frankly, I don't care about that. I would be perfectly fine with the restriction that if I'm using my own context definitions that JSP debugging would be disabled. It's not ideal but at least I can still use the IDE. However, not supporting these contexts at all means I can't use the IDE at all as there is no workaround whatsoever. The company I work at currently (I'm a contractor) uses these contexts on every web project they have (and they have many). The end result is that this company could never adopt IDEA regardless of how they feel about the rest of the features. This is an eclipse shop but they actually don't care what IDE people use so long as they get their work done and don't cause problems. I'm an IDEA fan and have always promoted its use but it's very disappointing that IDEA doesn't support a standard server.xml. This is tantamount to saying you don't really support Tomcat (even though your marketing information says you do).
Please fix this bug.
-- Marc
Have you tried using a Remote Tomcat configuration?
You may also try putting a file named [desired context].xml in tomcat's conf directory. I'm pretty sure I've had other contexts running besides those IDEA installs (despite the YouTracker issue that indicates otherwise), although I've never done so by editing the server.xml (see tomcat docs on the preferred method).
What bug is that exactly? IDEA-47963 describes a new feature.
I always thought the Remote Tomcat configuration was for doing as you've descirbed -- connecting with a tomcat instance without having IDEA take control over tomcat's configuration.
You're going a little far, I think, in alleging that JetBrain's marketing doesn't jive with IDEA's capabilities.
Maybe if you could describe what exactly you're trying to do, you'd receive some helpful advice.
~kc
I've replaced the option 'Deploy Tomcat Manager' in run configurations by the option 'Deploy applications configured in Tomcat'. If this option is
selected IDEA will deploy all applications configured in Tomcat installation on Tomcat startup.
doesn't support a standard server.xml. This is tantamount to saying you don't really support Tomcat (even though your marketing information says you do).
--
Nikolay Chashnikov
Software Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"
Does this help my situation? Perhaps I'm not understanding the scope of this change but It still appears that my context definitions would be discarded.
-- Marc
With this checkbox selected IDEA will preserve all context definitions listed in server.xml file.
--
Nikolay Chashnikov
Software Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"
Awesome! Thanks for the quick fix!
Will this be available in the next EAP?