Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

some simple question about websphere 6.1 datasource authentication

23 views
Skip to first unread message

hen...@integrosys.com

unread,
Dec 23, 2008, 1:00:21 AM12/23/08
to
Hi guys, I have a simple and probably stupid question

Currently I have an application that is doing some batch jobs. I use spring batch to achieve this. And i am connecting through the database using jndi. Since i am using websphere ( 6.1 ), I setup a jndi referrring to a datasource. In the datasource i specify a j2c configuration to supply the username and password.
When i deploy my application, everthing works fine. The reAuth of my module is container.

Then i try to put my batch codes user a new console application. This is where i start to get problem. I cannot connect to the jndi. I keeps on complaining:


caused by: java.sql.SQLException: [ibm][db2][jcc][t4][10205][11234] Null userid is not supported.DSRA0010E: SQL State = null, Error Code = -99,999
at com.ibm.db2.jcc.b.b.E(b.java:1792)
at com.ibm.db2.jcc.b.b.d(b.java:1799)
at com.ibm.db2.jcc.b.b.b(b.java:606)
at com.ibm.db2.jcc.b.b.a(b.java:593)
at com.ibm.db2.jcc.b.b.a(b.java:355)
at com.ibm.db2.jcc.b.b. (b.java:292)
at com.ibm.db2.jcc.DB2PooledConnection. (DB2PooledConnection.java:67)
at com.ibm.db2.jcc.DB2ConnectionPoolDataSource.getPooledConnectionX(DB2ConnectionPoolDataSource.java:144)
at com.ibm.db2.jcc.DB2ConnectionPoolDataSource.getPooledConnection(DB2ConnectionPoolDataSource.java:58)
at com.ibm.ws.rsadapter.spi.InternalGenericDataStoreHelper$1.run(InternalGenericDataStoreHelper.java:897)
at com.ibm.ws.security.util.AccessController.doPrivileged(AccessController.java:118)
at com.ibm.ws.rsadapter.spi.InternalGenericDataStoreHelper.getPooledConnection(InternalGenericDataStoreHelper.java:892)
at com.ibm.ws.rsadapter.spi.InternalDB2UniversalDataStoreHelper.getPooledConnection(InternalDB2UniversalDataStoreHelper.java:1323)
at com.ibm.ws.rsadapter.spi.WSRdbDataSource.getPooledConnection(WSRdbDataSource.java:1180)
at com.ibm.ws.rsadapter.spi.WSManagedConnectionFactoryImpl.createManagedConnection(WSManagedConnectionFactoryImpl.java:1047)
at com.ibm.ws.rsadapter.spi.WSDefaultConnectionManagerImpl.allocateConnection(WSDefaultConnectionManagerImpl.java:81)
at com.ibm.ws.rsadapter.jdbc.WSJdbcDataSource.getConnection(WSJdbcDataSource.java:431)
at com.ibm.ws.rsadapter.jdbc.WSJdbcDataSource.getConnection(WSJdbcDataSource.java:400)
at org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider.getConnection(LocalDataSourceConnectionProvider.java:82)
at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:423)
... 13 more


So the main different between my 1st and second code is the second one is not running inside the application container.


I plau around with the component managed authentication and container manager authentication ( deprecated) but it is still giving the same error.
So my question is that do i do something wrong when calling the jndi or do i have to edit some confiugration in my websphere so that the server allow my console application to connect ?

For info this is how i connect using jndi ( using spring )

[php]


POOL







t3://localhost:80
weblogic.jndi.WLInitialContextFactory
user
user
none





[/php]

Thanks for any reply

regards

ballistic_realm

hen...@integrosys.com

unread,
Dec 23, 2008, 1:02:57 AM12/23/08
to
Please ignore my first post, there are some typos

Hi guys, I have a simple and probably stupid question

Currently I have an application that is doing some batch jobs. I use spring batch to achieve this. And i am connecting through the database using jndi. Since i am using websphere ( 6.1 ), I setup a jndi referrring to a datasource. In the datasource i specify a j2c configuration to supply the username and password.
When i deploy my application, everthing works fine. The reAuth of my module is container.

Then i try to put my batch code using a new console application. This is where i start to get problem. I cannot connect to the jndi. I keeps on complaining:


caused by: java.sql.SQLException: ibmdb2jcct41020511234 Null userid is not supported.DSRA0010E: SQL State = null, Error Code = -99,999


