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
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
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.
Ken
P.S. Hint: there's really no WebLogic code in WebSphere.
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 :)
Thieum.