RE: Database connection pooling in Tomcat 5.5

2006-09-20 Thread Sameer Acharya
I have a datasource defined similar to yours I get this error when I try to use 

ds.getConnection("username", "password");

but if I just use ds.getConnection(); it works fine.

-Sameer

Darren Hall <[EMAIL PROTECTED]> wrote: Is there any other information I can 
supply to help people help me
understand why I'm getting this error (below)?

> I've made some progress on this. I'm now receiving a "SQLNestedException: 
> Cannot create PoolableConnectionFactory" error when calling getConnection 
> on the DataSource object retrieved from my connection pool. Here is the 
> stack trace:
>
> org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create 
> PoolableConnectionFactory (ORA-01017: invalid username/password; logon 
> denied)
> at 
>org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSourc
e.java:855)
> at 
>
org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.ja
va:540)
> at 
>
org.federallabs.labs.LaboratorySearchAction.execute(LaboratorySearchAction.j
ava:99)
> 


> You are likely connecting to the wrong catalog.  Is the pool parameter
> defaultCatalog set?

That's specified in my Context, correct? If so, then no, I don't have my
defaultCatalog parameter set.

Here is my context.xml file (comments removed, as well as domain uname and
passwd)


debug="5" reloadable="true" crossContext="true">


  type="javax.sql.DataSource" 
driverClassName="oracle.jdbc.OracleDriver"
  url="jdbc:oracle:thin:@devdb1.(mydomain).com:1521:flcdb"
  username="(uname)" password="(passwd)" 
maxActive="20" maxIdle="10"
  maxWait="-1" removeAbandoned="true" 
moveAbandonedTimeout="180"
  logAbandoned="true"/> 



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




"All that is necessary for the triumph of evil is that good men do 
nothing." Edmund Burke

-Sameer

-
Stay in the know. Pulse on the new Yahoo.com.  Check it out. 

Re: Database connection pooling in Tomcat 5.5

2006-09-19 Thread Martin Gainty
David--

The connection-pool is a series of preallocated Connection Resources which the 
ConnectionPoolManager dispatches to registered clients on as needed basis..The 
more sophisticated ConnectionPoolManagers have thread starvation metrics and 
monitoring built in so if there is no activity on a Connection Resource for n 
min the ConnectionPoolManager allocates to next requesting client

Oracle has a predefined view which will show you the information called V$ACCESS
(your username will of course need read access granted to V$Access Table 
beforehand)

Saludos
Martin--
*
This email message and any files transmitted with it contain confidential
information intended only for the person(s) to whom this email message is
addressed.  If you have received this email message in error, please notify
the sender immediately by telephone or email and destroy the original
message without making a copy.  Thank you.



- Original Message - 
From: "Darren Hall" <[EMAIL PROTECTED]>
To: "'Tomcat Users List'" 
Sent: Tuesday, September 19, 2006 2:56 PM
Subject: RE: Database connection pooling in Tomcat 5.5


> did you try printing out the username and password variables to see what 
> credentials are coming through?

Well, yes and no. I've actually hard coded the username and password into my
code when I've tested *not* using connection pooling, so I know what they
are in that case. When using connection pooling the username and password
are stored in my context.xml file as attributes in a Resource element. I'm
not sure how to get the values of those attributes in my code to print them
out. Also, if I were more knowledgeable in Oracle, I'd love to check to the
database to verify the pool is being created, and possible to see if what
credentials are being used on the Oracle side when I attempt to connect
through the connection pool, but I'm not sure where to look to find that
information. I've looked at various logs on the db server, but none of them
seem to contain the information I'm looking for, so I'm sort of lost there.

-D


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Database connection pooling in Tomcat 5.5

2006-09-19 Thread Darren Hall
> Which is why I suggested Ethereal to see what was really going over the
> wire between your Windows box and the DB machine.

Yep. I think you're right. I'll get that set up and take a look.
Be back in a while. Thanks for the help.


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Database connection pooling in Tomcat 5.5

2006-09-19 Thread Caldarale, Charles R
> From: Darren Hall [mailto:[EMAIL PROTECTED] 
> Subject: RE: Database connection pooling in Tomcat 5.5
> 
> I don't know where to go from here. I'm stumped.

Which is why I suggested Ethereal to see what was really going over the
wire between your Windows box and the DB machine.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Database connection pooling in Tomcat 5.5

2006-09-19 Thread Darren Hall
> They are, you just don't know it.  From the doc:
> 
> "These libraries are located in a single JAR at
> $CATALINA_HOME/common/lib/naming-factory-dbcp.jar.

Gotcha. Thanks, Chuck. 
The naming-factory-dbcp.jar is in my /commons/lib dir.

The bizarre thing about all of this is that 
A) I can connect to the database from my local machine a number of ways
using those same credentials - just not using the connection pool I've set
up through Tomcat.
And B) The connection pool - with absolutely no modifications from my local
machine - works fine in the Tomcat install on the development server.
??
I don't know where to go from here. I'm stumped.


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Database connection pooling in Tomcat 5.5

2006-09-19 Thread David Smith
Don't think so you need the commons-*.jar files.  Tomcat 5.5 refactored 
the commons-dbcp package internally so it wouldn't collide with webapps 
using the release version from http://jakarta.apache.org/commons/dbcp.


I don't have those and I've been using mysql without issue.

--David

Darren Hall wrote:


(In reverse order)
 

have you used a DB utility such as tora/toad/sqlplus to successfully 
authenticate to your Database with the values for username and password?
   



Yes

 

Inside struts-config.xml can you show us what you have supplied for each 
value associated with the following properties
  type="org.apache.commons.dbcp.BasicDataSource" key="TableName">





My datasources element is empty. In my reading, I discovered that this was
no longer a preferred way to set up database connections for struts (in leiu
of other connection frameworks like Spring or custom connection layers) and
was kept in place for legacy applications. (Is this not correct?)

 

make SURE commons-pooling.jar, commons-dbcp.jar and 
commons-collections.jar are in your ./WEB-INF/lib folder
   



None of these jar files are in either my /WEB-INF/lib folder or my
/commons/lib folders. Are these necessary for implementing connection
pooling? They are not on my development server either, yet that connection
pool seems to be working?


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

 




-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Database connection pooling in Tomcat 5.5

