Announcement Announcement Module
Collapse
No announcement yet.
Spring - JNDI Issue Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring - JNDI Issue

    Spring - JNDI Set up Issue

    We are using DB2 on Z/OS Spring, hibernate

    We were using properties file for the user name and password

    application-base.xml
    < bean id="dataSource" class="org.springframework.jdbc.datasource.DriverM anagerDataSource">
    <property name="driverClassName" value="${jdbc.driverClassName}"/>
    <property name="url" value="${jdbc.url}"/>
    <property name="username" value="${jdbc.username}"/>
    <property name="password" value="${jdbc.password}"/>
    </bean-->

    <!-- Hibernate SessionFactory -->
    <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSes sionFactoryBean">
    <property name="dataSource" ref="dataSource"/>
    <property name="mappingResources">
    <list>
    <value>/us/tn/state/trust/dao/hibernate/xml/User.hbm.xml</value>
    <value>/us/tn/state/trust/dao/hibernate/xml/Role.hbm.xml</value>

    </list>
    </property>
    .
    .
    .
    .
    .
    .

    this works fine .

    Issue : Remove the hardcoding of the user name and password and use JNDI look up

    Created a JNDI name jdbc/tndb2t in the Websphere 6.0 app server tested the connection works fine.


    My my modified Configuration files

    application-base.xml

    <bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryB ean">
    <property name="jndiName" value="jdbc/tndb2t" />
    </bean>

    <!-- Hibernate SessionFactory -->
    <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSes sionFactoryBean">
    <property name="dataSource" ref="dataSource"/>
    <property name="mappingResources">
    <list>
    <value>/us/tn/state/trust/dao/hibernate/xml/User.hbm.xml</value>
    <value>/us/tn/state/trust/dao/hibernate/xml/Role.hbm.xml</value>

    </list>
    </property>
    .
    .
    .
    .
    .
    .

    the application deploys fine when i try to log in it is not able to connect to the database
    am i missing some configuration for the jndi stuff ??

    it gives me the following exception

    [9/14/06 15:29:44:584 CDT] 00000038 SQLErrorCodes W Default sql-error-codes.xml not found (should be included in spring.jar)
    [9/14/06 15:29:44:662 CDT] 00000038 SQLErrorCodes I SQLErrorCodes loaded: []
    [9/14/06 15:29:46:709 CDT] 00000038 SystemOut O Hibernate: select user0_.USER_RACFID as USER1_0_ from DITR001.MVH479 user0_ where user0_.USER_RACFID=?
    [9/14/06 15:29:47:350 CDT] 00000038 SystemOut O Hibernate: select counties0_.USER_RACFID as USER1_1_, counties0_.CNTY_CDE as CNTY2_1_, counties0_.STRT_DTE as STRT3_1_, counties0_.USER_RACFID as USER1_51_0_, counties0_.CNTY_CDE as CNTY2_51_0_, counties0_.STRT_DTE as STRT3_51_0_, counties0_.END_DATE as END4_51_0_ from DITR001.MVH436 counties0_ where counties0_.USER_RACFID=?
    [9/14/06 15:29:47:443 CDT] 00000038 SystemOut O Hibernate: select county0_.CNTY_CDE as CNTY1_31_0_, county0_.CNTY_NME as CNTY2_31_0_, county0_.EMISSION_TST_REQ as EMISSION3_31_0_ from DITR001.MVH480 county0_ where county0_.CNTY_CDE=?
    [9/14/06 15:29:47:725 CDT] 00000038 JDBCException W SQL Error: -99999, SQLState: null
    [9/14/06 15:29:47:756 CDT] 00000038 JDBCException E Invalid operation: result set closed

  • #2
    What was the resolution? I get the problem too and no one can seem to solve it on the Internet.

    Comment

    Working...
    X