views:

1199

answers:

1

Needed steps for implementing Drools Flow Persistence with MySQL.

I was following the Drools Flows Documentation on chapter 5.1.3.: Configuring Persistence.(https://hudson.jboss.org/hudson/job/drools/lastSuccessfulBuild/artifact/trunk/target/docs/drools-flow/html_single/index.html#d0e1157 )

Erroo-1: Caused by: bitronix.tm.utils.PropertyException: no writeable property 'URL' in class 'com.mysql.jdbc.Driver'

Error-2: Caused by: java.lang.ClassCastException: com.mysql.jdbc.Driver cannot be cast to javax.sql.XADataSource

Thanks in Advance........

A: 

It looks like you have to configure your Datasource as XA. Here you have an example

<datasources>
 <xa-datasource>
     <jndi-name>jdbc/my_ds</jndi-name>
     <xa-datasource-property name="URL">jdbc:mysql://localhost:3306/my_db</xa-datasource-property>
     <xa-datasource-class>com.mysql.jdbc.jdbc2.optional.MysqlXADataSource</xa-datasource-class>
     <user-name>root</user-name>
     <password>password</password>
     <track-connection-by-tx>true</track-connection-by-tx>
     <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter</exception-sorter-class-name>
     <valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.MySQLValidConnectionChecker</valid-connection-chec    ker-class-name>
     <min-pool-size>1</min-pool-size>
     <max-pool-size>10</max-pool-size>
     <idle-timeout-minutes>10</idle-timeout-minutes>
     <metadata>
         <type-mapping>mySQL</type-mapping>
     </metadata>
 </xa-datasource>

diega
Thanks diega, Actually I was using Driver class instead of datasource-class.
stackoverflowBee
Then why not vote-up?
pihentagy