2006-09-19 Thread Caldarale, Charles R
> From: Darren Hall [mailto:[EMAIL PROTECTED] 
> Subject: RE: Database connection pooling in Tomcat 5.5
> 
> > make SURE commons-pooling.jar, commons-dbcp.jar and 
> > commons-collections.jar are in your ./WEB-INF/lib folder
> 
> None of these jar files are in either my /WEB-INF/lib folder or my
> /commons/lib folders.

They are, you just don't know it.  From the doc:

"These libraries are located in a single JAR at
$CATALINA_HOME/common/lib/naming-factory-dbcp.jar. However, only the
classes needed for connection pooling have been included, and the
packages have been renamed to avoid interfering with applications."

http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.h
tml

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Database connection pooling in Tomcat 5.5

2006-09-19 Thread Darren Hall
(In reverse order)
> have you used a DB utility such as tora/toad/sqlplus to successfully 
> authenticate to your Database with the values for username and password?

Yes

> Inside struts-config.xml can you show us what you have supplied for each 
> value associated with the following properties
> type="org.apache.commons.dbcp.BasicDataSource" key="TableName">
>  

RE: Database connection pooling in Tomcat 5.5

2006-09-19 Thread Caldarale, Charles R
> From: Darren Hall [mailto:[EMAIL PROTECTED] 
> Subject: RE: Database connection pooling in Tomcat 5.5
> 
> Well, yes and no. I've actually hard coded the username and 
> password into my code when I've tested *not* using connection
> pooling, so I know what they are in that case.

Have you tried a network sniffer (e.g., Ethereal) to see what's really
being passed to the DB as authentication credentials?

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Database connection pooling in Tomcat 5.5

2006-09-19 Thread Darren Hall
> did you try printing out the username and password variables to see what 
> credentials are coming through?

Well, yes and no. I've actually hard coded the username and password into my
code when I've tested *not* using connection pooling, so I know what they
are in that case. When using connection pooling the username and password
are stored in my context.xml file as attributes in a Resource element. I'm
not sure how to get the values of those attributes in my code to print them
out. Also, if I were more knowledgeable in Oracle, I'd love to check to the
database to verify the pool is being created, and possible to see if what
credentials are being used on the Oracle side when I attempt to connect
through the connection pool, but I'm not sure where to look to find that
information. I've looked at various logs on the db server, but none of them
seem to contain the information I'm looking for, so I'm sort of lost there.

-D


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Database connection pooling in Tomcat 5.5

2006-09-19 Thread Martin Gainty
1)
make SURE commons-pooling.jar, commons-dbcp.jar and commons-collections.jar are 
in your ./WEB-INF/lib folder
2)
Inside struts-config.xml can you show us what you have supplied for each value 
associated with the following properties

  
To: "'Tomcat Users List'" 
Sent: Tuesday, September 19, 2006 2:04 PM
Subject: RE: Database connection pooling in Tomcat 5.5


> does your XP box give you any application log errors anywhere?

I see no errors in the event viewer in any of the logs that are related to
this issue, but it was a good idea. (I didn't think of it.)

> I wonder if Windows is looking for a domain authentication, that is a 
> domain name stapled on to the user acct prior to authenticating the user?

No, there is no domain information used currently for the database
connection process. Another good idea. I'll speak with my network admin and
see if he believes this could be causing an issue.

> Can you print out to the Tomcat logs the errors?

Curiously, Tomcats logs show no errors relating to this issue. My
application log is the only place where the error is caught and logged.
Here is the relevant output from my log including the top of the stack
trace.


...
2006-09-19 13:07:44,670 DEBUG org.mydomian.labs.LaboratorySearchAction -
(exeucte) Retrieving database connection from the DataSource.
2006-09-19 13:07:45,826 DEBUG
org.apache.struts.util.PropertyMessageResources -
getMessage(en_US,unhandledException)
2006-09-19 13:07:45,841 WARN  org.apache.struts.action.RequestProcessor -
Unhandled Exception thrown: class
org.apache.tomcat.dbcp.dbcp.SQLNestedException
2006-09-19 13:07:45,857 ERROR
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/flc].[primar
y-controller] - Servlet.service() for servlet primary-controller threw
exception
org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create
PoolableConnectionFactory (ORA-01017: invalid username/password; logon
denied
)
at
org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource
.java:855)
at
org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.ja
va:540)
at
org.mydomain.labs.LaboratorySearchAction.execute(LaboratorySearchAction.java
:94)
at
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProces
sor.java:431)
...


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Database connection pooling in Tomcat 5.5

2006-09-19 Thread Propes, Barry L
did you try printing out the username and password variables to see what 
credentials are coming through?

