2 Replies Latest reply on Jan 10, 2007 11:54 AM by tfite01

    Oracle Database resource problem

    skumarsamy

      Hi,

      I am looking for urgent help.
      Im developing and deploying a new enterprise application with EJB3 and using oracle 10g as our database. Im using ojdbc14.jar for the library to be used for the database operations.

      My jboss-ds.xml
      <?xml version="1.0" encoding="UTF-8"?>

      <local-tx-datasource>
      <jndi-name>jdbc/OracleDS</jndi-name>
      <connection-url>jdbc:oracle:thin:@localhost:1521:orclrts</connection-url>
      <driver-class>oracle.jdbc.OracleDriver</driver-class>
      <user-name>appcrm</user-name>
      vsunjai
      <min-pool-size>5</min-pool-size>
      <max-pool-size>20</max-pool-size>
      <idle-timeout-minutes>5</idle-timeout-minutes>
      </local-tx-datasource>


      My bean code as follows

      @Resource(name = "jdbc/OracleDS", mappedName="java:jdbc/OracleDS")
      private void setJdbcOracleDS(DataSource ds) {
      this.jdbcOracleDS = ds;
      }

      private DataSource jdbcOracleDS;

      My resource aquiring class have
      conn = jdbcOracleDS.getConnection();

      It is saying the driver class as wrong.
      If i change to oracle.jdbc.driver.OracelDriver then it works for some time and if i restart is says the oracle.jdbc.dirver.OracleDriver was wrong, i revert back then it is working.

      As well when i try to close my result set it gives me nullpointerexception.

      No idea of what is happening.
      Will any one help to resolve this.

      regards
      kumar

        • 1. Re: Oracle Database resource problem
          skumarsamy

          Hi,

          I'm now getting some other exception as follows. Here i'm the only user and i don't have much connection too.

          10:42:24,484 WARN [JBossManagedConnectionPool] Unable to fill pool
          org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (java.lang.NullPointerException)
          at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.createManagedConnection(LocalManagedConnectionFactory.java:179)
          at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.createConnectionEventListener(InternalManagedConnectionPool.java:565)
          at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.fillToMin(InternalManagedConnectionPool.java:512)
          at org.jboss.resource.connectionmanager.PoolFiller.run(PoolFiller.java:74)
          at java.lang.Thread.run(Thread.java:595)
          Caused by: java.lang.NullPointerException
          at org.jboss.mx.loading.RepositoryClassLoader.findClass(RepositoryClassLoader.java:620)
          at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
          at org.jboss.mx.loading.RepositoryClassLoader.loadClassImpl(RepositoryClassLoader.java:464)
          at org.jboss.mx.loading.RepositoryClassLoader.loadClass(RepositoryClassLoader.java:405)
          at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
          at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
          at java.lang.Class.forName0(Native Method)
          at java.lang.Class.forName(Class.java:164)
          at oracle.net.ns.NetException.(Unknown Source)
          at oracle.net.ano.Ano.e(Ano)
          at oracle.net.ano.Ano.init(Ano)
          at oracle.net.ns.NSProtocol.connect(Unknown Source)
          at oracle.jdbc.driver.T4CConnection.connect(T4CConnection.java:844)
          at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:268)
          at oracle.jdbc.driver.PhysicalConnection.(PhysicalConnection.java:414)
          at oracle.jdbc.driver.T4CConnection.(T4CConnection.java:165)
          at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:35)
          at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:801)
          at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.createManagedConnection(LocalManagedConnectionFactory.java:171)
          ... 4 more

          regards
          kumar

          • 2. Re: Oracle Database resource problem

            You definitley should be using the oracle.jdbc.driver.OracleDriver driver class for local-tx-datasource.

            Also, do you have both the ojdbc14.jar and orai18n.jar libs in your app classpath?