Hi there !
I�m trying to configure my web application to get a connection via JNDI lookup , but I think I might be missing some step.
First , I configured a DataSource in the Server�s Configuration DataSource tab... which I called jdbc/SAUDEMED . Then I configured the web.xml , in the References tab I added the jdbc/SAUDEMED resource.
The class that makes the JNDI lookup has the following code :
DataSource ds = null;
try {
// ds = (DataSource) initCtx.lookup("jdbc/SAUDEMED");
ds = (DataSource) initCtx.lookup("java:comp/env/jdbc/SAUDEMED");
In fact, I still haven�t been told why I must use this "java:comp/env/" before my JNDI name... Any idea ?
Then , when I run the app, I get the following error :
" No container-managed authentication alias was found " ...
The Conection Pool Manager could not allocate a managed connection javax.resource.spi.ResourceAllocationException: Caught ResourceException thrown during creation of the ManagedConnection.
at com.ibm.ejs.j2c.poolmanager.FreePool.createManagedConnectionWithMCWrapper(FreePool.java:1138)
at com.ibm.ejs.j2c.poolmanager.FreePool.createOrWaitForConnection(FreePool.java:897)
at com.ibm.ejs.j2c.poolmanager.PoolManager.reserve(PoolManager.java:1065)
And so on...
In addition to it, where do I have to declare my username and password for the database connection ? In the JNDI / DataSource configuration there wasn �t such step...
Any help would be greatly appreciated...
Thanx in advance !
F�bio