-Original Message-
From: Darren Hall [mailto:[EMAIL PROTECTED]
Sent: Tuesday, September 19, 2006 1:37 PM
To: 'Tomcat Users List'
Subject: RE: Database connection pooling in Tomcat 5.5


> That SQL Nested Exception thing in general looks like the root cause...any

> way to try going to the DOS prompt and connecting to SQL Plus with that 
> username/pwd combo?

Yes, using that username and password works fine through SQL Plus, and I've
connected to the database several times through SQL Plus using those
credentials. In fact connecting to the database through my code works fine
if I don't use connection pooling! In my test java class I've tried
connecting to the DB using connection pooling, and not using connection
pooling.

This way works fine with no errors:

Connection conn;
Driver driver;
String driverUsed = "oracle.jdbc.OracleDriver";
String serverAddress = "jdbc:oracle:thin:@devdb1.utrs.com:1521:flcdb";
try {
driver = (Driver)Class.forName(driverUsed).newInstance();
conn = DriverManager.getConnection(serverAddress, "myuser",
"mypass");
}
catch (Exception e) {
log.debug("Connection to database failed!", e);
}

This way fails with "invalid username/password" error:

DataSource ds = null;
String dsName = "jdbc/flc";
try {
Context initContext = new InitialContext();
Context envContext  = (Context)initContext.lookup("java:/comp/env");
ds = (DataSource)envContext.lookup(dsName);
if (log.isDebugEnabled()) {
log.debug("(exeucte) Retrieving database connection from the
DataSource.");
}
conn = ds.getConnection();
if (log.isDebugEnabled()) {
log.debug("(exeucte) Connected.");
}
}
catch(javax.naming.NamingException nex) {
log.error("Context lookup failed for DataSource '" + dsName + "'",
nex);
}



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Database connection pooling in Tomcat 5.5

2006-09-19 Thread Darren Hall
> That SQL Nested Exception thing in general looks like the root cause...any

> way to try going to the DOS prompt and connecting to SQL Plus with that 
> username/pwd combo?

Yes, using that username and password works fine through SQL Plus, and I've
connected to the database several times through SQL Plus using those
credentials. In fact connecting to the database through my code works fine
if I don't use connection pooling! In my test java class I've tried
connecting to the DB using connection pooling, and not using connection
pooling.

This way works fine with no errors:

Connection conn;
Driver driver;
String driverUsed = "oracle.jdbc.OracleDriver";
String serverAddress = "jdbc:oracle:thin:@devdb1.utrs.com:1521:flcdb";
try {
driver = (Driver)Class.forName(driverUsed).newInstance();
conn = DriverManager.getConnection(serverAddress, "myuser",
"mypass");
}
catch (Exception e) {
log.debug("Connection to database failed!", e);
}

This way fails with "invalid username/password" error:

DataSource ds = null;
String dsName = "jdbc/flc";
try {
Context initContext = new InitialContext();
Context envContext  = (Context)initContext.lookup("java:/comp/env");
ds = (DataSource)envContext.lookup(dsName);
if (log.isDebugEnabled()) {
log.debug("(exeucte) Retrieving database connection from the
DataSource.");
}
conn = ds.getConnection();
if (log.isDebugEnabled()) {
log.debug("(exeucte) Connected.");
}
}
catch(javax.naming.NamingException nex) {
log.error("Context lookup failed for DataSource '" + dsName + "'",
nex);
}



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Database connection pooling in Tomcat 5.5

2006-09-19 Thread Propes, Barry L
I wonder, Darren, have you tried authenticating at all thru the JDBC realm?
I know you're ultimately wanting and needing to use the JNDI connection, but 
I'm just wondering if there was some other misconfiguration problem you could 
either rule out or in as a possibility.

That SQL Nested Exception thing in general looks like the root cause...any way 
to try going to the DOS prompt and connecting to SQL Plus with that 
username/pwd combo?

-Original Message-
From: Darren Hall [mailto:[EMAIL PROTECTED]
Sent: Tuesday, September 19, 2006 1:04 PM
To: 'Tomcat Users List'
Subject: RE: Database connection pooling in Tomcat 5.5


> does your XP box give you any application log errors anywhere?

I see no errors in the event viewer in any of the logs that are related to
this issue, but it was a good idea. (I didn't think of it.)

> I wonder if Windows is looking for a domain authentication, that is a 
> domain name stapled on to the user acct prior to authenticating the user?

No, there is no domain information used currently for the database
connection process. Another good idea. I'll speak with my network admin and
see if he believes this could be causing an issue.

> Can you print out to the Tomcat logs the errors?

Curiously, Tomcats logs show no errors relating to this issue. My
application log is the only place where the error is caught and logged.
Here is the relevant output from my log including the top of the stack
trace.


...
2006-09-19 13:07:44,670 DEBUG org.mydomian.labs.LaboratorySearchAction -
(exeucte) Retrieving database connection from the DataSource.
2006-09-19 13:07:45,826 DEBUG
org.apache.struts.util.PropertyMessageResources -
getMessage(en_US,unhandledException)
2006-09-19 13:07:45,841 WARN  org.apache.struts.action.RequestProcessor -
Unhandled Exception thrown: class
org.apache.tomcat.dbcp.dbcp.SQLNestedException
2006-09-19 13:07:45,857 ERROR
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/flc].[primar
y-controller] - Servlet.service() for servlet primary-controller threw
exception
org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create
PoolableConnectionFactory (ORA-01017: invalid username/password; logon
denied
)
at
org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource
.java:855)
at
org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.ja
va:540)
at
org.mydomain.labs.LaboratorySearchAction.execute(LaboratorySearchAction.java
:94)
at
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProces
sor.java:431)
...


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Database connection pooling in Tomcat 5.5

2006-09-19 Thread Darren Hall
> does your XP box give you any application log errors anywhere?

I see no errors in the event viewer in any of the logs that are related to
this issue, but it was a good idea. (I didn't think of it.)

> I wonder if Windows is looking for a domain authentication, that is a 
> domain name stapled on to the user acct prior to authenticating the user?

No, there is no domain information used currently for the database
connection process. Another good idea. I'll speak with my network admin and
see if he believes this could be causing an issue.

> Can you print out to the Tomcat logs the errors?

Curiously, Tomcats logs show no errors relating to this issue. My
application log is the only place where the error is caught and logged.
Here is the relevant output from my log including the top of the stack
trace.


...
2006-09-19 13:07:44,670 DEBUG org.mydomian.labs.LaboratorySearchAction -
(exeucte) Retrieving database connection from the DataSource.
2006-09-19 13:07:45,826 DEBUG
org.apache.struts.util.PropertyMessageResources -
getMessage(en_US,unhandledException)
2006-09-19 13:07:45,841 WARN  org.apache.struts.action.RequestProcessor -
Unhandled Exception thrown: class
org.apache.tomcat.dbcp.dbcp.SQLNestedException
2006-09-19 13:07:45,857 ERROR
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/flc].[primar
y-controller] - Servlet.service() for servlet primary-controller threw
exception
org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create
PoolableConnectionFactory (ORA-01017: invalid username/password; logon
denied
)
at
org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource
.java:855)
at
org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.ja
va:540)
at
org.mydomain.labs.LaboratorySearchAction.execute(LaboratorySearchAction.java
:94)
at
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProces
sor.java:431)
...


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Database connection pooling in Tomcat 5.5

2006-09-19 Thread Propes, Barry L
does your XP box give you any application log errors anywhere?

I wonder if Windows is looking for a domain authentication, that is a domain 
name stapled on to the user acct prior to authenticating the user?

Can you print out to the Tomcat logs the errors?

