I am trying to configure an Oracle database endpoint in Mule 3.5 CE version. Here is my configuration.
<db:oracle-config name="Oracle_Configuration" useXaTransactions="true" doc:name="Oracle Configuration" dataSource-ref="dataSource">
<db:pooling-profile maxPoolSize="10" minPoolSize="5" acquireIncrement="2"/>
</db:oracle-config>
<spring:beans>
<spring:bean id="dataSource" class="oracle.jdbc.pool.OracleDataSource" destroy-method="shutdown" name="Bean">
<spring:property name="driverName" value="oracle.jdbc.driver.OracleDriver"/>
<spring:property name="url" value="${oracle.jdbc.url}"/>
<spring:property name="user" value="${oracle.jdbc.user}"/>
<spring:property name="password" value="${oracle.jdbc.password}"/>
</spring:bean>
</spring:beans>
When I try to run it in Anypoint Studio, it gives following error:
org.mule.module.launcher.DeploymentInitException: SAXParseException: cvc-complex-type.4: Attribute 'user' must appear on element 'db:oracle-config'
What is the correct configuration?
This is a known issue, upgrading to 3.6 should solve the problem. mule-jira-7708
Alternatively you can try the workaround below:
<db:oracle-config name="Oracle_Configuration" useXaTransactions="true" dataSource-ref="dataSource" user="${oracle.jdbc.user}" password="${oracle.jdbc.password}" doc:name="Oracle Configuration">
<db:pooling-profile maxPoolSize="10" minPoolSize="5" acquireIncrement="2"/>
</db:oracle-config>
<spring:beans>
<spring:bean id="dataSource" class="oracle.jdbc.pool.OracleDataSource" destroy-method="shutdown" name="Bean">
<spring:property name="driverName" value="oracle.jdbc.driver.OracleDriver"/>
<spring:property name="url" value="${oracle.jdbc.url}"/>
</spring:bean>
</spring:beans>