change data source to oracle error

wpengyi.gmail.com's picture
I want to move h2 to oracle. I can add the oracle data source successful using datasources ui, but when i restart the bam, the data source is still h2. I find the datasources.properties is not changed. so i edit the file synapse.datasources=bamoracle synapse.datasources.bamh2.type=BasicDataSource synapse.datasources.bamh2.driverClassName=oracle.jdbc.driver.OracleDriver synapse.datasources.bamh2.url=jdbc:oracle:thin:@***.***.***.***:orcl synapse.datasources.bamh2.username=*** synapse.datasources.bamh2.password=*** when i restart the bam, the error is: [2011-07-06 16:17:28,044] ERROR {org.wso2.carbon.dataservices.core.DBInOutMessageReceiver} -  Error in in-out message receiver DS Fault Message: Error in pre-fetching data DS Code: DATABASE_ERROR Nested Exception:- javax.xml.stream.XMLStreamException: DS Fault Message: Error in 'SQLQuery.processNormalQuery' DS Code: DATABASE_ERROR Source Data Service:- Name: BAMConfigurationDS Location: /BAMConfigurationDS.dbs Description: N/A Default Namespace: http://ws.wso2.org/dataservice Current Request Name: getServersForServerType Current Params: {serverType=PullServer} Nested Exception:- DS Fault Message: The data source is nonexistent DS Code: UNKNOWN_ERROR         at org.wso2.carbon.dataservices.core.engine.DSOMDataSource.prefetchData(DSOMDataSource.java:88)         at org.wso2.carbon.dataservices.core.dispatch.SingleDataServiceRequest.processSingleRequest(SingleDataServiceRequest.java:95)         at org.wso2.carbon.dataservices.core.dispatch.SingleDataServiceRequest.processRequest(SingleDataServiceRequest.java:76)         at org.wso2.carbon.dataservices.core.dispatch.DataServiceRequest.dispatch(DataServiceRequest.java:275)         at org.wso2.carbon.dataservices.core.DataServiceProcessor.dispatch(DataServiceProcessor.java:50)         at org.wso2.carbon.dataservices.core.DBInOutMessageReceiver.invokeBusinessLogic(DBInOutMessageReceiver.java:52)         at org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver.invokeBusinessLogic(AbstractInOutSyncMessageReceiver.java:42)         at org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMessageReceiver.java:110)         at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:181)         at org.apache.axis2.transport.local.LocalTransportReceiver.processMessage(LocalTransportReceiver.java:166)         at org.apache.axis2.transport.local.LocalTransportReceiver.processMessage(LocalTransportReceiver.java:79)         at org.apache.axis2.transport.local.LocalTransportSender.finalizeSendWithToAddress(LocalTransportSender.java:102)         at org.apache.axis2.transport.local.LocalTransportSender.invoke(LocalTransportSender.java:77)         at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:443)         at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:406)         at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:229)         at org.apache.axis2.client.OperationClient.execute(OperationClient.java:165)         at org.wso2.carbon.bam.services.stub.bamconfigurationds.BAMConfigurationDSStub.getServersForServerType(BAMConfigurationDSStub.java:6375)         at org.wso2.carbon.bam.common.clients.BAMConfigurationDSClient.getServersforServerType(BAMConfigurationDSClient.java:152)         at org.wso2.carbon.bam.core.persistence.BAMPersistenceManager.getMonitoredServersByType(BAMPersistenceManager.java:847)         at org.wso2.carbon.bam.core.collector.DataCollector.run(DataCollector.java:66)         at java.util.TimerThread.mainLoop(Timer.java:512) I have already run the bam_schema_oracle.sql, the h2 can't be moved?  
mccloud35's picture

Hi, This maybe an

Hi, This maybe an intermittent issue. Can you get a fresh distribution zip file extract and copy your datasources.properties file and start the server. This will fix your problem.
wpengyi.gmail.com's picture

Thank you for reply. I get a

Thank you for reply. I get a fresh distribution zip file, also i change the datasources.properties as below: synapse.datasources=bamoracle synapse.datasources.bamoracle.type=BasicDataSource synapse.datasources.bamoracle.driverClassName=oracle.jdbc.driver.OracleDriver synapse.datasources.bamoracle.url=jdbc:oracle:thin:@***.***.***.***:1521:orcl synapse.datasources.bamoracle.username=*** synapse.datasources.bamoracle.password=*** I can get the oracle data Source on web console correctly, but on cmd console the error "The data source is nonexistent" still exists.
kasunw.wso2.com's picture

Hi, After observing your

Hi, After observing your datasources.properties file I noticed that you have missed to put the dsName in there, therefore please add the following dsName to the datasource.properties file. (You cannot change this name as you wish and you must include it in your datasource.properties file.) Your datasource.properties file should be like this, synapse.datasources=bam_datasource (no needed to change this name from one database type to another, as you have rename it to bamoracle) synapse.datasources.bam_datasource.type=BasicDataSource synapse.datasources.bam_datasource.driverClassName=oracle.jdbc.driver.OracleDriver synapse.datasources.bam_datasource.url=jdbc:oracle:thin:@***.***.***.***:1521:orcl synapse.datasources.bam_datasource.username=**** synapse.datasources.bam_datasource.password=**** synapse.datasources.bam_datasource.dsName=bam_datasource Other things are optional. Please let me know if you face any other issues. Thanks Kasun.
wpengyi.gmail.com's picture

It works! I changed my

It works! I changed my datasource.properties file: synapse.datasources=bamOracle synapse.datasources.icFactory=com.sun.jndi.rmi.registry.RegistryContextFactory synapse.datasources.providerPort=2199 synapse.datasources.bamOracle.registry=JNDI synapse.datasources.bamOracle.type=BasicDataSource synapse.datasources.bamOracle.driverClassName=oracle.jdbc.driver.OracleDriver synapse.datasources.bamOracle.url=jdbc:oracle:thin:@***.***.***.***:1521:orcl synapse.datasources.bamOracle.username=*** synapse.datasources.bamOracle.password=*** synapse.datasources.bamOracle.dsName=bam_datasource synapse.datasources.bamOracle.maxActive=100 synapse.datasources.bamOracle.maxIdle=20 synapse.datasources.bamOracle.maxWait=10000