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:
PHP Code:
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.<init>(b.java:292)
at com.ibm.db2.jcc.DB2PooledConnection.<init>(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 try to supply the credentials in the initialcontext but it is not working
PHP Code:
<bean id="rlosTXTarget" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName">
<value>POOL</value>
</property>
<property name="jndiTemplate">
<ref local="dsJndiTemplate" />
</property>
</bean>
<bean id="dsJndiTemplate" class="org.springframework.jndi.JndiTemplate">
<property name="environment">
<props>
<prop key="java.naming.provider.url">t3://localhost:80</prop>
<prop key="java.naming.factory.initial">weblogic.jndi.WLInitialContextFactory</prop>
<prop key="java.naming.security.principal">user</prop>
<prop key="java.naming.security.credentials">user</prop>
<prop key="java.naming.security.authentication">none</prop>
</props>
</property>
</bean>
So my question is that can i actually pass username and password in the jnditemplate or actually there is something wrong with my server configuration ?
Thanks for any reply
regards
ballistic_realm