Skip to main content



      Home
Home » Language IDEs » ServerTools (WTP) » How to change the context?
How to change the context? [message #156076] Thu, 12 January 2006 06:16 Go to next message
Eclipse UserFriend
Originally posted by: bierwagen.gmx.de

I have got problems with the applicationcontext. Normaly I would place my
parameters like "Resource" or "Realm" in a context file which is placed in
"$TOMCAT_HOME/Catalina/localhost/webappname.xml". But I fail if I try to
use a resource via JNDI in my webapplication. I tried to add the
information manually in the "$Workspace/Servers/Tomcat v5.5 Server @
localhost-config/server.xml" but without success. I just get the message
that my server.xml is corrupt.
Does anybody knows what is to do to enable JNDI-resources with the
webtools?

WTP 1.0
Eclipse 3.1.0
JSDK: 1.5.0.1
WinXP
use context.xml in META-INF [message #156106 is a reply to message #156076] Thu, 12 January 2006 07:47 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: bierwagen.gmx.de

OK, I found the solution.

I just have to create a file named "context.xml" in the directory
"$WEBAPP/META-INF" where all my context-parameters are stored.
After that I have to refresh my workspace and start the server.

ThatŽs it.

Regards Jörg
Re: How to change the context? [message #156122 is a reply to message #156076] Thu, 12 January 2006 08:05 Go to previous message
Eclipse UserFriend
It should be possible to add your context configuration to the
"$Workspace/Servers/Tomcat v5.5 Server @ localhost-config/server.xml".
As far as I know, if WTP complains about your changes, then there is
some error in those changes. Can you supply the context configuration
you are trying to add?

There is a risk to putting this directly in server.xml. If you remove
the project from the server, this configuration disappears. If you
later added the project back to the server, you would have to recreate
it. A better alternative is to create a META-INF/context.xml under the
WebContent, or equivalent, directory in your project. When the server
is published, this context configuration will be added to the
"...local-config/server.xml" context element as it is copied to its
runtime location (typically under
" $Workspace/.metadata/.plugins/org.eclipse.wst.server.core/tm p? "). This
way the context configuration is part of your project and will be
included in any Tomcat server you add it to.

Cheers,
Larry

Jörg Bierwagen wrote:
> I have got problems with the applicationcontext. Normaly I would place
> my parameters like "Resource" or "Realm" in a context file which is
> placed in "$TOMCAT_HOME/Catalina/localhost/webappname.xml". But I fail
> if I try to use a resource via JNDI in my webapplication. I tried to add
> the information manually in the "$Workspace/Servers/Tomcat v5.5 Server @
> localhost-config/server.xml" but without success. I just get the message
> that my server.xml is corrupt.
> Does anybody knows what is to do to enable JNDI-resources with the
> webtools?
>
> WTP 1.0
> Eclipse 3.1.0
> JSDK: 1.5.0.1
> WinXP
>
Previous Topic:Adding custom TLD
Next Topic:Java EE with Netbeans 5.0 beta2
Goto Forum:
  


Current Time: Sat Mar 15 11:14:10 EDT 2025

Powered by FUDForum. Page generated in 0.19180 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top