geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kaupo <kpar...@gmail.com>
Subject Re: jndi datasource access problem
Date Tue, 03 Mar 2009 07:12:12 GMT


Jack Cai wrote:
> 
> Are you runing this piece of code in the server container or in a
> standalone
> Web service client? Looks like you are running in the client. You can't
> access the server context (resources) in the standalone client.
> 
This code was in the same server. I'm using it in my UserDao, for user
authentication. It just doesn't want to work when I try using basic
authentication on my webservice (that is running in the same server) Maybe
the axis2 engine used in geronimo automatically somehow makes my webservice
a standalone client?



djencks wrote:
> 
>> If you look in var/log/geronimo.log the jndi locations are logged as the
>> comonents start up.  I prefer to look at these rather than try to
>> remember
>> which j2eeType is in use.
> 

I'm using IBM WASCE that has the geronimo 2.1 core. The log was at
var/log/server.log and I found the correct line: 2009-03-03 08:21:30,631
INFO  [KernelContextGBean] bound gbean
console.dbpool/jdbc_whkds/1.0/rar?J2EEApplication=null,JCAConnectionFactory=jdbc/whkds,JCAResource=console.dbpool/jdbc_whkds/1.0/rar,ResourceAdapter=console.dbpool/jdbc_whkds/1.0/rar,ResourceAdapterModule=console.dbpool/jdbc_whkds/1.0/rar,j2eeType=JCAManagedConnectionFactory,name=jdbc/whkds
at name console.dbpool/jdbc_whkds/JCAManagedConnectionFactory/jdbc/whkds

the corrected context lookup code looks like this:
InitialContext ctx = new InitialContext();
DataSource ds =
(DataSource)ctx.lookup("jca:/console.dbpool/jdbc_whkds/JCAManagedConnectionFactory/jdbc/whkds");

Thanks David!
-Kaupo

-- 
View this message in context: http://www.nabble.com/jndi-datasource-access-problem-tp22290284s134p22303553.html
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.


Mime
View raw message