Using this xml:

<bean id="dbDataSource"
    <property name="driverClassName" value="jdbc.driver.OracleDriver"/>

I'm getting this error:

2017-08-18 13:58:40,959 FATAL [TRFUpsertProcess] controller.Controller createDao (Controller.java:186) - Error creating data access object java.lang.ClassCastException: org.apache.commons.dbcp.BasicDataSource cannot be cast to com.salesforce.dataloader.dao.database.DatabaseConfig at com.salesforce.dataloader.dao.database.DatabaseConfig.getInstance(Dat abaseConfig.java:48)

My JRE is:

java version "1.8.0_121" Java(TM) SE Runtime Environment (build 1.8.0_121-b13) Java HotSpot(TM) Client VM (build 25.121-b13, mixed mode, sharing)

Does anyone know how to fix this?

  • Without further info regarding your DatabaseConfig file it's hard to know, however I'd guess that the error is because of misconfiguration between DatabaseConfig bean and DataSource bean. can you post both beans ? – Has Nah Aug 18 '17 at 21:49
  • Here are the beans: <beans> <bean id="dbDataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"> <property name="driverClassName" value="oracle.jdbc.driver.OracleDriver"/> <property name="url" value="jdbc:oracle:thin:@friskies:1523:starlims2dev"/> <property name="username" value=""/> <property name="password" value=""/> </bean> – Lori Wilson Aug 29 '17 at 18:13
  • <bean id="queryAllTests" class="com.salesforce.dataloader.dao.database.DatabaseConfig" singleton="true"> <property name="sqlConfig" ref="queryAllTestsSql"/> <property name="dataSource" ref="dbDataSource"/> </bean> – Lori Wilson Aug 29 '17 at 18:15
  • <bean id="queryAllTestsSql" class="com.salesforce.dataloader.dao.database.SqlConfig" singleton="true"> <property name="sqlString"> <value> SELECT user from dual </value> </property> <property name="columnNames"> <list> <value>USER</value> </list> </property> </bean> </beans> – Lori Wilson Aug 29 '17 at 18:15

Thank you for responding. Here are the beans: SELECT t.accessionid,'1','0' FROM xdx_v_all_tests t WHERE t.accessionid like 'SFDC%' ACCESSION\ ID QUANTITY PRICE

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.