I am trying to implement the AbstractRoutingDataSource and have constructed a DataSource with a map element. When I try it out I get the following exception:
I can't make sense of this. The type map does have a key-type, as you can see in my xmlcode below.Code:org.xml.sax.SAXParseException: Attribute "key-type" must be declared for element type "map".
Code:<bean id="dataSource" class="no.bbs.bkad.testklient.online.datasource.RoutingDataSource"> <property name="targetDataSources"> <map key-type="no.bbs.bkad.testklient.online.datasource.EnvironmentType"> <entry key="PP2" value-ref="dataSourcePP2"/> <entry key="PP3" value-ref="dataSourcePP3"/> <entry key="PP4" value-ref="dataSourcePP4"/> <entry key="ST1" value-ref="dataSourceST1"/> <entry key="ST2" value-ref="dataSourceST2"/> <entry key="ST3" value-ref="dataSourceST3"/> <entry key="ST4" value-ref="dataSourceST4"/> </map> </property> <property name="defaultTargetDataSource" value="dataSourcePP1"></property> </bean>


Reply With Quote