at com.ibm.db2.jcc.b.b.E(b.java:1792)
at com.ibm.db2.jcc.b.b.d(b.java:1799)
at com.ibm.db2.jcc.b.b.b(b.java:606)
at com.ibm.db2.jcc.b.b.a(b.java:593)
at com.ibm.db2.jcc.b.b.a(b.java:355)
at com.ibm.db2.jcc.b.b.(b.java:292)
at com.ibm.db2.jcc.DB2PooledConnection.(DB2PooledConnection.java:67)

at com.ibm.db2.jcc.DB2ConnectionPoolDataSource.getPooledConnectionX(DB2ConnectionP oolDataSource.java:144)
at com.ibm.db2.jcc.DB2ConnectionPoolDataSource.getPooledConnection(DB2ConnectionPo olDataSource.java:58)
at com.ibm.ws.rsadapter.spi.InternalGenericDataStoreHelper$1.run(InternalGenericDa taStoreHelper.java:897)
at com.ibm.ws.security.util.AccessController.doPrivileged(AccessController.java:11 8)
at com.ibm.ws.rsadapter.spi.InternalGenericDataStoreHelper.getPooledConnection(Int ernalGenericDataStoreHelper.java:892)
at com.ibm.ws.rsadapter.spi.InternalDB2UniversalDataStoreHelper.getPooledConnectio n(InternalDB2UniversalDataStoreHelper.java:1323)
at com.ibm.ws.rsadapter.spi.WSRdbDataSource.getPooledConnection(WSRdbDataSource.ja va:1180)
at com.ibm.ws.rsadapter.spi.WSManagedConnectionFactoryImpl.createManagedConnection (WSManagedConnectionFactoryImpl.java:1047)
at com.ibm.ws.rsadapter.spi.WSDefaultConnectionManagerImpl.allocateConnection(WSDe faultConnectionManagerImpl.java:81)


at com.ibm.ws.rsadapter.jdbc.WSJdbcDataSource.getConnection(WSJdbcDataSource.java: 431)
at com.ibm.ws.rsadapter.jdbc.WSJdbcDataSource.getConnection(WSJdbcDataSource.java: 400)
at org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider.getConnect ion(LocalDataSourceConnectionProvider.java:82)
at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:423)
.. 13 more


So the main different between my 1st and second code is the second one is not running inside the application container.

I plau around with the component managed authentication and container manager authentication ( deprecated) but it is still giving the same error.
So my question is that do i do something wrong when calling the jndi or do i have to edit some confiugration in my websphere so that the server allow my console application to connect ?

For info this is how i connect using jndi ( using spring )



POOL







t3://localhost:80
weblogic.jndi.WLInitialContextFactory
user
user
none




Ken Hygh

unread,
Dec 23, 2008, 6:19:00 AM12/23/08
to
Ballistic,
If this is how you're using JNDI, you're not using WebSphere.

Ken

hen...@integrosys.com

unread,
Dec 29, 2008, 2:32:18 AM12/29/08
to
Can anybody help ?:)

Mathieu DESPATURE

unread,
Dec 29, 2008, 4:12:57 AM12/29/08
to
Hello,

As you are running outside the application server, you can't access to jndi directly. Try to look with the launchClient command ([WAS-INSTALL-DIR]/bin) which will start your process in the server, but be careful if security is active.

kh...@us.ibm.com

unread,
Dec 29, 2008, 12:01:26 PM12/29/08
to
If this is how you're accessing JNDI, you're not using WebSphere.

Ken
P.S. Hint: there's really no WebLogic code in WebSphere.

hen...@integrosys.com

unread,
Jan 5, 2009, 9:42:46 AM1/5/09
to
Hi Thieumdesp
Do you mean that webphere does not allow connecting from outside the container ?

HI kenhygh
Seems i post the wrong configuration. Thas was my weblogic configuration
My websphere config is

iiop://localhost:2809
com.ibm.websphere.naming.WsnInitialContextFactory

thanks :)

Mathieu DESPATURE

unread,
Jan 5, 2009, 2:21:38 PM1/5/09
to
iop://localhost:2809 com.ibm.websphere.naming.WsnInitialContextFac tory
OK, it is the configuration of the IntialContext you may find in jndi.properties but it's not sufficient. Imagine that everybody could access your jdbc DataSource just with this two lines !!! With a jdbc driver, you can access to a lot of database metadata !!

Thieum.

0 new messages