+ Start a Discussion
salesforce1587salesforce1587 

Connecting to oracle from salesforce

Hi,

 

I need to export data from oracle to sfdc using apex data loader command line.

 

I got the following exception.

 

Exception


2011-11-24 12:27:41,468 INFO  [main] controller.Controller initLog (Controller.j
ava:367) - The log has been initialized
2011-11-24 12:27:41,483 INFO  [main] process.ProcessConfig getBeanFactory (Proce
ssConfig.java:78) - Loading process configuration from config file: C:\Program F
iles\salesforce.com\Apex Data Loader 23.0\conf\process-conf.xml
2011-11-24 12:27:41,530 INFO  [main] xml.XmlBeanDefinitionReader loadBeanDefinit
ions (XmlBeanDefinitionReader.java:163) - Loading XML bean definitions from file
 [C:\Program Files\salesforce.com\Apex Data Loader 23.0\conf\process-conf.xml]
2011-11-24 12:27:41,546 INFO  [main] core.CollectionFactory <clinit> (Collection
Factory.java:66) - JDK 1.4+ collections available
2011-11-24 12:27:41,561 INFO  [main] core.CollectionFactory <clinit> (Collection
Factory.java:71) - Commons Collections 3.x available
2011-11-24 12:27:41,608 INFO  [accountInsert] controller.Controller initConfig (
Controller.java:328) - The controller config has been initialized
2011-11-24 12:27:41,624 INFO  [accountInsert] process.ProcessRunner run (Process
Runner.java:90) - Initializing process engine
2011-11-24 12:27:41,624 INFO  [accountInsert] process.ProcessRunner run (Process
Runner.java:93) - Loading parameters
2011-11-24 12:27:42,593 INFO  [accountInsert] config.LastRun load (LastRun.java:
96) - Last run info will be saved in file: C:\Program Files\salesforce.com\Apex
Data Loader 23.0\conf\accountInsert_lastRun.properties
2011-11-24 12:27:42,608 INFO  [accountInsert] process.ProcessRunner run (Process
Runner.java:101) - Logging in to: https://test.salesforce.com
2011-11-24 12:27:42,624 INFO  [accountInsert] client.PartnerClient login (Partne
rClient.java:448) - Beginning Partner Salesforce login ....
2011-11-24 12:27:42,624 INFO  [accountInsert] client.ClientBase getConnectorConf
ig (ClientBase.java:112) - Salesforce login will use proxy host: 10.31.120.30 po
rt: 8080
2011-11-24 12:27:42,639 INFO  [accountInsert] client.PartnerClient loginInternal
 (PartnerClient.java:488) - Salesforce login to https://test.salesforce.com/serv
ices/Soap/u/23.0 as user khaja.patla@ge.com.dev
2011-11-24 12:27:46,389 INFO  [accountInsert] client.ClientBase getConnectorConf
ig (ClientBase.java:112) - Salesforce login will use proxy host: 10.31.120.30 po
rt: 8080
2011-11-24 12:27:46,389 INFO  [accountInsert] dao.DataAccessObjectFactory getDao
Instance (DataAccessObjectFactory.java:51) - Instantiating data access object: d
bDataSource of type: databaseWrite
2011-11-24 12:27:46,389 INFO  [accountInsert] xml.XmlBeanDefinitionReader loadBe
anDefinitions (XmlBeanDefinitionReader.java:163) - Loading XML bean definitions
from file [C:\Program Files\salesforce.com\Apex Data Loader 23.0\conf\database-c
onf.xml]

 

The actual problem is from here:

 

2011-11-24 12:27:46,421 FATAL [accountInsert] controller.Controller createDao (C
ontroller.java:172) - Error creating data access object
java.lang.ClassCastException: org.apache.commons.dbcp.BasicDataSource
        at com.salesforce.dataloader.dao.database.DatabaseConfig.getInstance(Dat
abaseConfig.java:23)
        at com.salesforce.dataloader.dao.database.DatabaseWriter.<init>(Database
Writer.java:74)
        at com.salesforce.dataloader.dao.database.DatabaseWriter.<init>(Database
Writer.java:58)
        at com.salesforce.dataloader.dao.DataAccessObjectFactory.getDaoInstance(
DataAccessObjectFactory.java:60)
        at com.salesforce.dataloader.controller.Controller.createDao(Controller.
java:170)
        at com.salesforce.dataloader.process.ProcessRunner.run(ProcessRunner.jav
a:104)
        at com.salesforce.dataloader.process.ProcessRunner.run(ProcessRunner.jav
a:74)
        at com.salesforce.dataloader.process.ProcessRunner.main(ProcessRunner.ja
va:226)
2011-11-24 12:27:46,421 FATAL [main] process.ProcessRunner topLevelError (Proces
sRunner.java:211) - Unable to run process accountInsert
java.lang.RuntimeException: com.salesforce.dataloader.exception.DataAccessObject
InitializationException: Error creating data access object
        at com.salesforce.dataloader.process.ProcessRunner.run(ProcessRunner.jav
a:136)
        at com.salesforce.dataloader.process.ProcessRunner.run(ProcessRunner.jav
a:74)
        at com.salesforce.dataloader.process.ProcessRunner.main(ProcessRunner.ja
va:226)
Caused by: com.salesforce.dataloader.exception.DataAccessObjectInitializationExc
eption: Error creating data access object
        at com.salesforce.dataloader.controller.Controller.createDao(Controller.
java:173)
        at com.salesforce.dataloader.process.ProcessRunner.run(ProcessRunner.jav
a:104)
        ... 2 more
