Question

I am trying implement XA Transaction with oracle database connector in Mule Studio. When I try to deploy this mule application on MuleStudio server I am getting below exception.

Exception:

"Caused by: org.springframework.beans.NotWritablePropertyException: Invalid property 'url' of bean class [oracle.jdbc.xa.client.OracleXADataSource]: Bean property 'url' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?"

Mule Configuration xml file:

<jdbc-ee:oracle-data-source name="Oracle_Data_Source" user="system" password="manager" url="jdbc:oracle:thin:@//localhost:1521/xe" transactionIsolation="UNSPECIFIED" doc:name="Oracle Data Source"/>
<jdbc-ee:connector name="Database" dataSource-ref="oracleJdbcBean" validateConnections="true" queryTimeout="-1" pollingFrequency="0" doc:name="Database"/>
<jbossts:transaction-manager doc:name="Transaction Manager"/>
<spring:beans>
    <spring:bean id="oracleJdbcBean" name="oracleJdbcBean" class="oracle.jdbc.xa.client.OracleXADataSource">
        <spring:property name="user" value="system"/>
        <spring:property name="password" value="manager"/>
        <spring:property name="url" value="jdbc:oracle:thin:@localhost:1521:xe"/>
    </spring:bean>
</spring:beans>
<flow name="oraclexatransactionFlow1" doc:name="oraclexatransactionFlow1">
    <http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="8082" path="testTable" doc:name="HTTP"/>
    <ee:xa-transactional action="ALWAYS_BEGIN" doc:name="Transactional">
        <jdbc-ee:outbound-endpoint exchange-pattern="request-response" queryKey="testQuery" queryTimeout="-1" connector-ref="Database" doc:name="Database">
            <xa-transaction action="ALWAYS_JOIN"/>
            <jdbc-ee:query key="testQuery" value="select * from test"/>
        </jdbc-ee:outbound-endpoint>
    </ee:xa-transactional>
</flow>

I have followed the above configuration for other application to make xa transaction work with oracle database but I am getting different exception as below:

Caused by: org.xml.sax.SAXParseException; lineNumber: 195; columnNumber: 55; cvc-complex-type.2.4.a: Invalid content was found starting with element 'xa-transaction'. One of '{"http://www.mulesoft.org/schema/mule/jdbc":abstract-query}' is expected.

Please correct me if I configured anything wrong.

Was it helpful?

Solution 2

Uppercase of "URL" worked for me to resolve the first problem i.e.,

<spring:property name="URL" value="jdbc:oracle:thin:@localhost:1521:xe" />

And the second problem was resolved by placing the "xa-transaction" element before the query as below.

<jdbc-ee:outbound-endpoint exchange-pattern="request-response" queryKey="testQuery" queryTimeout="-1" connector-ref="Database" doc:name="Database"> 
<xa-transaction action="NONE" /> 
<jdbc-ee:query key="testQuery" value="select * from test" /> 

OTHER TIPS

Url property should probably be

<spring:property name="url" value="jdbc:oracle:thin:@//localhost:1521/XE"/>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top