0 Replies Latest reply on Dec 7, 2005 12:12 PM by Viresh Patel

    ArrayInndexOutOfBounds error when connecting to DB

    Viresh Patel Newbie

      JBOSS 3.2.3
      Oracle 8 (dev env)
      Oracle9i (staging env)

      Hi,
      My jboss server starts up correctly when pointing to our dev DB.
      But when I point to another DB (Production or staging) I get the following exceptions thrown during startup.

      17:10:41,141 INFO [TransactionFactoryFactory] Transaction strategy: net.sf.hibe
      rnate.transaction.JTATransactionFactory
      17:10:41,141 INFO [NamingHelper] JNDI InitialContext properties:{}
      17:10:41,156 INFO [TransactionManagerLookupFactory] instantiating TransactionMa
      nagerLookup: net.sf.hibernate.transaction.JBossTransactionManagerLookup
      17:10:41,156 INFO [TransactionManagerLookupFactory] instantiated TransactionMan
      agerLookup
      17:10:41,156 INFO [NamingHelper] JNDI InitialContext properties:{}
      17:10:41,156 INFO [TransactionManagerLookupFactory] instantiating TransactionMa
      nagerLookup: net.sf.hibernate.transaction.JBossTransactionManagerLookup
      17:10:41,156 INFO [TransactionManagerLookupFactory] instantiated TransactionMan
      agerLookup
      17:10:41,703 WARN [JBossManagedConnectionPool] Throwable while attempting to ge
      t a new connection:
      org.jboss.resource.JBossResourceException: Could not create connection; - nested
      throwable: (java.lang.ArrayIndexOutOfBoundsException: 7)
      at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.c
      reateManagedConnection(LocalManagedConnectionFactory.java:160)
      at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.cr
      eateConnectionEventListener(InternalManagedConnectionPool.java:477)
      at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.ge
      tConnection(InternalManagedConnectionPool.java:213)
      at org.jboss.resource.connectionmanager.JBossManagedConnectionPool$BaseP
      ool.getConnection(JBossManagedConnectionPool.java:496)
      at org.jboss.resource.connectionmanager.BaseConnectionManager2.getManage
      dConnection(BaseConnectionManager2.java:425)
      at org.jboss.resource.connectionmanager.TxConnectionManager.getManagedCo
      nnection(TxConnectionManager.java:318)
      at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateC
      onnection(BaseConnectionManager2.java:477)
      at org.jboss.resource.connectionmanager.BaseConnectionManager2$Connectio
      nManagerProxy.allocateConnection(BaseConnectionManager2.java:814)
      at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(Wrapp
      erDataSource.java:102)
      at net.sf.hibernate.connection.DatasourceConnectionProvider.getConnectio
      n(DatasourceConnectionProvider.java:59)
      at net.sf.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.ja
      va:72)
      at net.sf.hibernate.cfg.Configuration.buildSettings(Configuration.java:1
      119)
      at net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.
      java:748)
      at net.sf.hibernate.jmx.HibernateService.buildSessionFactory(HibernateSe
      rvice.java:176)
      at net.sf.hibernate.jmx.HibernateService.start(HibernateService.java:145
      )
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
      java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
      sorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBea
      nDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceControl
      ler.java:976)
      at $Proxy14.start(Unknown Source)
      at org.jboss.system.ServiceController.start(ServiceController.java:394)
      at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
      sorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBea
      nDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
      at $Proxy4.start(Unknown Source)
      at org.jboss.deployment.SARDeployer.start(SARDeployer.java:226)
      at org.jboss.deployment.MainDeployer.start(MainDeployer.java:832)
      at org.jboss.deployment.MainDeployer.start(MainDeployer.java:824)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:642)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:605)
      at sun.reflect.GeneratedMethodAccessor18.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
      sorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBea
      nDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
      at $Proxy6.deploy(Unknown Source)
      at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymen
      tScanner.java:302)
      at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentS
      canner.java:476)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.
      doScan(AbstractDeploymentScanner.java:201)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(A
      bstractDeploymentScanner.java:274)
      at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:1
      92)
      at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
      sorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBea
      nDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceControl
      ler.java:976)
      at $Proxy0.start(Unknown Source)
      at org.jboss.system.ServiceController.start(ServiceController.java:394)
      at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
      sorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBea
      nDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
      at $Proxy4.start(Unknown Source)
      at org.jboss.deployment.SARDeployer.start(SARDeployer.java:226)
      at org.jboss.deployment.MainDeployer.start(MainDeployer.java:832)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:642)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:605)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:589)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
      java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
      sorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBea
      nDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
      at $Proxy5.deploy(Unknown Source)
      at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:384)
      at org.jboss.system.server.ServerImpl.start(ServerImpl.java:291)
      at org.jboss.Main.boot(Main.java:150)
      at org.jboss.Main$1.run(Main.java:395)
      at java.lang.Thread.run(Thread.java:534)
      Caused by: java.lang.ArrayIndexOutOfBoundsException: 7
      at oracle.security.o3logon.C1.r(C1)
      at oracle.security.o3logon.C1.l(C1)
      at oracle.security.o3logon.C0.e(C0)
      at oracle.security.o3logon.O3LoginClientHelper.getEPasswd(O3LoginClientH
      elper)
      at oracle.jdbc.ttc7.O3log.(O3log.java:287)
      at oracle.jdbc.ttc7.TTC7Protocol.logon(TTC7Protocol.java:231)
      at oracle.jdbc.driver.OracleConnection.(OracleConnection.java:200)

      at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.ja
      va:251)
      at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:224)
      at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.c
      reateManagedConnection(LocalManagedConnectionFactory.java:150)
      ... 80 more
      17:10:42,000 WARN [SettingsFactory] Could not obtain connection metadata
      org.jboss.util.NestedSQLException: Could not create connection; - nested throwab
      le: (java.lang.ArrayIndexOutOfBoundsException: 7); - nested throwable: (org.jbos
      s.resource.JBossResourceException: Could not create connection; - nested throwab
      le: (java.lang.ArrayIndexOutOfBoundsException: 7))
      at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(Wrapp
      erDataSource.java:106)
      at net.sf.hibernate.connection.DatasourceConnectionProvider.getConnectio
      n(DatasourceConnectionProvider.java:59)
      at net.sf.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.ja
      va:72)
      at net.sf.hibernate.cfg.Configuration.buildSettings(Configuration.java:1
      119)
      at net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.
      java:748)
      at net.sf.hibernate.jmx.HibernateService.buildSessionFactory(HibernateSe
      rvice.java:176)
      at net.sf.hibernate.jmx.HibernateService.start(HibernateService.java:145
      )
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
      java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
      sorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBea
      nDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceControl
      ler.java:976)
      at $Proxy14.start(Unknown Source)
      at org.jboss.system.ServiceController.start(ServiceController.java:394)
      at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
      sorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBea
      nDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
      at $Proxy4.start(Unknown Source)
      at org.jboss.deployment.SARDeployer.start(SARDeployer.java:226)
      at org.jboss.deployment.MainDeployer.start(MainDeployer.java:832)
      at org.jboss.deployment.MainDeployer.start(MainDeployer.java:824)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:642)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:605)
      at sun.reflect.GeneratedMethodAccessor18.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
      sorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBea
      nDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
      at $Proxy6.deploy(Unknown Source)
      at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymen
      tScanner.java:302)
      at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentS
      canner.java:476)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.
      doScan(AbstractDeploymentScanner.java:201)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(A
      bstractDeploymentScanner.java:274)
      at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:1
      92)
      at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
      sorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBea
      nDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceControl
      ler.java:976)
      at $Proxy0.start(Unknown Source)
      at org.jboss.system.ServiceController.start(ServiceController.java:394)
      at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
      sorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBea
      nDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
      at $Proxy4.start(Unknown Source)
      at org.jboss.deployment.SARDeployer.start(SARDeployer.java:226)
      at org.jboss.deployment.MainDeployer.start(MainDeployer.java:832)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:642)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:605)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:589)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
      java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
      sorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBea
      nDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
      at $Proxy5.deploy(Unknown Source)
      at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:384)
      at org.jboss.system.server.ServerImpl.start(ServerImpl.java:291)
      at org.jboss.Main.boot(Main.java:150)
      at org.jboss.Main$1.run(Main.java:395)
      at java.lang.Thread.run(Thread.java:534)
      Caused by: org.jboss.resource.JBossResourceException: Could not create connectio
      n; - nested throwable: (java.lang.ArrayIndexOutOfBoundsException: 7)
      at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.c
      reateManagedConnection(LocalManagedConnectionFactory.java:160)
      at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.cr
      eateConnectionEventListener(InternalManagedConnectionPool.java:477)
      at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.ge
      tConnection(InternalManagedConnectionPool.java:213)
      at org.jboss.resource.connectionmanager.JBossManagedConnectionPool$BaseP
      ool.getConnection(JBossManagedConnectionPool.java:496)
      at org.jboss.resource.connectionmanager.BaseConnectionManager2.getManage
      dConnection(BaseConnectionManager2.java:425)
      at org.jboss.resource.connectionmanager.TxConnectionManager.getManagedCo
      nnection(TxConnectionManager.java:318)
      at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateC
      onnection(BaseConnectionManager2.java:477)
      at org.jboss.resource.connectionmanager.BaseConnectionManager2$Connectio
      nManagerProxy.allocateConnection(BaseConnectionManager2.java:814)
      at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(Wrapp
      erDataSource.java:102)
      ... 72 more
      Caused by: java.lang.ArrayIndexOutOfBoundsException: 7
      at oracle.security.o3logon.C1.r(C1)
      at oracle.security.o3logon.C1.l(C1)
      at oracle.security.o3logon.C0.e(C0)
      at oracle.security.o3logon.O3LoginClientHelper.getEPasswd(O3LoginClientH
      elper)
      at oracle.jdbc.ttc7.O3log.(O3log.java:287)
      at oracle.jdbc.ttc7.TTC7Protocol.logon(TTC7Protocol.java:231)
      at oracle.jdbc.driver.OracleConnection.(OracleConnection.java:200)

      at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.ja
      va:251)
      at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:224)
      at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.c
      reateManagedConnection(LocalManagedConnectionFactory.java:150)
      ... 80 more

      below are snippets of the DS.xml files for both envoronments

      --------------------Development. THIS ONE WORKS----------------------
      <local-tx-datasource>
      <jndi-name>staffzone/NCPDS</jndi-name>
      <connection-url>jdbc:oracle:thin:@sunblade4:1521:viper</connection-url>
      <driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
      <user-name>********</user-name>
      *******
      <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
      <min-pool-size>1</min-pool-size>
      <max-pool-size>100</max-pool-size>
      </local-tx-datasource>
      ---------------------------------------------------------------------------------
      --------------------STAGING. THIS ONE DOES NOT WORK-----------------
      <local-tx-datasource>
      <jndi-name>staffzone/NCPDS</jndi-name>
      <connection-url>jdbc:oracle:thin:@netsdb01:1521:asp</connection-url>
      <driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
      <user-name>cobra_owner</user-name>
      cobra_owner
      <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
      <min-pool-size>1</min-pool-size>
      <max-pool-size>100</max-pool-size>
      </local-tx-datasource>
      ------------------------------------------------------------------------------------

      Can anybody help me find out why I cannot connect to the DB at startup of JBOSS?

      Any help would be greatly appreciated.

      Viresh