Caused by: java.lang.ClassCastException: org.apache.commons.dbcp.BasicDataSource

        at com.salesforce.dataloader.dao.database.DatabaseConfig.getInstance(Dat
abaseConfig.java:23)
        at com.salesforce.dataloader.dao.database.DatabaseWriter.<init>(Database
Writer.java:74)
        at com.salesforce.dataloader.dao.database.DatabaseWriter.<init>(Database
Writer.java:58)
        at com.salesforce.dataloader.dao.DataAccessObjectFactory.getDaoInstance(
DataAccessObjectFactory.java:60)
        at com.salesforce.dataloader.controller.Controller.createDao(Controller.
java:170)

 

process-conf

 

<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
    <bean id="accountInsert" class="com.salesforce.dataloader.process.ProcessRunner" singleton="false">
    <description>accountInsert job gets the account record from the CSV file and inserts it into Salesforce.</description>
    <property name="name" value="accountInsert"/>
    <property name="configOverrideMap">
    <map>
        <entry key="sfdc.debugMessages" value="true"/>
        <entry key="sfdc.debugMessagesFile" value="C:\Program Files\salesforce.com\Apex Data Loader            23.0\accountInsertSoapTrace.log"/>
        <entry key="sfdc.endpoint" value="https://test.salesforce.com"/>
        <entry key="sfdc.username" value="un"/>    
        <entry key="sfdc.password" value="0d100f71eea2fc4b20e0597d18972159f4c88980e5e37df8cb7763cc234296c8994a1da07741b3f3"/>
        <entry key="process.encryptionKeyFile" value="C:\Program Files\salesforce.com\Apex Data Loader 23.0\conf\key1.txt"/>
        <entry key="sfdc.timeoutSecs" value="600"/>
        <entry key="sfdc.loadBatchSize" value="200"/>
        <entry key="sfdc.entity" value="Account"/>
        <entry key="process.operation" value="extract"/>
        <entry key="process.mappingFile" value="C:\Program Files\salesforce.com\Apex Data Loader 23.0\conf\accin.sdl"/>
        <entry key="dataAccess.name" value="dbDataSource"/>
        <entry key="process.outputSuccess" value="C:\Program Files\salesforce.com\Apex Data Loader 23.0\accountInsert_success.csv"/>
        <entry key="process.outputError" value="C:\Program Files\salesforce.com\Apex Data Loader 23.0\accountInsert_error.csv"/>
        <entry key="dataAccess.type" value="databaseWrite"/>
        <entry key="process.initialLastRunDate" value="2005-12-01T00:00:00.000-0800"/>
        <entry key="sfdc.proxyHost" value="hn"/>
        <entry key="sfdc.proxyNtlmDomain" value=""/>
        <entry key="sfdc.proxyPassword" value=""/>
        <entry key="sfdc.proxyPort" value="port"/>
        <entry key="sfdc.proxyUsername" value=""/>
        
        
    </map>
    </property>
    </bean>
</beans>

 

database-conf

 

<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<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:@servername:1953:databasename"/>
    <property name="username" value="us"/>
    <property name="password" value="pw"/>
</bean>

<bean id="queryAccountAll"
      class="com.salesforce.dataloader.dao.database.DatabaseConfig"
      singleton="true">
    <property name="sqlConfig" ref="queryAccountAllSql"/>
    <property name="dataSource" ref="dbDataSource"/>
</bean>

<bean id="queryAccountAllSql"
      class="com.salesforce.dataloader.dao.database.SqlConfig" singleton="true">
    <property name="sqlString">
        <value>
             SELECT ACCOUNTNAME,ACCOUNTPARTYID FROM T_ACCOUNT_ORGANIZATION
        </value>
    </property>
    <property name="columnNames">
        <list>
            <value>ACCOUNTNAME</value>
            <value>ACCOUNTPARTYID</value>
       </list>
    </property>
</bean>
</beans>

 

Kindly help.

 

Regards,

Neha