The folks on the Karaf IRC channel suggested I post this here in order to get
more feedback.  Basically, I'm using hibernate, spring, and the spring dbcp
connection pool to connect to Oracle and get the following error:

Caused by: org.springframework.beans.factor.BeanCreationException: Error
creating bean with name  'myAppSessionFactory' defined in class path 

resource [myApp/util/dataSource/applicationContext.xml]: Invocation of init
method failed; nexted exception is 

java.lang.ArrayIndexOutOfBoundsException: -1
        more exceptions
        .. 58 more
Caused by: java.lang.ArrayIndexOutOfBoundsException: -1
        at
oracle.jdbc.driver.T4CTTIoauthenticate.setSessionFields(T4CTTI0authenticate.java:972)
        at
oracle.jdbc.driver.T4CTTIoauthenticate.<init>(T4CTTI0authenticate.java:185)
        at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:352)
        at
oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:441)
        at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:165)
        at
oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:35)
        at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:801)
        at
org.apache.commons.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:38)
        at
org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:294)
        at
org.apache.commons.dbcp.BasicDataSource.validateConnectionFactory(BasicDataSource.java:1240)
        at
org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1240)
        at
org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:882)
        at
org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider.getconnection(LocalDataSourceConnectionProvider.java:81)


For reference, The following information should help:

>From my applicationContext.xml file:
<bean id="myAppPoolDataSource"
class="org.apache.commons.dbcp.BasicDataSource"
        destroy-method="close
        p:driverclassName="${myApp.db.driver}"
        p:url="${myApp.url}"
        p:username="${myApp.userName}"
        p:password="${myApp.password}"
        p:maxActive="${myApp.maxActive}"
        p:initialSize="${myApp.initialSize}"
/>

<bean id="myAppSessionFactory"
        class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"
        p:dataSource-ref="myAppPoolDataSource">
        <property name="mappingResources">
                <list>
                        <value>myApp/util/TableOne.hbm.xml</value>
                        <value>myApp/util/TableTwo.hbm.xml</value>
                        <value>myApp/util/TableThree.hbm.xml</value>
                </list>
        </property>
</bean>

And:

The oracle .jar is:
mvn:com.oracle/ojdbc14/10.2.0.4.0
myApp.db.driver is set to oracle.jdbc.driver.OracleDriver 
myApp.url is set to: jdbc:oracle:thin:@<ip>:<port>:sandbox
-- 
View this message in context: 
http://karaf.922171.n3.nabble.com/Karaf-Spring-Hibernate-DBCP-issue-tp1781634p1781634.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Reply via email to