some simple question about websphere 6.1 datasource authentication - Websphere

This is a discussion on some simple question about websphere 6.1 datasource authentication - Websphere ; 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 ...

+ Reply to Thread
Results 1 to 8 of 8

Thread: some simple question about websphere 6.1 datasource authentication

  1. some simple question about websphere 6.1 datasource authentication

    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.getPoo ledConnectionX(DB2ConnectionPoolDataSource.java:14 4)
    at com.ibm.db2.jcc.DB2ConnectionPoolDataSource.getPoo ledConnection(DB2ConnectionPoolDataSource.java:58)
    at com.ibm.ws.rsadapter.spi.InternalGenericDataStoreH elper$1.run(InternalGenericDataStoreHelper.java:89 7)
    at com.ibm.ws.security.util.AccessController.doPrivil eged(AccessController.java:118)
    at com.ibm.ws.rsadapter.spi.InternalGenericDataStoreH elper.getPooledConnection(InternalGenericDataStore Helper.java:892)
    at com.ibm.ws.rsadapter.spi.InternalDB2UniversalDataS toreHelper.getPooledConnection(InternalDB2Universa lDataStoreHelper.java:1323)
    at com.ibm.ws.rsadapter.spi.WSRdbDataSource.getPooled Connection(WSRdbDataSource.java:1180)
    at com.ibm.ws.rsadapter.spi.WSManagedConnectionFactor yImpl.createManagedConnection(WSManagedConnectionF actoryImpl.java:1047)
    at com.ibm.ws.rsadapter.spi.WSDefaultConnectionManage rImpl.allocateConnection(WSDefaultConnectionManage rImpl.java:81)
    at com.ibm.ws.rsadapter.jdbc.WSJdbcDataSource.getConn ection(WSJdbcDataSource.java:431)
    at com.ibm.ws.rsadapter.jdbc.WSJdbcDataSource.getConn ection(WSJdbcDataSource.java:400)
    at org.springframework.orm.hibernate3.LocalDataSource ConnectionProvider.getConnection(LocalDataSourceCo nnectionProvider.java:82)
    at org.hibernate.jdbc.ConnectionManager.openConnectio n(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

  2. Re: some simple question about websphere 6.1 datasourceauthentication

    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.(DB2PooledConn ection.java:67)
    at com.ibm.db2.jcc.DB2ConnectionPoolDataSource.getPoo ledConnectionX(DB2ConnectionP oolDataSource.java:144)
    at com.ibm.db2.jcc.DB2ConnectionPoolDataSource.getPoo ledConnection(DB2ConnectionPo olDataSource.java:58)
    at com.ibm.ws.rsadapter.spi.InternalGenericDataStoreH elper$1.run(InternalGenericDa taStoreHelper.java:897)
    at com.ibm.ws.security.util.AccessController.doPrivil eged(AccessController.java:11 8)
    at com.ibm.ws.rsadapter.spi.InternalGenericDataStoreH elper.getPooledConnection(Int ernalGenericDataStoreHelper.java:892)
    at com.ibm.ws.rsadapter.spi.InternalDB2UniversalDataS toreHelper.getPooledConnectio n(InternalDB2UniversalDataStoreHelper.java:1323)
    at com.ibm.ws.rsadapter.spi.WSRdbDataSource.getPooled Connection(WSRdbDataSource.ja va:1180)
    at com.ibm.ws.rsadapter.spi.WSManagedConnectionFactor yImpl.createManagedConnection (WSManagedConnectionFactoryImpl.java:1047)
    at com.ibm.ws.rsadapter.spi.WSDefaultConnectionManage rImpl.allocateConnection(WSDe faultConnectionManagerImpl.java:81)
    at com.ibm.ws.rsadapter.jdbc.WSJdbcDataSource.getConn ection(WSJdbcDataSource.java: 431)
    at com.ibm.ws.rsadapter.jdbc.WSJdbcDataSource.getConn ection(WSJdbcDataSource.java: 400)
    at org.springframework.orm.hibernate3.LocalDataSource ConnectionProvider.getConnect ion(LocalDataSourceConnectionProvider.java:82)
    at org.hibernate.jdbc.ConnectionManager.openConnectio n(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








    Thanks for any reply

    regards

    ballistic_realm

  3. Re: some simple question about websphere 6.1 datasource authentication

    hendra@integrosys.com wrote:
    > 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.(DB2PooledConn ection.java:67)
    > at com.ibm.db2.jcc.DB2ConnectionPoolDataSource.getPoo ledConnectionX(DB2ConnectionP oolDataSource.java:144)
    > at com.ibm.db2.jcc.DB2ConnectionPoolDataSource.getPoo ledConnection(DB2ConnectionPo olDataSource.java:58)
    > at com.ibm.ws.rsadapter.spi.InternalGenericDataStoreH elper$1.run(InternalGenericDa taStoreHelper.java:897)
    > at com.ibm.ws.security.util.AccessController.doPrivil eged(AccessController.java:11 8)
    > at com.ibm.ws.rsadapter.spi.InternalGenericDataStoreH elper.getPooledConnection(Int ernalGenericDataStoreHelper.java:892)
    > at com.ibm.ws.rsadapter.spi.InternalDB2UniversalDataS toreHelper.getPooledConnectio n(InternalDB2UniversalDataStoreHelper.java:1323)
    > at com.ibm.ws.rsadapter.spi.WSRdbDataSource.getPooled Connection(WSRdbDataSource.ja va:1180)
    > at com.ibm.ws.rsadapter.spi.WSManagedConnectionFactor yImpl.createManagedConnection (WSManagedConnectionFactoryImpl.java:1047)
    > at com.ibm.ws.rsadapter.spi.WSDefaultConnectionManage rImpl.allocateConnection(WSDe faultConnectionManagerImpl.java:81)
    > at com.ibm.ws.rsadapter.jdbc.WSJdbcDataSource.getConn ection(WSJdbcDataSource.java: 431)
    > at com.ibm.ws.rsadapter.jdbc.WSJdbcDataSource.getConn ection(WSJdbcDataSource.java: 400)
    > at org.springframework.orm.hibernate3.LocalDataSource ConnectionProvider.getConnect ion(LocalDataSourceConnectionProvider.java:82)
    > at org.hibernate.jdbc.ConnectionManager.openConnectio n(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
    >
    >
    >
    >
    >
    >
    >
    >
    > Thanks for any reply
    >
    > regards
    >
    > ballistic_realm
    >

    Ballistic,
    If this is how you're using JNDI, you're not using WebSphere.

    Ken

  4. Re: some simple question about websphere 6.1 datasourceauthentication

    Can anybody help ?

  5. Re: some simple question about websphere 6.1 datasourceauthentication

    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.

  6. Re: some simple question about websphere 6.1 datasourceauthentication

    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.

  7. Re: some simple question about websphere 6.1 datasourceauthentication

    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

  8. Re: some simple question about websphere 6.1 datasourceauthentication

    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.

+ Reply to Thread