Jefferey,
Coming into this thread late, but I'm curious.
Why do you want each user to obtain a connection
to the database, effectively logging into the DB,
instead of using a connection pool with a single,
application specific, DB userid/password?
- Bob
--- [EMAIL PROTECTED] wrote:
Thanks
To: Tomcat Users List
Subject: Re: using a datasource connection pool resource with username
and password supplied by user
Thanks Doug and Chuck,
I suspected as much re. the connection pool. This sort of negates the
value of it a little (for me anyway).
My original plan was to go with saving
Good question Bob,
This system may eventually be implemented for the government department I
work for in Queensland, Australia. This project is a pilot one which will
involve four separate district offices in four different cities. The
department has policies on data security which includes
That's right Sasha,
I will have to ensure connections are closed down automatically if the user
doesn't log out, but at this stage I will note your comment for further
research.
Thanks,
Jeffery S. Eaton
Opinions contained in this
Jefferey,
Are the uses going to be allowed to execute ad hoc
queries? If yes, I can see why you would choose to
take the take the direct DB authentication route.
If not, then a a JDBCRealm could be used and specific
role(s) assigned to each user that would govern what
they could do in the
Thanks for the suggestion Bob,
I think what you are saying about realms is valid and most likely the
easiest way to enforce security. It would be my choice if it wasn't a
corporate standards issue. I will read up on the link you sent and see if
I can get away with it in terms of meeting with
If the DB login requirement is removed you might
want to take a look at Apache Turbine, it supports
finer-grained access to a web app.
http://jakarta.apache.org/turbine/index.html
- Bob
--- [EMAIL PROTECTED] wrote:
Thanks for the suggestion Bob,
I think what you are saying about realms is
_
to access this pool I use the following code:
Context initContext = new InitialContext();
Context envContext = (Context)initContext.lookup(java:/comp/env);
DataSource ds = (DataSource)envContext.lookup
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
Subject: using a datasource connection pool resource with
username and password supplied by user
But what I really want to do is to get a database user and
password from the user and (after validating it) write this
to a session
- Original Message -
From: Caldarale, Charles R [EMAIL PROTECTED]
To: Tomcat Users List tomcat-user@jakarta.apache.org
Sent: Sunday, October 09, 2005 11:26 PM
Subject: RE: using a datasource connection pool resource with username and
password supplied by user
From: [EMAIL PROTECTED
Thanks Doug and Chuck,
I suspected as much re. the connection pool. This sort of negates the
value of it a little (for me anyway).
My original plan was to go with saving the connection to the session once
it was established but I had read somewhere that connections are not
'serializable' and
getting exceptions saying no connections were available on my JDBC
datasource (org.gjt.mm.mysql.Driver). The pool was definitely large enough
to handle the load. So it appears that I'm not freeing the all the
connections as I should. I noticed that I did not have the
'removeAbandoned' flag set
getting successfully
closed?
Thx.
JWM
-Original Message-
From: Brian Cook [mailto:[EMAIL PROTECTED]
Sent: Friday, October 07, 2005 3:38 PM
To: Tomcat Users List
Subject: Re: Tracking Datasource Connection Usage?
JWM wrote:
Two things you can do here.
1. Set both removeAbandoned
Brian Cook wrote:
JWM wrote:
Two things you can do here.
1. Set both removeAbandoned and logAbandoned parameters to
true. This will reclaim most lost connections. And log a trace of
what code called a connection that was never closed.
See, I don't get all this removeAbandoned
I started getting exceptions saying no connections were available on my JDBC
datasource (org.gjt.mm.mysql.Driver). The pool was definitely large enough
to handle the load. So it appears that I'm not freeing the all the
connections as I should. I noticed that I did not have the
'removeAbandoned
To: tomcat-user@jakarta.apache.org
Subject: Tracking Datasource Connection Usage?
I started getting exceptions saying no connections were
available on my JDBC
datasource (org.gjt.mm.mysql.Driver). The pool was
definitely large enough
to handle the load. So it appears that I'm not freeing
Hi,
On 6 Oct 2005 at 15:09, JWM wrote:
I started getting exceptions saying no connections were available on my JDBC
datasource (org.gjt.mm.mysql.Driver). The pool was definitely large enough
to handle the load. So it appears that I'm not freeing the all the
connections as I should. I
Rob Hills wrote:
I started getting exceptions saying no connections were available on my JDBC
datasource (org.gjt.mm.mysql.Driver). The pool was definitely large enough
to handle the load. So it appears that I'm not freeing the all the
connections as I should. I noticed that I did
I have a MySQL database in which I created a database named, javatest,
and I am using Tomcat 5.5.9. I have unable to connect my database using
Java's DataSource method. Here is my ROOT.xml setup for my application
context:
Context path= docBase=/home/tomcat/applications/
debug=0
have unable to connect my database using
Java's DataSource method. Here is my ROOT.xml setup for my application
context:
Context path= docBase=/home/tomcat/applications/
debug=0 reloadable=true
Resource name=jdbc/DBTest type=javax.sql.DataSource
auth=Container
)
Kris74
De: Anoop kumar V [EMAIL PROTECTED]
A: Kris74 [EMAIL PROTECTED], Tomcat Users List
tomcat-user@jakarta.apache.org
Objet: Re: Tomcat Struts Datasource problem
Date: Thu, 28 Jul 2005 14:50:21 -0400
Did you check out this link:
a
href=http://jakarta.apache.org/tomcat/tomcat
Did you check out this link:
http://jakarta.apache.org/tomcat/tomcat-5.0-doc/jndi-datasource-examples-howto.html
HTH,
Anoop
On 7/27/05, Kris74 [EMAIL PROTECTED] wrote:
Thank you for your answer on my topic.
I am using Tomcat 5, (I have 2 versions : 5.0.28 and 5.5.9)
I have post also
SQL statement (w/TagLib) works just fine:
...
c:catch var=err1
sql:update sql=INSERT INTO mytable VALUES (?)
dataSource=jdbc/mysqlTestDb var=ok
sql:param value=${p1}/
/sql:update
/c:catch
- Ken H.
]
Sent: Thursday, July 21, 2005 3:53 PM
To: Tomcat Users List
Subject: Re: DBCP datasource works on 5.0.28 but fails on 5.5.
This issue was originally submitted by Steve Kirk on 20-May-2005
and RESOLVED on 22-May. FYI, I experienced the same error(s) as
Steve and tried all the same things Steve did
hi all
i have tomcat 5.0.25 and i used context.xml in META-INF for configuring the
datasource.
But I notice that I have to configure the datasource data(url.path , driver)
also with the tomcat administrator.
I notice that with tomcat 5.5.7 that do not happen
I want for sure using tomcat
:
I am encountering a very strange problem when trying to use a
datasource in Tomcat. I got Tomcat 5.5.4 to access the datasource by
using the following in
TomcatHome\conf\Catalina\localhost\webAppContext.xml
Context path=/appName docBase=appName
debug=5 reloadable=true crossContext=true
:
I am encountering a very strange problem when trying to use a
datasource in Tomcat. I got Tomcat 5.5.4 to access the datasource by
using the following in
TomcatHome\conf\Catalina\localhost\webAppContext.xml
Context path=/appName docBase=appName
debug=5 reloadable=true crossContext=true
Hi,
I succeded to create a datasource for TOMCAT 5.5.7 and 5.5.9 but I have to
deploy my webapp into TOMCAT 4.1.31 and it's not the same configuration
parameters...
It seems to be all right but if I debug with Eclipse IDE my DataSource is
null...
I followed TOMCAT 4.1 JNDI DataSource how
Patrick Gelin wrote:
I succeded to create a datasource for TOMCAT 5.5.7 and 5.5.9 but I have to
deploy my webapp into TOMCAT 4.1.31 and it's not the same configuration
parameters...
2. This is my server.xml conf file:
ResourceParams name=jdbc/rpn_database
Hi,
I succeded to create a datasource for TOMCAT 5.5.7 and 5.5.9 but I have to
deploy my webapp into TOMCAT 4.1.31 and it's not the same configuration
parameters...
It seems to be all right but if I debug with Eclipse ide I see my DataSource
is null...
I followed TOMCAT 4.1 JNDI DataSource how
Hi!
I am trying to connect my web-app running under tomcat 5.5.9 to connect to
a postgresql database. I read
the JNDI Datasource HOW-TO on
http://jakarta.apache.org/tomcat/tomcat-5.5-doc/jndi-datasource-examples-h
owto.html.
I would like to have an application-specific resource
I'm not sure about 5.5.x, but in 5.0.x and earlier it was put in META-INF.
Joe
[EMAIL PROTECTED] wrote:
Hi!
I am trying to connect my web-app running under tomcat 5.5.9 to connect to
a postgresql database. I read
the JNDI Datasource HOW-TO on
http://jakarta.apache.org/tomcat/tomcat-5.5-doc
I am encountering a very strange problem when trying to use a
datasource in Tomcat. I got Tomcat 5.5.4 to access the datasource by
using the following in
TomcatHome\conf\Catalina\localhost\webAppContext.xml
Context path=/appName docBase=appName
debug=5 reloadable=true crossContext=true
I'm having trouble setting up a data source in Tomcat 5.5.7. I'm not
certain if I'm having a configuration problem, or if the drivers I'm
trying to use are not compatible with Tomcat. Starting with the latter
question, I'm attempting to use the jdbc oracle drivers that ship with
Sun's Java
Its seems you have correctly defined the datasource,
but it is not linked to your application. In the
server.xml your application should be defined as a
context and in the context you have to specify that
the global resource defined earlier is available to
this application.
Look at resource-ref
Hi,
I followed the example on : http://jakarta.apache.org/tomcat/
tomcat-5.0-doc/jndi-datasource-examples-howto.html
The only thing I changed was jdbc/TestDB into jdbc/weblog.
on al locations I could find.
If I look at my page (http://www.karnhuis.nl/gastenboek.jsp)
The ${row.name
: redeploy of webapp loses GlobalNamingResource DataSource
I have a globally named db pool resource that I use across multiple
contexts to access a particular database. When I redeploy a webapp in
Tomcat 5.0.28, I am losing the DataSource and getting a pooled
connection fails with the following
I have a globally named db pool resource that I use across multiple
contexts to access a particular database. When I redeploy a webapp in
Tomcat 5.0.28, I am losing the DataSource and getting a pooled
connection fails with the following (truncated) message:
org.apache.commons.dbcp
2005 22:28
To: tomcat-user@jakarta.apache.org
Subject: redeploy of webapp loses GlobalNamingResource DataSource
I have a globally named db pool resource that I use across multiple
contexts to access a particular database. When I redeploy a webapp in
Tomcat 5.0.28, I am losing the DataSource
Hi Steve,
Am Montag, 23. Mai 2005 00:39 schrieb Steve Kirk:
I started replying to yr post including my full config, had nearly
finished, then saw the problem - I had a leading space in the 'url'
value within the Resource tag of my context.xml file. Grrr! I
[...]
Thanks very much to both
. I say this because:
- I have fresh installed TC, mysql and jdk;
- mysql works from the command line using my datasource username/pw;
- I have checked and rechecked my config a thousand times;
- the mysql driver is in the right folder;
- the error is suggestive of the fact that TC can't find
?
- mysql works from the command line using my datasource username/pw;
Are you really using the correct URL to connect to the database? Are
host name, port and database name ok? I.e. the database name is
case-sensitive (at least on Linux, check it on Windows)!
Are you running Tomcat with Security
'
upgrade effort by rolling back to 5.0.28, but now tomorrow is now looking
like being productive :)
-Original Message-
From: Lutz Zetzsche [mailto:[EMAIL PROTECTED]
Sent: Sunday 22 May 2005 22:42
To: Tomcat Users List
Subject: Re: DBCP datasource works on 5.0.28 but fails on 5.5.9
Hi
Steve Kirk wrote:
Thanks nix.
Could it be that you've missed the fact that
DataSource JNDI resource setup definition has changed in TC
5.5? It is
no longer with those
parametername.../namevalue.../value/parameter.
Yes I already changed that. I used to use the approach you
= java:comp/env/jdbc/ +
config.getString(ConfigConstants.JNDI_DATABASE_RESOURCE_NAME);
DataSource pool = (DataSource)ctx.lookup(resourceString);
However, an Exception is thrown the first time that I do this:
Connection conn = pool.getConnection();
I'm stumped after hours working
InitialContext();
String resourceString = java:comp/env/jdbc/ +
config.getString(ConfigConstants.JNDI_DATABASE_RESOURCE_NAME);
DataSource pool = (DataSource)ctx.lookup(resourceString);
However, an Exception is thrown the first time that I do this:
Connection conn = pool.getConnection
Hi,
Am Freitag, 20. Mai 2005 17:22 schrieb Nikola Milutinovic:
Steve Kirk wrote:
This most commonly means that the definition of the DataSource
resource lacks driver definition. Could it be that you've missed the
fact that DataSource JNDI resource setup definition has changed in TC
5.5
Thanks nix.
Could it be that you've missed the fact that
DataSource JNDI resource setup definition has changed in TC
5.5? It is
no longer with those
parametername.../namevalue.../value/parameter.
Yes I already changed that. I used to use the approach you mention in
5.0.28, i.e
]
Sent: Friday 20 May 2005 16:59
To: Tomcat Users List
Subject: Re: DBCP datasource works on 5.0.28 but fails on 5.5.9
Hi,
Am Freitag, 20. Mai 2005 17:22 schrieb Nikola Milutinovic:
Steve Kirk wrote:
This most commonly means that the definition of the DataSource
resource lacks driver
();
DataSource ds =
(DataSource)ctx.lookup(
java:comp/env/jdbc/strutsDB);
Connection conn = ds.getConnection();
// THIS WORKS, BUT I AM NOT USING THE BasicDataSourceFactory to create the pool.
?xml version='1.0' encoding='utf-8'?
Context displayName=strutsDB
Where should I send documentation bugs?
There's a few problems with
http://jakarta.apache.org/tomcat/tomcat-5.0-doc/jndi-datasource-examples-howto.html:
1.
Section 2 says to add a slug of XML between a /Context tag and a
/Host tag. Tomcat's conf/server.xml (at least version 5.0.28) does
All bugs, documentation or otherwise, should be reported via bugzilla.
Mark
Michael Stillwell wrote:
Where should I send documentation bugs?
There's a few problems with
http://jakarta.apache.org/tomcat/tomcat-5.0-doc/jndi-datasource-examples-howto.html:
1.
Section 2 says to add a slug of XML
Hi,
I am not exactly sure what you meant by you don't
have to do that ? For example, how would a class
differentiate between
org.apache.commons.dbcp.BasicDataSourceFactory and
org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory
without doing anything? Off course the import
declarations have to
On Mon, Mar 14, 2005 at 08:55:35AM -0800, sven morales wrote:
:I am not exactly sure what you meant by you don't
: have to do that ? For example, how would a class
: differentiate between
: org.apache.commons.dbcp.BasicDataSourceFactory and
: org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory
:
org.apache.tomcat.dbcp.dbcp.
org.apache.tomcat.dbcp.collection.
org.apache.tomcat.dbcp.pool.
org.apache.tomcat.dbcp.jocl.
Note: the double dbcp.dbcp for DataSource and commons
name is not on the path.
Also subtle change of Resource elements and
attributes and no more ResourceParams. I guess
Greetings,
I am trying to follow some of the examples and got some more questions
and problems.
I think the main problem is that I haven't found the import for the
Context class. Should
this a class in common/lib to get the connection?
thanks
%@ page
import = java.io.*
import =
javax.naming.Context
On Tue, 08 Mar 2005 09:32:19 -0500, Darryl Wagoner
[EMAIL PROTECTED] wrote:
snip
I think the main problem is that I haven't found the import for the
Context class.
snap
-
To unsubscribe, e-mail: [EMAIL
=sql %
%@ taglib uri=http://java.sun.com/jsp/jstl/core; prefix=c %
sql:query var=rs dataSource=rofDB
select id, foo, bar from testdata
/sql:query
html
head
titleDB Test/title
/head
body
h2Results/h2
c:forEach var=row items=${rs.rows}
Foo ${row.foo}br/
Bar ${row.bar}br/
/c:forEach
Try jdbc/rofDB
Doug
- Original Message -
From: Darryl Wagoner [EMAIL PROTECTED]
To: Tomcat Users List tomcat-user@jakarta.apache.org
Sent: Tuesday, March 08, 2005 4:15 PM
Subject: Re: getting datasource in a JSP?
Rahul Akolkar wrote:
javax.naming.Context
Thank Rahul that help, but now
As shown in the examples
Context initContext = new InitialContext();
Context envContext = (Context)initContext.lookup(java:/comp/env);
DataSource ds = (DataSource)envContext.lookup(jdbc/rofDB);
Parsons Technical Services wrote:
Try jdbc/rofDB
Doug
- Original Message - From
Peter Johnson wrote:
As shown in the examples
Context initContext = new InitialContext();
Context envContext = (Context)initContext.lookup(java:/comp/env);
DataSource ds = (DataSource)envContext.lookup(jdbc/rofDB);
Thanks for the quick reply! That has solved the problem!
--
Darryl
I know the docs define a jdbc datasource using multiple nested tags, e.g.:
Resource name=jdbc/mail auth=Container
type=javax.sql.DataSource/
ResourceParams name=jdbc/mail
parameter
namefactory/name
Single tag for 5.5.x
Multiple for 5.0.x
Doug
- Original Message -
From: J Malcolm [EMAIL PROTECTED]
To: tomcat-user@jakarta.apache.org
Sent: Friday, March 04, 2005 10:57 AM
Subject: Single-Tag DataSource Definition?
I know the docs define a jdbc datasource using multiple nested tags
an internal error () that
prevented it from fulfilling this request._
*exception*
javax.servlet.ServletException: Unable to get connection, DataSource
invalid: org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot
create JDBC driver of class '' for connect URL 'null
David,
I have been looking at this off and on for weeks and could not see the
problem. I changed the context to
be jdbc/TestDB and it worked.
Thank you very much
David Smith wrote:
In your context definition, you have Resource name=TestDB..
In your web.xml, you have
No problem. Amazing what an extra set of eyes will catch, isn't it?
Enjoy!
David
Darryl Wagoner wrote:
David,
I have been looking at this off and on for weeks and could not see the
problem. I changed the context to
be jdbc/TestDB and it worked.
Thank you very much
David Smith wrote:
In
* Exception report
*message*
*description* _The server encountered an internal error () that
prevented it from fulfilling this request._
*exception*
javax.servlet.ServletException: Unable to get connection, DataSource invalid:
org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC
@jakarta.apache.org
Sent: Tuesday, March 01, 2005 5:09 PM
Subject: newbie having problems with MySQL JDBC/JNDI Datasource example
Greetings,
Not sure if this made it the first time. I didn't see it show up on the
list
I am trying to get the example in the MySQL JDBC/JNDI HOWTO to work and I
am missing
Users List tomcat-user@jakarta.apache.org
Sent: Tuesday, March 01, 2005 5:09 PM
Subject: newbie having problems with MySQL JDBC/JNDI Datasource example
Greetings,
Not sure if this made it the first time. I didn't see it show up on
the list
I am trying to get the example in the MySQL JDBC/JNDI
Sounds like it can't find the driver. Do you have the Connector/J jar
installed in the correct place? Should be in common/lib.
I think so! I have
$CATALINA/common/lib/mysql-connector-java-3.0.16-ga-bin.jar which I
believe to be the correct.
I just downloaded and installed 3.1 with same
Datasource example
Greetings,
Not sure if this made it the first time. I didn't see it show up on the
list
I am trying to get the example in the MySQL JDBC/JNDI HOWTO to work and I
am missing something.
I get this error: My webapp directory is /DBTest.
What am I missing?
thanks
-darryl
--- Error
javax.servlet.ServletException: Unable to get connection, DataSource
invalid: org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create
JDBC driver of class '' for connect URL 'null'
what is your connection URL? it doesn't seem like you're supplying one
to the driver. If you're passing
Woops, my bad, that's not it, I should have read the entire message :(
Drew.
On Tue, 2005-03-01 at 18:51, Drew Jorgenson wrote:
javax.servlet.ServletException: Unable to get connection, DataSource
invalid: org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create
JDBC driver of class
: Tomcat 5.5.7 cannot connect to mysql datasource - what changed?
We have been using Sun Java 1.4.2, Tomcat 5.0.19, MySQL 4.1.7, MySQL
Connector/J 3.0.15 with Hibernate 2.1.7c with no problems. This is on
both Windows XP Pro SP2 (development) and SuSE Linux SLES9 (test and
production
Mixon (qwest) [mailto:[EMAIL PROTECTED]
Sent: 21 February, 2005 7:53 AM
To: tomcat-user@jakarta.apache.org
Subject: Tomcat 5.5.7 cannot connect to mysql datasource - what
changed?
We have been using Sun Java 1.4.2, Tomcat 5.0.19, MySQL 4.1.7, MySQL
Connector/J 3.0.15 with Hibernate 2.1.7c
Hello All,
Can some show how to set db2 jndi datasource in tomcat 5.5.7.
DB2 and tomcat all in windows XP.
tomcat can talk to db2 with direct jdbc connection.
Why it is so hard for db2?
Thank you very much!
--tom
-
Do you Yahoo!?
Yahoo
Shakeel,
Thanks for the suggestion but we were already using DBCP 1.2.1. I
downloaded it and tried it again, but get the same error. Any other
ideas why the username would not be passed correctly when creating the
datasource/pool?
-Original Message-
From: Shakeel Ahmad [mailto:[EMAIL
,SCWCD SCBCD Sun Microsystems, Inc.
Brain Bench Certified Java Programmer.
-Original Message-
From: Richard Mixon (qwest) [mailto:[EMAIL PROTECTED]
Sent: 21 February, 2005 6:16 PM
To: Tomcat Users List
Subject: RE: Tomcat 5.5.7 cannot connect to mysql datasource - what
changed?
Shakeel
works in
Tomcat 5.0.19, but not in Tomcat 5.5.7.
Thanks - Richard
-Original Message-
From: Shakeel Ahmad [mailto:[EMAIL PROTECTED]
Sent: Monday, February 21, 2005 6:39 AM
To: Tomcat Users List
Subject: RE: Tomcat 5.5.7 cannot connect to mysql datasource - what
changed?
Try to hard code
mangled or swallowed. I've double checkd and it is
correctly specified in my context.xml But by the time the failure
occurs, it is a null or empty string.
So, how can I enable logging on my DBCP datasource so that I can see
where the connection userName property gets trashed? I've tried
putting
removeAbandonedTimeout=60
logAbandoned=true
/
/Context
***- CATALINA ERROR MESSAGES:
SNIP
19:37:27,642 INFO [http-8080-Processor25]
DatasourceConnectionProvider:51 - Using datasource:
java:comp/env/jdbc/stars 19:37:27,648 INFO [http-8080-Processor25
]
DatasourceConnectionProvider:51 - Using datasource:
java:comp/env/jdbc/stars
19:37:27,648 INFO [http-8080-Processor25]
TransactionManagerLookupFactory:33 - No TransactionManagerLookup
configured (in JTA environment, use of process level read-write cache is
not recommended)
AbandonedObjectPool is used
([EMAIL
, Pakistan.
SCJP,SCWCD SCBCD Sun Microsystems, Inc.
Brain Bench Certified Java Programmer.
-Original Message-
From: Richard Mixon (qwest) [mailto:[EMAIL PROTECTED]
Sent: 21 February, 2005 7:53 AM
To: tomcat-user@jakarta.apache.org
Subject: Tomcat 5.5.7 cannot connect to mysql datasource - what
Users List
Subject: RE: Tomcat 5.5.7 cannot connect to mysql datasource - what
changed?
Have you changed the corresponding mysql connector jar file ?
-Original Message-
From: Richard Mixon (qwest) [mailto:[EMAIL PROTECTED]
Sent: 21 February, 2005 7:53 AM
To: tomcat-user@jakarta.apache.org
.
Brain Bench Certified Java Programmer.
-Original Message-
From: Richard Mixon (qwest) [mailto:[EMAIL PROTECTED]
Sent: 21 February, 2005 10:24 AM
To: Tomcat Users List
Subject: RE: Tomcat 5.5.7 cannot connect to mysql datasource - what
changed?
Actually I tried MySQL Connector/J 3.0.15
Hi,
I tried to configure datasource as described in the How-To manual on tomcat
4, but it doesn´t work.
I found two ways to define a datasource and work with it:
On tomcat 4.1.24:
1. Define context-entry in server.xml for my application with resource entry
for datasource.
2. Define resource-ref
The easiest way to add a JNDI datasource is to install the webadmin
and define the datasource not as a global JNDI but 'local' to the
context. This can easily be achieved with the admin application.
I have seen this problem where I defined the global datasource in TC
5.5 and it was not visible
/resource-ref
In the hibernate.cfg.xml I make a JNDI reference to the datasource:
hibernate-configuration
session-factory
property
name=connection.datasourcejava:comp/env/jdbc/mydb/property
property
name=dialectnet.sf.hibernate.dialect.PostgreSQLDialect/property
property name
/res-auth
/resource-ref
In the hibernate.cfg.xml I make a JNDI reference to the datasource:
hibernate-configuration
session-factory
property
name=connection.datasourcejava:comp/env/jdbc/mydb/property
property
name=dialectnet.sf.hibernate.dialect.PostgreSQLDialect/property
Hi Jeroen!
Two weeks ago I (almost) exactly did what you want to do - make
hibernate use a JNDI-DataSource defined as a GlobalNamingResource! The
differences: My database is Oracle and I didn't configure hibernate
directly because I use the spring-framework in between.
I experienced problems
Context
path=/APLRegistration
docBase=/usr/local/webapps
this for the root of the app. When the war or root folder resides.
-
I'm confused by this. First, I found that to get the datasource to work at all
I had to use
Johnny wrote:
I'm confused by this. First, I found that to get the datasource to work at
all
I had to use a context file with a docbase pointing to an exploded war
file
rather than just installing a complete war file into Tomcat's webapps
directory. Thinking that there might be other
/APLRegistration.jsp/welcome-file
/welcome-file-list
!-- Catch FacesException --
resource-ref
descriptionRave generated DataSource Reference/description
res-ref-namejdbc/APLregistration/res-ref-name
res-typejavax.sql.DataSource/res-type
res-authContainer/res
Doug wrote...
Post your config files. server.xml and web.xml from ../conf/ and the web and
context files for you app.
My first reply was blocked due to excessive HTML comments. It was mostly
XML. Guess the rule engine needs to be made smarter...
Oh well, here it is in pieces. First
*.faces/url-pattern --
/servlet-mapping
!-- Welcome File List --
welcome-file-list
welcome-filefaces/APLRegistration.jsp/welcome-file
/welcome-file-list
!-- Catch FacesException --
resource-ref
descriptionRave generated DataSource Reference
And here's conf/server.xml with the database password removed
?xml version='1.0' encoding='utf-8'?
Server port=9005
Listener className=org.apache.catalina.mbeans.ServerLifecycleListener/
Listener
className=org.apache.catalina.mbeans.GlobalResourcesLifecycleListener/
GlobalNamingResources
Finally, here's the rather long conf/web.xml. This one may get bounced back
too, but I'll try it. Heck, I'll remove most of the comments first. I guess
there were quite a few HTML comments.
Thanks for your interest and help.
?xml version=1.0 encoding=ISO-8859-1?
web-app
resides.
Two make
!-- Catch FacesException --
resource-ref
descriptionRave generated DataSource Reference/description
res-ref-namejdbc/APLregistration/res-ref-name
res-typejavax.sql.DataSource/res-type
should be
!-- Catch FacesException --
resource
I've built a simple web app using Sun JSCreator. It accesses a MySQL database,
and I've deployed on Tomcat 5.0.28. It took a little haggling to get the
datasource registration in Tomcat just right, but it finally works. I used
Tomcat's admin GUI to register the data source, and I deploy the web
Post your config files. server.xml and web.xml from ../conf/ and the web and
context files for you app.
Doug
- Original Message -
From: Johnny Tolliver [EMAIL PROTECTED]
To: tomcat-user@jakarta.apache.org
Sent: Thursday, January 27, 2005 2:07 PM
Subject: Tomcat datasource not persisting
1 - 100 of 848 matches
Mail list logo