Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / October 2005

Tip: Looking for answers? Try searching our database.

moving resources from server.xml into the webapp

Thread view: 
reformy@gmail.com - 26 Sep 2005 07:52 GMT
hi
I have a web-app running under tomcat 5.0.28. In that application i m
using 2 resources - oracle jdbc connection pool and mail session. Both
are defined in the server's server.xml:

<Context path="/JCC" docBase="JCC">
 <!-- Mail sender. -->
 <Resource name="mail/Session" auth="Container"
type="javax.mail.Session"/>
...

<!-- DB connection. -->
<Resource name="jdbc/OracleDB" auth="Container"
type="javax.sql.DataSource"/>
...

Is there a way to define these two inside my application? What i want
is that the installation of my web-app will include only copying the
web-app into webapps directory, without changing anything in other
tomcat folders.

Thanks
Bryce - 26 Sep 2005 14:22 GMT
>hi
>I have a web-app running under tomcat 5.0.28. In that application i m
[quoted text clipped - 16 lines]
>web-app into webapps directory, without changing anything in other
>tomcat folders.

As an alternate, you can put your context in its own file, say
"context.xml", and put that file in your webapp's META-INF folder.

--
now with more cowbell
reformy@gmail.com - 28 Sep 2005 15:19 GMT
thanks!

I have another problem:
These resources use jar files which i need to put in tomcat/common/lib.
Is there away i can put them under tomcat/webapps/myApp/WEB-INF/lib and
tell tomcat that they are there?

I need the whole application to be under one directory without changing
anything in other tomcat libraries.
steen@jost.dk - 06 Oct 2005 12:22 GMT
Hey,

I'd like to get one thing straight. Moving the datasource into the
web-app itself, wont that complicate matters if you have a staging
environment where the datasource points to a test database instead of
the live one ?

I'm having a major discussion with a co-worker about this, and would
like to hear other people's views to this.

/Steen
reformy@gmail.com - 10 Oct 2005 13:58 GMT
Why doe's it complicate matters? This web-app is the only one using
this datasource. There is no other web-app.

anyway, i still don't have an answer for moving the lib inside the
web-app, so it doesn't metter.
Henry Townsend - 06 Oct 2005 12:49 GMT
> As an alternate, you can put your context in its own file, say
> "context.xml", and put that file in your webapp's META-INF folder.

But this is a Tomcat-specific solution, isn't it? The deployment
descriptor is covered by the API and thus should be completely
transportable between containers. I see no reference to your technique
in Servlet API 2.4.

H. Townsend
Bryce - 06 Oct 2005 16:41 GMT
>> As an alternate, you can put your context in its own file, say
>> "context.xml", and put that file in your webapp's META-INF folder.
[quoted text clipped - 3 lines]
>transportable between containers. I see no reference to your technique
>in Servlet API 2.4.

Oh, its quite possible that its Tomcat specific. Not sure.

--
now with more cowbell
Bryce - 13 Oct 2005 15:36 GMT
>> As an alternate, you can put your context in its own file, say
>> "context.xml", and put that file in your webapp's META-INF folder.
[quoted text clipped - 3 lines]
>transportable between containers. I see no reference to your technique
>in Servlet API 2.4.

But the way Tomcat defines datasources to begin with is Tomcat
specific... Only the web.xml is in the Servlet API...

--
now with more cowbell


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.