0 Replies Latest reply on Jun 4, 2010 10:03 AM by komariraj

    Can not get JNDI connection from Data sourceSQLState with oracle 10g

    komariraj

      Hi all

      i am using jboss portal 2.6.8 server with oracle 10g..

       

      i am getting follwing  exception when creating datasource object for Oracle 10g using JNDI.

       

      Can not get JNDI connection from Data sourceSQLState: null Vendor Code:  0 Could not create connection; - nested throwable:  (java.lang.NullPointerException); - nested throwable:  (org.jboss.resource.JBossResourceException: Could not create connection; -  nested throwable: (java.lang.NullPointerException))

       

      step-1: portal-oracle-ds.xml

      <datasources>
        <local-tx-datasource>
          <jndi-name>jndiname</jndi-name>
          <connection-url>jdbc:oracle:thin:@server:orcl</connection-url>
          <driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
          <user-name>user</user-name>
          <password>password</password>
        </local-tx-datasource>
      </datasources>

       

      I copied this xml file in to deploy folder of jboss.

       

      step: 2 classes12.jar copied in my war file lib only


      step-3: in my java code ...

       

                      line-1:  InitialContext initialContext = new InitialContext();              
                    
                      line-2: DataSource dataSource = (DataSource)initialContext.lookup("java:/jndiname");      
                   
                      line-3: java.sql.Connection dbconnection = dataSource.getConnection(); 

       

      when ever i am  executing line-3, getting above exception...

       

       

      if any body knows about this problam ,  please help...

       

      Thanks in advance..

      Raju.K