If you run Tomcat within IDEA then you might have noticed a couple of things:
To get around this big mess and just use your Tomcat as if you ran it outside of IDEA you simply add a CATALINA_BASE environment variable to the configuration of Tomcat (within IDEA) pointing to your Tomcat directory:
Now when you start Tomcat within IDEA you should notice that your contexts are working correctly!
Technorati Tags: IntelliJ, IDEA, Tomcat, Context, Andrew Beacock
- Your application gets started, undeployed and then started again, increasing the start up time of Tomcat and reinitialising any
load-on-startup
servlets for a second time. - Your carefully crafted
<context>
stanzas don't work as IDEA hasn't picked then up from either server.xml or META-INF/context.xml.
conf/Catalina/
.To get around this big mess and just use your Tomcat as if you ran it outside of IDEA you simply add a CATALINA_BASE environment variable to the configuration of Tomcat (within IDEA) pointing to your Tomcat directory:
Now when you start Tomcat within IDEA you should notice that your contexts are working correctly!
Technorati Tags: IntelliJ, IDEA, Tomcat, Context, Andrew Beacock
Comments
When I add the environment variable, my webapp wasn't loaded :).
I was missed something?
Thanks.
I'm not sure what is happen on your system, could you please let me know what values the Tomcat log within IDEA prints out when you attempt to start Tomcat?
I'm specifically interested in:
Using CATALINA_BASE: ?
Using CATALINA_HOME: ?
Using CATALINA_TMPDIR: ?
Using JAVA_HOME: ?
JAVA_OPTS AGAIN = ?
Which version of IDEA are you using (I'm still on v5.1)
jamie
This still works well on IDEA 8.0.1.
I was going nuts trying to access the file system from inside a .war. Relative paths that worked in IDEA didn't work from a regular Tomcat webapp and vice versa.
You saved my day ... OR night :)