app server specific descriptor deployment

Man I had a fun fight between idea and Tomcat today.

I know others have run into this situation, and it seems like maybe the
feature is just plain missing.

In Tomcat (unfortunately that's what we use right now... Orion or Resin
are not an option) you have the ability to have a file called
context.xml which sits in META-INF. Normally when the webapp is
deployed Tomcat is supposed to know what to do with this file, rename it
to your context's name and use its contents to drive your context
settings.

Right now the only solution I seem to find while using is to setup an
ant task which I fire off before I run my tomcat config, and that copies
a file called abminer.xml to Catalina/localhost, then the app server
starts up.

If I do it this way, I get my database connection and everything is
happy. (the only thing we're specifying in the context.xml is the JNDI
DB connection)

While this works, it seems that there should be a way for IDEA to do
this for us. Is there one that I missed?

Have you guys figured out a better way to do this?

If I add the file to the additional descriptors, nothing happens, it
doesn't get deployed right.

If I add a META-INF/context.xml file, nothing happens on deployment.

Any help for a good solution, besides copying the darn thing, would be
helpful thanks.

R

5 comments

On Fri, 17 Dec 2004 19:10:01 -0500, Robert S. Sfeir wrote:


Right now the only solution I seem to find while using is to setup an
ant task which I fire off before I run my tomcat config, and that copies
a file called abminer.xml to Catalina/localhost, then the app server
starts up.



While this works, it seems that there should be a way for IDEA to do
this for us. Is there one that I missed?


I haven't found a way to do this explicitly.


Any help for a good solution, besides copying the darn thing, would be
helpful thanks.


I use a symlink in exactly this situation. In your case (assuming you're
using an OS with symlink support...), Catalina/localhost would contain :

abminer.xml -> /some/path/context.xml

On running your webapp config, IDEA copies the target as if it were
actually present in Catalina/localhost in the first place. This means you
don't need your ant task.

Not perfect, granted, but perhaps a workable improvement?

--
Mark Scott
mark@codebrewer.com

0

Not perfect, granted, but perhaps a workable improvement?


THanks for the suggestion, yeah workable of course, the intent though is
to find a way to allow this on project check out, so others don't have
to remember to do it.

So so far it sounds like it should be a feature request for IDEA, and
the deployment descriptor needs to be project or even module specific so
that idea can grab it if necessary. Should probably be in the Tomcat
runtime config under deployment.

Unless I hear otherwise in the next day or so, I'll add it as a feature
request.

Thanks
R

0

Another solution is to ask the tomcat guys to add the ability to specify
a tomcat-config.xml like JBoss does.

Norris Shelton
Sun Certified Java Programmer




Robert S. Sfeir wrote:

>>Not perfect, granted, but perhaps a workable improvement?
>>
>>
>
>THanks for the suggestion, yeah workable of course, the intent though is
>to find a way to allow this on project check out, so others don't have
>to remember to do it.
>
>So so far it sounds like it should be a feature request for IDEA, and
>the deployment descriptor needs to be project or even module specific so
>that idea can grab it if necessary. Should probably be in the Tomcat
>runtime config under deployment.
>
>Unless I hear otherwise in the next day or so, I'll add it as a feature
>request.
>
>Thanks
>R

>

0

I think that will take longer than asking IDEA to do it like Tomcat does
it now.

That said, every other container does it as what you call the jboss way,
it's not the jboss way, it's the right way. Orion and Resin do the same
thing as well. resin.xml in the WEB-INF dir will get loaded and parsed.

R

0

It's probably not that hard to do it. They are already doing most of
the work, just need to look in a different directory for a different
file name.

Norris Shelton
Sun Certified Java Programmer




Robert S. Sfeir wrote:

>I think that will take longer than asking IDEA to do it like Tomcat does
>it now.
>
>That said, every other container does it as what you call the jboss way,
>it's not the jboss way, it's the right way. Orion and Resin do the same
>thing as well. resin.xml in the WEB-INF dir will get loaded and parsed.
>
>R

>

0

Please sign in to leave a comment.