How to pick up external Tomcat context descriptor when running in IDEA

Hi all,



I am having an issue with when running my web applications through IntelliJ in that IntelliJ is not copying the context descriptors for existing webapps deployed under CATALINA_HOME into the temporary CATALINA_BASE directory it sets up under my user home.
(e.g. c:\Documents and Settings\bob
.IntelliJIdea50\system\tomcat_RunAll_xxxxxxxx)

I have Tomcat setup at c:\java\tomcat5.0.28 (CATALINA_HOME) and it has a web application deployed under webapps called OMAR which has a custom context descriptor with resource definitions. This context descriptor resides in CATALINA_HOME\conf\Catalina\localhost. I also have 3 webapps which form the basis for my IntelliJ project. I have setup IntellIiJ to use the Tomcat instance at c:\java\tomcat5.0.28.

When I run Tomcat through IntelliJ, it correctly deploys all the webapps from the IntelliJ project, and it makes the webapps which are deployed under the Tomcat CATALINA_HOME available. BUT it does not use the custom context descriptor I have provided for the OMAR webapp. If I copy the custom context descriptor into the correct place under the temporary CATALINA_BASE directory after I have started Tomcat it runs fine, but this is becoming a real overhead to do this manually each time I run. Also, if I copy the context descriptor into the directory then restart Tomcat through Intellij, it will get deleted on the restart, so I cant just copy it there and leave it.

Is there a way for me to define additional context descriptors for webapps other than those in the project to be copied into the IntelliJ generated CATALINA_BASE\conf\Catalina\localhost directory.

I would create some kind of script or macro to do this on post-deploy, but the temporary CATALINA_BASE directory can have a different name each time.

Any help on this is greatly appreciated.

regards

slamdunc

2 comments
Comment actions Permalink

Hello Duncan,

There is no way to define additional context descriptors for webapps under
CATALINA_HOME. As a workaround you can create a Web module for OMAR webapp
in your project.

Hi all,

[System spec: Intellij IDEA5.1.2, Tomcat 5.0.28, Java1.5, Win XP,
Intel Core Duo]

I am having an issue with when running my web applications through
IntelliJ in that IntelliJ is not copying the context descriptors for
existing webapps deployed under CATALINA_HOME into the temporary
CATALINA_BASE directory it sets up under my user home. (e.g.
c:\Documents and
Settings\bob
.IntelliJIdea50\system\tomcat_RunAll_xxxxxxxx)

I have Tomcat setup at c:\java\tomcat5.0.28 (CATALINA_HOME) and it has
a web application deployed under webapps called OMAR which has a
custom context descriptor with resource definitions. This context
descriptor resides in CATALINA_HOME\conf\Catalina\localhost. I also
have 3 webapps which form the basis for my IntelliJ project. I have
setup IntellIiJ to use the Tomcat instance at c:\java\tomcat5.0.28.

When I run Tomcat through IntelliJ, it correctly deploys all the
webapps from the IntelliJ project, and it makes the webapps which are
deployed under the Tomcat CATALINA_HOME available. BUT it does not use
the custom context descriptor I have provided for the OMAR webapp. If
I copy the custom context descriptor into the correct place under the
temporary CATALINA_BASE directory after I have started Tomcat it runs
fine, but this is becoming a real overhead to do this manually each
time I run. Also, if I copy the context descriptor into the directory
then restart Tomcat through Intellij, it will get deleted on the
restart, so I cant just copy it there and leave it.

Is there a way for me to define additional context descriptors for
webapps other than those in the project to be copied into the IntelliJ
generated CATALINA_BASE\conf\Catalina\localhost directory.

I would create some kind of script or macro to do this on post-deploy,
but the temporary CATALINA_BASE directory can have a different name
each time.

Any help on this is greatly appreciated.

regards

slamdunc



0
Comment actions Permalink

Hi,
ok, thanks for that. I tried this before but obviously didnt think it through properly. Now I have it working although it was slightly convoluted. Heres the steps for anyone else having the same issue:

1) Created a new Web Module in my project called myapp-dummy with no src, or resources but with an exploded directory.
2) Edited the myapp-dummy Web Module Setttings, Deployment Descriptors.
- Disabled the web.xml deployment descriptor.
- Edited the Tomcat context descriptor to point to the external descriptor under CATALINA_HOME\conf\Catalina\localhost
3) Edited the Run Configuration which started all my web apps.
- under the deployment tab, selected to Deploy Web Module 'xxxxx'
- Set the application context to the same name as my webapp under tomcat.
4) Configured the deployment source
- Select to create a web module exploded directory.
- Disable synchronization with exploded directory
- Edit the location of the exploded directory to point to the expanded application directory under CATALINA_HOME\webapps
5) Delete the temporary CATALINA_BASE directory under USER_HOME\.IntelliJIdea50\system.
6) Run.........and you should see the relevant context file being copied into the CATALINA_BASE\conf\Catalina\localhost directory.

cheers

slamdunc

0

Please sign in to leave a comment.