Re: JNDI Datasource question

2002-12-02 Thread Ron Smits
Jake,

thanks, this is a great answer and answers my question exactly. :)
Especially the META-INF/context.xml. was somthing that I must have
overlooked 

Ron

On Mon, 2002-12-02 at 11:09, Jacob Kjome wrote:
 
 Hi Ron,
 
 That is referring to a context configuration file.  You *always* need to 
 set up your DataSources through the proprietary server configuration.  The 
 stuff in the web.xml only defines the interface.  For instance, if you set 
 up DBCP specific stuff in the web.xml file, your app would be dependent on 
 running under Tomcat and be incompatible with every other app server.  JNDI 
 is meant to provide a standard interface while allowing the vendor to 
 provide a proprietary implementation.  That way, you get to code to a 
 standard and you get to pick the vendor who provides the best 
 implementation (by your own definition).  That provides for both standards 
 *and* market competition.  Neat, eh?
 
 See the following for context configuration files:
 
http://jakarta.apache.org/tomcat/tomcat-4.1-doc/config/host.html#Automatic%20Application%20Deployment
 
 Also, look at admin.xml and manager.xml in CATALINA_HOME/webapps for reference.
 
 I addition, Craig R. McClanahan pointed out the following when deploying 
 via the manager app:
 
 quote
 For the deploy command, simply include your context confgiuration file in
 the WAR at META-INF/context.xml.
 
 In Tomcat 4.1, you can dynamically deploy a context configuration file
 instead of, or along with your webapp.  Such a file can contain the
 Context element, and all nested subelements, from what you would
 normally put in server.xml, so you can indeed dynamically deploy an app
 with a custom realm.
 /quote
 
 Jake



--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




JNDI Datasource question

2002-12-01 Thread Ron Smits
Evening

A question to grow my knowledge:)

On tomcat 4.1.12-LE-jdk14 deployment with java jsdk 1.4.1_01-b01 I have
installed the two missing jar files from commons (dbcp and pool) and
made the example from the documentation (/DBTest) work. Great work, well
written and very clear.

So my question. If I want to use DataSources I always need to change or
add Contect (or defaultContext) in the conf/server.xml? According to the
documentation I can define a Resource as:
Context ...
  ...
  Resource name=jdbc/EmployeeDB auth=Container
type=javax.sql.DataSource
 description=Employees Database for HR Applications/
  ...
/Context

in server.xml or as 
resource-ref
  descriptionEmployees Database for HR Applications/description
  res-ref-namejdbc/EmployeeDB/res-ref-name
  res-ref-typejavax.sql.DataSource/res-ref-type
  res-authContainer/res-auth
/resource-ref

int web.xml of an application that is deployed. But where to I put all
the values named in the ResourceParams entries if I want to declare them
from the web.xml file?

Ron




--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Re: JNDI Datasource question

2002-12-01 Thread Jacob Kjome

Hi Ron,

That is referring to a context configuration file.  You *always* need to 
set up your DataSources through the proprietary server configuration.  The 
stuff in the web.xml only defines the interface.  For instance, if you set 
up DBCP specific stuff in the web.xml file, your app would be dependent on 
running under Tomcat and be incompatible with every other app server.  JNDI 
is meant to provide a standard interface while allowing the vendor to 
provide a proprietary implementation.  That way, you get to code to a 
standard and you get to pick the vendor who provides the best 
implementation (by your own definition).  That provides for both standards 
*and* market competition.  Neat, eh?

See the following for context configuration files:
http://jakarta.apache.org/tomcat/tomcat-4.1-doc/config/host.html#Automatic%20Application%20Deployment

Also, look at admin.xml and manager.xml in CATALINA_HOME/webapps for reference.

I addition, Craig R. McClanahan pointed out the following when deploying 
via the manager app:

quote
For the deploy command, simply include your context confgiuration file in
the WAR at META-INF/context.xml.

In Tomcat 4.1, you can dynamically deploy a context configuration file
instead of, or along with your webapp.  Such a file can contain the
Context element, and all nested subelements, from what you would
normally put in server.xml, so you can indeed dynamically deploy an app
with a custom realm.
/quote

