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

9 comments

Hi Marc,

Can I ask you to provide minimal but complete standalone example that illustrates the problem?

Regards, Denis

0

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
0

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).

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

---
Original message URL: http://www.jetbrains.net/devnet/message/5262762#5262762



--
Nikolay Chashnikov
Software Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

0

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

0

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).

salient1 wrote:


.... 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.


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

0

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.

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

---
Original message URL: http://www.jetbrains.net/devnet/message/5262775#5262775



--
Nikolay Chashnikov
Software Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

0

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.



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
0

With this checkbox selected IDEA will preserve all context definitions listed in server.xml file.

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.


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

---
Original message URL: http://www.jetbrains.net/devnet/message/5263173#5263173



--
Nikolay Chashnikov
Software Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

0

Awesome!  Thanks for the quick fix!

Will this be available in the next EAP?

0

Please sign in to leave a comment.