-Original Message-
From: Darren Hall [mailto:[EMAIL PROTECTED]
Sent: Tuesday, September 19, 2006 11:53 AM
To: 'Tomcat Users List'
Subject: RE: Database connection pooling in Tomcat 5.5


More progress with this issue.
It seems that on our development server (solaris box running solaris 10) the
connection pool connects properly. However on my local box (a Windows XP SP2
box where I'm doing my development before I move it to dev) the connection
pool returns to me an "invalid username/password" error. Both environments
are using exactly the same web.xml, context.xml, database credentials, etc.
In fact I used the same war file compiled from my local box to get the
initial version of the code up on our dev box.

Obviously it's a configuration issue - but where? Why does it work on the
dev server and not on my local box?? I'm really scratching my head on this
one.

-D

Here's the context.xml file I'm currently using -


 



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Database connection pooling in Tomcat 5.5

2006-09-19 Thread Darren Hall
More progress with this issue.
It seems that on our development server (solaris box running solaris 10) the
connection pool connects properly. However on my local box (a Windows XP SP2
box where I'm doing my development before I move it to dev) the connection
pool returns to me an "invalid username/password" error. Both environments
are using exactly the same web.xml, context.xml, database credentials, etc.
In fact I used the same war file compiled from my local box to get the
initial version of the code up on our dev box.

Obviously it's a configuration issue - but where? Why does it work on the
dev server and not on my local box?? I'm really scratching my head on this
one.

-D

Here's the context.xml file I'm currently using -


 



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Database connection pooling in Tomcat 5.5

2006-09-19 Thread Martin Gainty
Please display the contents of your context.xml so we may assist you
M-
*
This email message and any files transmitted with it contain confidential
information intended only for the person(s) to whom this email message is
addressed.  If you have received this email message in error, please notify
the sender immediately by telephone or email and destroy the original
message without making a copy.  Thank you.



- Original Message - 
From: "David Smith" <[EMAIL PROTECTED]>
To: "Tomcat Users List" 
Sent: Tuesday, September 19, 2006 10:27 AM
Subject: Re: Database connection pooling in Tomcat 5.5


> As the subject title implies, we are looking at 5.5.  In 5.5, the 
> parameters on a resource are expressed as attributes on the Resource 
> element.
> 
> --David
> 
> Martin Gainty wrote:
> 
>>As it appears you may be missing the parameter(s)
>>
>>
>>username
>>PutYourUsernameHere
>>
>>  
>>password
>>PutYourPasswordHere
>>
>>
>>can you print the contents of context.xml?
>>M-
>>*
>>This email message and any files transmitted with it contain confidential
>>information intended only for the person(s) to whom this email message is
>>addressed.  If you have received this email message in error, please notify
>>the sender immediately by telephone or email and destroy the original
>>message without making a copy.  Thank you.
>>
>>
>>
>>----- Original Message - 
>>From: "Darren Hall" <[EMAIL PROTECTED]>
>>To: "'Tomcat Users List'" 
>>Sent: Tuesday, September 19, 2006 9:24 AM
>>Subject: RE: Database connection pooling in Tomcat 5.5
>>
>>
>>  
>>
>>>>Have you tried
>>>>username="myuserid" password="mypassword"
>>>>instead  username="(myuserid)" password="(mypassword)"
>>>>  
>>>>
>>>Yes Jean-Claude. In fact, I don't use the parenthesis around the username
>>>and password in my context.xml file. I just listed it that way here in the
>>>list so people would understand the content was changed from the way it
>>>actually appeared in my context.xml. Looking back now, perhaps not such a
>>>good idea, huh?
>>>
>>>
>>>
>>>-
>>>To start a new topic, e-mail: users@tomcat.apache.org
>>>To unsubscribe, e-mail: [EMAIL PROTECTED]
>>>For additional commands, e-mail: [EMAIL PROTECTED]
>>>
>>>
>>>
>>>
>>
> 
> 
> -
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
>

Re: Database connection pooling in Tomcat 5.5

2006-09-19 Thread David Smith
As the subject title implies, we are looking at 5.5.  In 5.5, the 
parameters on a resource are expressed as attributes on the Resource 
element.


--David

Martin Gainty wrote:


As it appears you may be missing the parameter(s)

   
   username
   PutYourUsernameHere
   
 
   password
   PutYourPasswordHere
   

can you print the contents of context.xml?
M-
*
This email message and any files transmitted with it contain confidential
information intended only for the person(s) to whom this email message is
addressed.  If you have received this email message in error, please notify
the sender immediately by telephone or email and destroy the original
message without making a copy.  Thank you.



- Original Message - 
From: "Darren Hall" <[EMAIL PROTECTED]>

To: "'Tomcat Users List'" 
Sent: Tuesday, September 19, 2006 9:24 AM
Subject: RE: Database connection pooling in Tomcat 5.5


 


Have you tried
username="myuserid" password="mypassword"
instead  username="(myuserid)" password="(mypassword)"
 


Yes Jean-Claude. In fact, I don't use the parenthesis around the username
and password in my context.xml file. I just listed it that way here in the
list so people would understand the content was changed from the way it
actually appeared in my context.xml. Looking back now, perhaps not such a
good idea, huh?



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

   








-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Database connection pooling in Tomcat 5.5

2006-09-19 Thread Darren Hall
> can you print the contents of context.xml?

Absolutely Martin,

The parameters are there, but they are included as attributes instead of
contained as the body of an element. I'm not sure if this matters or not,
but I have it implemented a way I saw it done in a "JNDI Datasource How-To"
on Apache's site.

Here's the context.xml file I'm currently using -


 



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Database connection pooling in Tomcat 5.5

2006-09-19 Thread Martin Gainty
As it appears you may be missing the parameter(s)


username
PutYourUsernameHere

  
password
PutYourPasswordHere


can you print the contents of context.xml?
M-
*
This email message and any files transmitted with it contain confidential
information intended only for the person(s) to whom this email message is
addressed.  If you have received this email message in error, please notify
the sender immediately by telephone or email and destroy the original
message without making a copy.  Thank you.



- Original Message - 
From: "Darren Hall" <[EMAIL PROTECTED]>
To: "'Tomcat Users List'" 
Sent: Tuesday, September 19, 2006 9:24 AM
Subject: RE: Database connection pooling in Tomcat 5.5


>> Have you tried
>> username="myuserid" password="mypassword"
>> instead  username="(myuserid)" password="(mypassword)"
> 
> Yes Jean-Claude. In fact, I don't use the parenthesis around the username
> and password in my context.xml file. I just listed it that way here in the
> list so people would understand the content was changed from the way it
> actually appeared in my context.xml. Looking back now, perhaps not such a
> good idea, huh?
> 
> 
> 
> -
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
>

Re: Database connection pooling in Tomcat 5.5

2006-09-19 Thread Martin Grogan

Hi Darren,
See below for some code that I recently sent to the list in relation to 
this problem. It helped with the other person, might work for you too.

Regards,
Martin


--
// fragment from web.xml

  DB Connection
  jdbc/dbname
  javax.sql.DataSource
  Container



// context.xml


prefix="contextname." suffix=".log" timestamp="true"/>
factory="org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory" 
maxActive="30" maxIdle="10" maxWait="1" name="jdbc/dbname" 
password="**" removeAbandoned="true" removeAbandonedTimeout="60" 
type="javax.sql.DataSource" url="jdbc:mysql://localhost:3306/database" 
username="user"/>




// sample servlet
public class myservlet extends HttpServlet {
  private static DataSource ds=null; public void init(ServletConfig 
config) throws ServletException {

  try
  {
  Context ctx = new InitialContext();
  this.ds = (DataSource)ctx.lookup("java:comp/env/jdbc/dbname");
  }
  catch (Exception e) { e.printStackTrace(); }
  super.init(config);  }
public void destroy() {
  ds=null;
  }
protected void processRequest(HttpServletRequest request, 
HttpServletResponse response)

  throws ServletException, IOException {
  response.setContentType("text/html;charset=UTF-8");
  PrintWriter out = response.getWriter();  Connection 
connection=null;

  try
  {
  connection=ds.getConnection();  Statement 
statement = connection.createStatement();

  // execute queries here...
  statement.close();
  connection.close();
  }
  catch(Exception e) { out.println(e.getMessage()); }
  finally { try{connection.close(); } catch(Exception e) {} }
  out.close();  }
}


Darren Hall wrote:

Have you tried
username="myuserid" password="mypassword"
instead  username="(myuserid)" password="(mypassword)"



Yes Jean-Claude. In fact, I don't use the parenthesis around the username
and password in my context.xml file. I just listed it that way here in the
list so people would understand the content was changed from the way it
actually appeared in my context.xml. Looking back now, perhaps not such a
good idea, huh?
 



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



  



--

Martin Grogan
Keizen Software

[EMAIL PROTECTED]
www.keizensoftware.com


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Database connection pooling in Tomcat 5.5

2006-09-19 Thread Darren Hall
> Have you tried
> username="myuserid" password="mypassword"
> instead  username="(myuserid)" password="(mypassword)"

Yes Jean-Claude. In fact, I don't use the parenthesis around the username
and password in my context.xml file. I just listed it that way here in the
list so people would understand the content was changed from the way it
actually appeared in my context.xml. Looking back now, perhaps not such a
good idea, huh?
 


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Database connection pooling in Tomcat 5.5

2006-09-19 Thread Serlet Jean-Claude
Have you tried
username="myuserid" password="mypassword"
instead  username="(myuserid)" password="(mypassword)"


Jean-Claude

-Message d'origine-
De : Sameer Acharya [mailto:[EMAIL PROTECTED] 
Envoyé : mardi 19 septembre 2006 08:49
À : Tomcat Users List
Objet : Re: Database connection pooling in Tomcat 5.5

Instead of defining the username and password as attributes have you tried
defining them as resource parameters  ? just a hunch ..


 username
 myoracleuser


-Sameer

Parsons Technical Services <[EMAIL PROTECTED]> wrote: Try this:

http://www.oracle.com/technology/tech/java/sqlj_jdbc/htdocs/jdbc_faq_0.htm#0
5_03

Otherwise there is some differences in the parameter names. Others have used
connectionUser and connectionPassword , I think it was.

You can search the archives for OracleDriver to see what I mean.

Sorry, I do not use oracle, so I cannot say what is right.

Doug


- Original Message -
From: "Darren Hall" 
To: "'Tomcat Users List'" 
Sent: Monday, September 18, 2006 4:38 PM
Subject: RE: Database connection pooling in Tomcat 5.5


Further progress...
When I connect to the database directly (not using a connection pool) and
specify the same username and password below, the code executes fine. When I
try to do the context lookup and connect to the database via the connection
pool, I get the "invalid username/password; logon denied" error. This leads
me to believe the error is in my configuration (or my code).
What am I doing wrong here??

Thanks,
Darren


-Original Message-
From: Darren Hall [mailto:[EMAIL PROTECTED]
Sent: Monday, September 18, 2006 2:45 PM
To: 'Tomcat Users List'
Subject: RE: Database connection pooling in Tomcat 5.5

> You are likely connecting to the wrong catalog.  Is the pool parameter
> defaultCatalog set?

That's specified in my Context, correct? If so, then no, I don't have my
defaultCatalog parameter set.

Here is my context.xml file (comments removed, as well as domain uname and
passwd)


debug="5" reloadable="true" crossContext="true">

   
  type="javax.sql.DataSource"
  driverClassName="oracle.jdbc.OracleDriver"
  url="jdbc:oracle:thin:@devdb1.(mydomain).com:1521:flcdb"
  username="(uname)" password="(passwd)"
  maxActive="20" maxIdle="10"
  maxWait="-1" removeAbandoned="true"
  moveAbandonedTimeout="180"
  logAbandoned="true"/>



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
How low will we go? Check out Yahoo! Messenger's low  PC-to-Phone call
rates.

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Database connection pooling in Tomcat 5.5

2006-09-19 Thread Bob Hall
--- Darren Hall <[EMAIL PROTECTED]> wrote:

> Further progress...
> When I connect to the database directly (not using a
> connection pool) and
> specify the same username and password below, the
> code executes fine. When I
> try to do the context lookup and connect to the
> database via the connection
> pool, I get the "invalid username/password; logon
> denied" error. This leads
> me to believe the error is in my configuration (or
> my code).
> What am I doing wrong here??

Is the DB url *exactly* the same in the two cases,
DBCP and non-DBCP?

-Bob

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Database connection pooling in Tomcat 5.5

2006-09-18 Thread Sameer Acharya
Instead of defining the username and password as attributes have you tried 
defining them as resource parameters  ? just a hunch ..


 username
 myoracleuser


-Sameer

Parsons Technical Services <[EMAIL PROTECTED]> wrote: Try this:

http://www.oracle.com/technology/tech/java/sqlj_jdbc/htdocs/jdbc_faq_0.htm#05_03

Otherwise there is some differences in the parameter names. Others have used 
connectionUser and connectionPassword , I think it was.

You can search the archives for OracleDriver to see what I mean.

Sorry, I do not use oracle, so I cannot say what is right.

Doug


- Original Message - 
From: "Darren Hall" 
To: "'Tomcat Users List'" 
Sent: Monday, September 18, 2006 4:38 PM
Subject: RE: Database connection pooling in Tomcat 5.5


Further progress...
When I connect to the database directly (not using a connection pool) and
specify the same username and password below, the code executes fine. When I
try to do the context lookup and connect to the database via the connection
pool, I get the "invalid username/password; logon denied" error. This leads
me to believe the error is in my configuration (or my code).
What am I doing wrong here??

Thanks,
Darren


-Original Message-
From: Darren Hall [mailto:[EMAIL PROTECTED]
Sent: Monday, September 18, 2006 2:45 PM
To: 'Tomcat Users List'
Subject: RE: Database connection pooling in Tomcat 5.5

> You are likely connecting to the wrong catalog.  Is the pool parameter
> defaultCatalog set?

That's specified in my Context, correct? If so, then no, I don't have my
defaultCatalog parameter set.

Here is my context.xml file (comments removed, as well as domain uname and
passwd)


debug="5" reloadable="true" crossContext="true">

   
  type="javax.sql.DataSource"
  driverClassName="oracle.jdbc.OracleDriver"
  url="jdbc:oracle:thin:@devdb1.(mydomain).com:1521:flcdb"
  username="(uname)" password="(passwd)"
  maxActive="20" maxIdle="10"
  maxWait="-1" removeAbandoned="true"
  moveAbandonedTimeout="180"
  logAbandoned="true"/>



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
How low will we go? Check out Yahoo! Messenger’s low  PC-to-Phone call rates.

Re: Database connection pooling in Tomcat 5.5

2006-09-18 Thread Parsons Technical Services

Try this:

http://www.oracle.com/technology/tech/java/sqlj_jdbc/htdocs/jdbc_faq_0.htm#05_03

Otherwise there is some differences in the parameter names. Others have used 
connectionUser and connectionPassword , I think it was.


You can search the archives for OracleDriver to see what I mean.

Sorry, I do not use oracle, so I cannot say what is right.

Doug


- Original Message - 
From: "Darren Hall" <[EMAIL PROTECTED]>

To: "'Tomcat Users List'" 
Sent: Monday, September 18, 2006 4:38 PM
Subject: RE: Database connection pooling in Tomcat 5.5


Further progress...
When I connect to the database directly (not using a connection pool) and
specify the same username and password below, the code executes fine. When I
try to do the context lookup and connect to the database via the connection
pool, I get the "invalid username/password; logon denied" error. This leads
me to believe the error is in my configuration (or my code).
What am I doing wrong here??

Thanks,
Darren


-Original Message-
From: Darren Hall [mailto:[EMAIL PROTECTED]
Sent: Monday, September 18, 2006 2:45 PM
To: 'Tomcat Users List'
Subject: RE: Database connection pooling in Tomcat 5.5


You are likely connecting to the wrong catalog.  Is the pool parameter
defaultCatalog set?


That's specified in my Context, correct? If so, then no, I don't have my
defaultCatalog parameter set.

Here is my context.xml file (comments removed, as well as domain uname and
passwd)



  



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Database connection pooling in Tomcat 5.5

2006-09-18 Thread Darren Hall
Further progress...
When I connect to the database directly (not using a connection pool) and
specify the same username and password below, the code executes fine. When I
try to do the context lookup and connect to the database via the connection
pool, I get the "invalid username/password; logon denied" error. This leads
me to believe the error is in my configuration (or my code).
What am I doing wrong here??

Thanks,
Darren


-Original Message-
From: Darren Hall [mailto:[EMAIL PROTECTED] 
Sent: Monday, September 18, 2006 2:45 PM
To: 'Tomcat Users List'
Subject: RE: Database connection pooling in Tomcat 5.5

> You are likely connecting to the wrong catalog.  Is the pool parameter
> defaultCatalog set?

That's specified in my Context, correct? If so, then no, I don't have my
defaultCatalog parameter set.

Here is my context.xml file (comments removed, as well as domain uname and
passwd)







-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Database connection pooling in Tomcat 5.5

2006-09-18 Thread David Smith
Inidcations are from the exception, the config on your end is working 
and it's actually attempting to get a connection, but the login fails.  
Have you tried using the client software from the machine tomcat is on, 
using the same tcp/ip url and parameters tomcat is using?  Are there any 
logs on the database that might help from that end?


--David

Darren Hall wrote:


Is there any other information I can supply to help people help me
understand why I'm getting this error (below)?

 

I've made some progress on this. I'm now receiving a "SQLNestedException: 
Cannot create PoolableConnectionFactory" error when calling getConnection 
on the DataSource object retrieved from my connection pool. Here is the 
stack trace:


org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create 
PoolableConnectionFactory (ORA-01017: invalid username/password; logon 
denied)
at 
org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSourc
   


e.java:855)
 

at 

   


org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.ja
va:540)
 

at 

   


org.federallabs.labs.LaboratorySearchAction.execute(LaboratorySearchAction.j
ava:99)
 




 


You are likely connecting to the wrong catalog.  Is the pool parameter
defaultCatalog set?
   



That's specified in my Context, correct? If so, then no, I don't have my
defaultCatalog parameter set.

Here is my context.xml file (comments removed, as well as domain uname and
passwd)



type="javax.sql.DataSource" 
		  driverClassName="oracle.jdbc.OracleDriver"

 url="jdbc:oracle:thin:@devdb1.(mydomain).com:1521:flcdb"
 username="(uname)" password="(passwd)" 
		  maxActive="20" maxIdle="10"
 maxWait="-1" removeAbandoned="true" 
		  moveAbandonedTimeout="180"
 logAbandoned="true"/> 




-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

 




-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Database connection pooling in Tomcat 5.5

2006-09-18 Thread Darren Hall
Is there any other information I can supply to help people help me
understand why I'm getting this error (below)?

> I've made some progress on this. I'm now receiving a "SQLNestedException: 
> Cannot create PoolableConnectionFactory" error when calling getConnection 
> on the DataSource object retrieved from my connection pool. Here is the 
> stack trace:
>
> org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create 
> PoolableConnectionFactory (ORA-01017: invalid username/password; logon 
> denied)
> at 
>org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSourc
e.java:855)
> at 
>
org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.ja
va:540)
> at 
>
org.federallabs.labs.LaboratorySearchAction.execute(LaboratorySearchAction.j
ava:99)
> 


> You are likely connecting to the wrong catalog.  Is the pool parameter
> defaultCatalog set?

That's specified in my Context, correct? If so, then no, I don't have my
defaultCatalog parameter set.

Here is my context.xml file (comments removed, as well as domain uname and
passwd)







-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Database connection pooling in Tomcat 5.5

2006-09-18 Thread Darren Hall
> You are likely connecting to the wrong catalog.  Is the pool parameter
> defaultCatalog set?

That's specified in my Context, correct? If so, then no, I don't have my
defaultCatalog parameter set.

Here is my context.xml file (comments removed, as well as domain uname and
passwd)







-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Database connection pooling in Tomcat 5.5

2006-09-18 Thread Derrick Koes

You are likely connecting to the wrong catalog.  Is the pool parameter
defaultCatalog set?

 

-Original Message-
From: Darren Hall [mailto:[EMAIL PROTECTED] 
Sent: Monday, September 18, 2006 2:00 PM
To: 'Tomcat Users List'
Subject: RE: Database connection pooling in Tomcat 5.5


I've made some progress on this. I'm now receiving a
"SQLNestedException:
Cannot create PoolableConnectionFactory" error when calling
getConnection on the DataSource object retrieved from my connection
pool. Here is the satck
trace:

org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create
PoolableConnectionFactory (ORA-01017: invalid username/password; logon
denied
)
at
org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSo
urce
.java:855)
at
org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSourc
e.ja
va:540)
at
org.federallabs.labs.LaboratorySearchAction.execute(LaboratorySearchActi
on.j
ava:99)

Problem is - I know the username and password are correct. Anyone have
any ideas what could be causing my issue? I need to get this connection
pool issue working by the end of work today.

Thanks,
Darren


-
To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe,
e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Database connection pooling in Tomcat 5.5

2006-09-18 Thread Darren Hall

I've made some progress on this. I'm now receiving a "SQLNestedException:
Cannot create PoolableConnectionFactory" error when calling getConnection on
the DataSource object retrieved from my connection pool. Here is the satck
trace:

org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create
PoolableConnectionFactory (ORA-01017: invalid username/password; logon
denied
)
at
org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource
.java:855)
at
org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.ja
va:540)
at
org.federallabs.labs.LaboratorySearchAction.execute(LaboratorySearchAction.j
ava:99)

Problem is - I know the username and password are correct. Anyone have any
ideas what could be causing my issue? I need to get this connection pool
issue working by the end of work today.

Thanks,
Darren


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Database connection pooling in Tomcat 5.5

2006-09-18 Thread Darren Hall
Here's another question...
If the database pool is not created properly, will it fail silently, or will
an error be displayed in a log file? And if an error is output to a log
file, which one will it be?


-Original Message-
From: Darren Hall [mailto:[EMAIL PROTECTED] 
Sent: Monday, September 18, 2006 12:31 PM
To: 'Tomcat Users List'
Subject: RE: Database connection pooling in Tomcat 5.5

The issue could be the path attribute or docbase attribute in the
context.xml. I'm not sure what values should appear for these.


-Original Message-
From: Darren Hall [mailto:[EMAIL PROTECTED] 
Sent: Monday, September 18, 2006 11:26 AM
To: 'Tomcat Users List'
Subject: RE: Database connection pooling in Tomcat 5.5

Here it is. The items in parenthesis have been removed.
Thanks for the help.
















 





-Original Message-
From: Pid [mailto:[EMAIL PROTECTED] 
Sent: Monday, September 18, 2006 11:16 AM
To: Tomcat Users List
Subject: Re: Database connection pooling in Tomcat 5.5

post your context.xml




Darren Hall wrote:
> Hi all.
> 
>  
> 
> I'm attempting to set up database connection pool using Tomcat 5.5 and
> Oracle 10g. I've been following the "JNDI How To" guide from Apache
>
(http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.html
> ). My question is - where should I define the connection pool resource?
> Meaning, where should my "Resource" element appear. I've read two
different
> descriptions about how this should be done in the Apache documentation.
The
> first description (from the above link) states that I should modify
> server.xml and add a new Context element as such  docBase="DBTest" debug="5" reloadable="true" crossContext="true"> and in
> that new context define my resource for my connection pool. However, if
you
> read the "Context" documentation linked to the above How-To (located at
this
> link: http://tomcat.apache.org/tomcat-5.5-doc/config/context.html) you'll
> find in there the following text - "Please note that for tomcat 5, unlike
> tomcat 4.x, it is NOT recommended to place  elements directly in
> the server.xml file. Instead, put them in the META-INF/context.xml
directory
> of your WAR file or the conf directory". So I'm wondering if I should
modify
> server.xml or create a context.xml file. Currently I'm trying the
> context.xml file route, but it is not working (although this could be
> because I'm configuring things incorrectly). Can anyone point me in the
> right direction here?
>  
> Thanks,
> Darren
> 
>  
> 
> 


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Database connection pooling in Tomcat 5.5

2006-09-18 Thread Darren Hall
The issue could be the path attribute or docbase attribute in the
context.xml. I'm not sure what values should appear for these.


-Original Message-
From: Darren Hall [mailto:[EMAIL PROTECTED] 
Sent: Monday, September 18, 2006 11:26 AM
To: 'Tomcat Users List'
Subject: RE: Database connection pooling in Tomcat 5.5

Here it is. The items in parenthesis have been removed.
Thanks for the help.
















 





-Original Message-
From: Pid [mailto:[EMAIL PROTECTED] 
Sent: Monday, September 18, 2006 11:16 AM
To: Tomcat Users List
Subject: Re: Database connection pooling in Tomcat 5.5

post your context.xml




Darren Hall wrote:
> Hi all.
> 
>  
> 
> I'm attempting to set up database connection pool using Tomcat 5.5 and
> Oracle 10g. I've been following the "JNDI How To" guide from Apache
>
(http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.html
> ). My question is - where should I define the connection pool resource?
> Meaning, where should my "Resource" element appear. I've read two
different
> descriptions about how this should be done in the Apache documentation.
The
> first description (from the above link) states that I should modify
> server.xml and add a new Context element as such  docBase="DBTest" debug="5" reloadable="true" crossContext="true"> and in
> that new context define my resource for my connection pool. However, if
you
> read the "Context" documentation linked to the above How-To (located at
this
> link: http://tomcat.apache.org/tomcat-5.5-doc/config/context.html) you'll
> find in there the following text - "Please note that for tomcat 5, unlike
> tomcat 4.x, it is NOT recommended to place  elements directly in
> the server.xml file. Instead, put them in the META-INF/context.xml
directory
> of your WAR file or the conf directory". So I'm wondering if I should
modify
> server.xml or create a context.xml file. Currently I'm trying the
> context.xml file route, but it is not working (although this could be
> because I'm configuring things incorrectly). Can anyone point me in the
> right direction here?
>  
> Thanks,
> Darren
> 
>  
> 
> 


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Database connection pooling in Tomcat 5.5

2006-09-18 Thread Darren Hall
Yes, I did. Here is the web.xml



http://java.sun.com/j2ee/dtds/web-app_2_2.dtd";>


  My Web Application
  
Web Application.
   

  
  
primary-controller
org.apache.struts.action.ActionServlet

  config
  /WEB-INF/struts-config.xml


  debug
  2


  detail
  2

1
  

  
  
primary-controller
/
  

  
  
index.jsp
index.html
  

  
Oracle Datasource connection pool
jdbc/flc
javax.sql.DataSource
Container
  






-Original Message-
From: Mark Barnes [mailto:[EMAIL PROTECTED] 
Sent: Monday, September 18, 2006 11:30 AM
To: Tomcat Users List
Subject: Re: Database connection pooling in Tomcat 5.5

Do you include a  in your WEB-INF/web.xml file?

You might also want to post your web.xml


Pid wrote:
> post your context.xml
> 
> 
> 
> 
> Darren Hall wrote:
>> Hi all.
>>
>>  
>>
>> I'm attempting to set up database connection pool using Tomcat 5.5 and
>> Oracle 10g. I've been following the "JNDI How To" guide from Apache
>>
(http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.html
>> ). My question is - where should I define the connection pool resource?
>> Meaning, where should my "Resource" element appear. I've read two
different
>> descriptions about how this should be done in the Apache documentation.
The
>> first description (from the above link) states that I should modify
>> server.xml and add a new Context element as such > docBase="DBTest" debug="5" reloadable="true" crossContext="true"> and in
>> that new context define my resource for my connection pool. However, if
you
>> read the "Context" documentation linked to the above How-To (located at
this
>> link: http://tomcat.apache.org/tomcat-5.5-doc/config/context.html) you'll
>> find in there the following text - "Please note that for tomcat 5, unlike
>> tomcat 4.x, it is NOT recommended to place  elements directly in
>> the server.xml file. Instead, put them in the META-INF/context.xml
directory
>> of your WAR file or the conf directory". So I'm wondering if I should
modify
>> server.xml or create a context.xml file. Currently I'm trying the
>> context.xml file route, but it is not working (although this could be
>> because I'm configuring things incorrectly). Can anyone point me in the
>> right direction here?
>>  
>> Thanks,
>> Darren
>>
>>  
>>
>>
> 
> 
> -
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Database connection pooling in Tomcat 5.5

2006-09-18 Thread Mark Barnes

Do you include a  in your WEB-INF/web.xml file?

You might also want to post your web.xml


Pid wrote:

post your context.xml




Darren Hall wrote:

Hi all.

 


I'm attempting to set up database connection pool using Tomcat 5.5 and
Oracle 10g. I've been following the "JNDI How To" guide from Apache
(http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.html
). My question is - where should I define the connection pool resource?
Meaning, where should my "Resource" element appear. I've read two different
descriptions about how this should be done in the Apache documentation. The
first description (from the above link) states that I should modify
server.xml and add a new Context element as such  and in
that new context define my resource for my connection pool. However, if you
read the "Context" documentation linked to the above How-To (located at this
link: http://tomcat.apache.org/tomcat-5.5-doc/config/context.html) you'll
find in there the following text - "Please note that for tomcat 5, unlike
tomcat 4.x, it is NOT recommended to place  elements directly in
the server.xml file. Instead, put them in the META-INF/context.xml directory
of your WAR file or the conf directory". So I'm wondering if I should modify
server.xml or create a context.xml file. Currently I'm trying the
context.xml file route, but it is not working (although this could be
because I'm configuring things incorrectly). Can anyone point me in the
right direction here?
 
Thanks,

Darren

 






-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Database connection pooling in Tomcat 5.5

2006-09-18 Thread Darren Hall
Here it is. The items in parenthesis have been removed.
Thanks for the help.
















 





-Original Message-
From: Pid [mailto:[EMAIL PROTECTED] 
Sent: Monday, September 18, 2006 11:16 AM
To: Tomcat Users List
Subject: Re: Database connection pooling in Tomcat 5.5

post your context.xml




Darren Hall wrote:
> Hi all.
> 
>  
> 
> I'm attempting to set up database connection pool using Tomcat 5.5 and
> Oracle 10g. I've been following the "JNDI How To" guide from Apache
>
(http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.html
> ). My question is - where should I define the connection pool resource?
> Meaning, where should my "Resource" element appear. I've read two
different
> descriptions about how this should be done in the Apache documentation.
The
> first description (from the above link) states that I should modify
> server.xml and add a new Context element as such  docBase="DBTest" debug="5" reloadable="true" crossContext="true"> and in
> that new context define my resource for my connection pool. However, if
you
> read the "Context" documentation linked to the above How-To (located at
this
> link: http://tomcat.apache.org/tomcat-5.5-doc/config/context.html) you'll
> find in there the following text - "Please note that for tomcat 5, unlike
> tomcat 4.x, it is NOT recommended to place  elements directly in
> the server.xml file. Instead, put them in the META-INF/context.xml
directory
> of your WAR file or the conf directory". So I'm wondering if I should
modify
> server.xml or create a context.xml file. Currently I'm trying the
> context.xml file route, but it is not working (although this could be
> because I'm configuring things incorrectly). Can anyone point me in the
> right direction here?
>  
> Thanks,
> Darren
> 
>  
> 
> 


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Database connection pooling in Tomcat 5.5

2006-09-18 Thread Pid
post your context.xml




Darren Hall wrote:
> Hi all.
> 
>  
> 
> I'm attempting to set up database connection pool using Tomcat 5.5 and
> Oracle 10g. I've been following the "JNDI How To" guide from Apache
> (http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.html
> ). My question is - where should I define the connection pool resource?
> Meaning, where should my "Resource" element appear. I've read two different
> descriptions about how this should be done in the Apache documentation. The
> first description (from the above link) states that I should modify
> server.xml and add a new Context element as such  docBase="DBTest" debug="5" reloadable="true" crossContext="true"> and in
> that new context define my resource for my connection pool. However, if you
> read the "Context" documentation linked to the above How-To (located at this
> link: http://tomcat.apache.org/tomcat-5.5-doc/config/context.html) you'll
> find in there the following text - "Please note that for tomcat 5, unlike
> tomcat 4.x, it is NOT recommended to place  elements directly in
> the server.xml file. Instead, put them in the META-INF/context.xml directory
> of your WAR file or the conf directory". So I'm wondering if I should modify
> server.xml or create a context.xml file. Currently I'm trying the
> context.xml file route, but it is not working (although this could be
> because I'm configuring things incorrectly). Can anyone point me in the
> right direction here?
>  
> Thanks,
> Darren
> 
>  
> 
> 


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]