TOMCAT 7, Intellij12, the melting pot and the confusion (for me atleast)

Friends:

I have started to use (reuse) Intellij with Tomcat7.  I have used with Websphere in the past but company is moving towards Tomcat.

I need help with some questions.

I come from MyEclipse->Tomcat7(MET7) combo to Intellij->Tomcat7(IIT7) combo. If this works out I will recommend Intellij7 to folks.

Coming from ME7, the CATALINA_BASE AND CATALINA_HOME are the same folders.
The Tomcat we have is customized in the sense that we have added JAVA_OPTS to the catalina.sh.
There catalina.properties is customzed to pick up our own jars as well.

What is the main diff between Tomcat-Local vs Tomcat-Remote types of deployment ?

In TomcatLocal is the copying of artifacts avoided and hence speed obtained ?

To do this, the CATALINA_BASE is changed or customized is that right ?

If CATALINA_BASE is customzed then where is made available to catalina.sh file ?

================================================

Is there a way to tell IntelliJ, that I will take a hit of copy speeds, but deploy to $TOMCAT_HOME/webapps folder all the time ?  This way it will allow me to run Tomcat when IntelliJ is not running.  Yes, I understand that I can create a .sh file to    redefine CATALINA_BASE each time but I want a one place for all my webapps.

More questions may follow but for now I will start here.

-Narahari

2 comments
Comment actions Permalink

Adding to this, any way to tell IntelliJ that if you have to use CATALINA_BASE do so at location outside of ~/.IntelliJ/.... ?




0
Comment actions Permalink

Hello,

> What is the main diff between Tomcat-Local vs Tomcat-Remote types of deployment ?

In case of deploy with a local run configuration:
- IDEA creates deployment descriptor file per each artifact being deployed (in the <'runtime" Tomcat base>/conf/Catalina/localhost
folder)
- relies on JMX to actually deploy and check deployment status
- keeps artifact being deployed in the project output folder

In case of deploy with a remote run configuration:
- relies on JMX _only_ to actually deploy and check deployment status (does _not_ create a deployment descriptor file)
- uploads artifact being deployed to the specified remote location (if remote staging type is other than the 'Same file system')

> In TomcatLocal is the copying of artifacts avoided and hence speed obtained ?

Yes

> To do this, the CATALINA_BASE is changed or customized is that right ?

On each launch of a local Tomcat run configuration, original CATALINA_BASE folder (as specified in the 'Tomcat base directory' field of the Application server dialog) is copied to a created "runtime" CATALINA_BASE folder.
After copied, "runtime" CATALINA_BASE folder is customized.
Location of  "Runtime" CATALINA_BASE folder is chosen on the first launch is kept on further launches.
The main reason for this, is to allow to launch several Tomcat local run configurations being based on the same Tomcat installation.

> If CATALINA_BASE is customzed then where is made available to catalina.sh file ?

IDEA passes CATALINA_BASE environment variable with the "runtime" value to the tomcat startup script on the local run configuration launch (it is not shown in the UI in the list of environment variables).

> Is there a way to tell IntelliJ, that I will take a hit of copy speeds, but deploy to $TOMCAT_HOME/webapps folder all the time ?


You may try to use a remote Tomcat run configuration and specify the $TOMCAT_HOME/webapps folder as the target for remote staging --
you'll need to choose 'Local or mounted folder' remote staging type.
Yet I don't recomment this, since IDEA would loose control over the deployment process and may report incorrect deployment status if artifacts are placed into the $TOMCAT_HOME/webapps folder.


> Adding to this, any way to tell IntelliJ that if you have to use CATALINA_BASE do so at location outside of ~/.IntelliJ/.... ?

Yes, yet in the 'hackish' way:
- edit <project home>/.idea/workspace.xml
- find  //configuration[@name='<your run config name>']/server-settings/option[@name='BASE_DIRECTORY_NAME']
- set @value to a path relative to ~/.IntelliJ/system/tomcat, i.e. to a something like "..\..\..\..\custom-catalina-base"

HTH,
Regards,
Michael
0

Please sign in to leave a comment.