Jake

At 10:02 PM 12/1/2002 +0100, you wrote:
Evening

A question to grow my knowledge:)

On tomcat 4.1.12-LE-jdk14 deployment with java jsdk 1.4.1_01-b01 I have
installed the two missing jar files from commons (dbcp and pool) and
made the example from the documentation (/DBTest) work. Great work, well
written and very clear.

So my question. If I want to use DataSources I always need to change or
add Contect (or defaultContext) in the conf/server.xml? According to the
documentation I can define a Resource as:
Context ...
  ...
  Resource name=jdbc/EmployeeDB auth=Container
type=javax.sql.DataSource
 description=Employees Database for HR Applications/
  ...
/Context

in server.xml or as
resource-ref
  descriptionEmployees Database for HR Applications/description
  res-ref-namejdbc/EmployeeDB/res-ref-name
  res-ref-typejavax.sql.DataSource/res-ref-type
  res-authContainer/res-auth
/resource-ref

int web.xml of an application that is deployed. But where to I put all
the values named in the ResourceParams entries if I want to declare them
from the web.xml file?

Ron




--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]



JNDI DataSource Question

2001-12-14 Thread Bhamidi Krishna

Hi,

I had posted this question some time back and am posting just in case some 
one may have just missed it.

I am trying to get a JNDI connection to a datasource. For this I defined my 
datasource exactly as it is described in the Tomcat docs - define a resource 
in WEB.XML and in SERVER.XML

When I try to connect, my context keeps returning me a NULL DataSource. I 
read thru all of the mails in the list, I could not get any definite 
pointers.

Can someone who has solved the problem, please point me in the right 
direction.

Thankyou for the time,
Krishna.




_
MSN Photos is the easiest way to share and print your photos: 
http://photos.msn.com/support/worldwide.aspx


--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]




Re: JNDI DataSource Question

2001-12-14 Thread Micael Padraig Og mac Grene

At 01:34 PM 12/14/01 +, you wrote:
Hi,

I had posted this question some time back and am posting just in case some 
one may have just missed it.

I am trying to get a JNDI connection to a datasource. For this I defined 
my datasource exactly as it is described in the Tomcat docs - define a 
resource in WEB.XML and in SERVER.XML

When I try to connect, my context keeps returning me a NULL DataSource. I 
read thru all of the mails in the list, I could not get any definite pointers.

Can someone who has solved the problem, please point me in the right 
direction.

Thankyou for the time,
Krishna.


Your problem inevitably has to be that your code is referencing something 
that is not being found.  That leaves two potential problems: (1) you don't 
have your data source from your service provider in the right place; (2) 
you don't have a reference as required to where you have the 
datasource.  If you have the data source in the right place, there should 
be a default reference, so (1) is probably it.  Where do you have the data 
source sitting?

-- micael


--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]




Re: JNDI DataSource Question

2001-12-14 Thread Bhamidi Krishna

Hi,

Thankyou for the mail.

my datasource is sitting on the local computer and I can connect with a 
normal JDBC Connection. The same driver properties I use to create a 
datasource in server.xml and it fails.

I thought it can be a problem like Tomcat failing if we have the servlet.jar 
in java/lib/ext, so I cleaned it out.

Any pointers?

Krishna.




_
Chat with friends online, try MSN Messenger: http://messenger.msn.com


--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]




Re: JNDI DataSource Question

2001-12-14 Thread Micael Padraig Og mac Grene

At 07:07 PM 12/14/01 +, you wrote:
Hi,

Thankyou for the mail.

my datasource is sitting on the local computer and I can connect with a 
normal JDBC Connection. The same driver properties I use to create a 
datasource in server.xml and it fails.

I thought it can be a problem like Tomcat failing if we have the 
servlet.jar in java/lib/ext, so I cleaned it out.

Any pointers?

Krishna.


I hate to ask silly questions, but because you provide no details, I have 
to guess.  You are using javax, right?

-- micael


--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]