14

In my IntelliJ web app, I have set the application context to myapp as shown below

enter image description here

When I set the Application context, it doesn't seem to have any effect. I was expecting the app to be deployed to myapp, or at least the generated context.xml file to set my app's context to myapp. Any thoughts on why this doesn't work (does it have something to do with the fact that this is an exploded war)?

Jeff Storey
  • 56,312
  • 72
  • 233
  • 406
  • Can't reproduce, works just fine with a brand new project created with a wizard and vanilla Tomcat 7 installation, when context is specified in Deployment the app is available at `http://localhost:8080/myapp/` after running it from IDEA. Can you share a sample project that doesn't work properly? Please also specify your IDEA and Tomcat versions. – CrazyCoder Dec 11 '12 at 02:28
  • Let me try to reproduce a sample one, sure. – Jeff Storey Dec 11 '12 at 04:18
  • @CrazyCoder, did you set the output directory of the exploded war to be /webapps? – Jeff Storey Dec 11 '12 at 04:19
  • No, IDEA deployment [works differently](http://stackoverflow.com/a/7702077/104891). – CrazyCoder Dec 11 '12 at 13:00
  • Ah, maybe my problem has to do with how I have CATALINA_BASE set. I'll give it a try and post back what happens. – Jeff Storey Dec 11 '12 at 20:50
  • @CrazyCoder that was the problem. I'm going to close this question. – Jeff Storey Dec 11 '12 at 23:36
  • 1
    No need to close, you can accept the provided answer which may help other users having the same problem. – CrazyCoder Dec 11 '12 at 23:49

1 Answers1

11

Overriding CATALINA_BASE in Tomcat startup script may break IDEA deployment as it works by supplying custom CATALINA_BASE location where the modified configuration is placed so that Tomcat loads artifacts directly from the location specified as the artifact output directory.

See the related question:

Community
  • 1
  • 1
CrazyCoder
  • 389,263
  • 172
  • 990
  • 904
  • This should be printed in GIANT BLINKING LETTERS in IDEA's 'edit configuration' dialog box. Total misery can lead from what seems like a rational decision to pass along `CATALINA_BASE` as environment variable. – Hal50000 Aug 19 '14 at 17:48