camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "sarada.ch" <sarada.sha...@gmail.com>
Subject Camel-hibernate issue Unable to convert value org.springframework.orm.hibernate4.LocalSessionFactoryBean@59a6b72c to type org.hibernate.SessionFactory
Date Fri, 26 May 2017 02:11:56 GMT
Hi All

I am trying camel_hibernate  and ran into compatibility issue. Camel version
2.17 and JBoss Fuse 6.3 I am using Blueprint DSL

/Error message :/ 
*Unable to convert value
org.springframework.orm.hibernate4.LocalSessionFactoryBean@59a6b72c to type
org.hibernate.SessionFactory*

/Camel.xml/

<?xml version="1.0" encoding="UTF-8"?>
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0
https://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd                                
http://camel.apache.org/schema/blueprint
http://camel.apache.org/schema/blueprint/camel-blueprint.xsd     
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd">
    
    <bean class="org.apache.commons.dbcp.BasicDataSource"
        destroy-method="close" id="dataSource">
        <property name="url"
value="jdbc:sqlserver://localhost:1433;DatabaseName=Maxtest"/>
        <property name="driverClassName"
value="com.microsoft.sqlserver.jdbc.SQLServerDriver"/>
        <property name="username" value="root"/>
        <property name="password" value="root"/>
        <property name="removeAbandoned" value="true"/>
        <property name="initialSize" value="20"/>
        <property name="maxActive" value="30"/>
    </bean>
    
    <bean
       
class=&quot;&lt;b>org.apacheextras.camel.component.hibernate.HibernateComponen*t"
id="hibernate">
        <property name="sessionFactory" ref="sessionFactory"/>
        
    </bean>
    <bean
       
class=&quot;&lt;b>org.springframework.orm.hibernate4.LocalSessionFactoryBean*"
id="sessionFactory">
        <property name="dataSource" ref="dataSource"/>
        <property name="annotatedClasses">
            <list>
                <value>com.x.dto.ReferenceTable</value>
            </list>
        </property>
        <property name="hibernateProperties">
            <value>
				hibernate.dialect=org.hibernate.dialect.SQLServerDialect
			</value>
        </property>
    </bean>
    <bean
        class="org.springframework.transaction.support.TransactionTemplate"
id="transactionTemplate">
        <property name="transactionManager" ref="transactionManager"/>
    </bean>
    
    
    <bean
       
class="org.springframework.orm.hibernate4.HibernateTransactionManager"
id="transactionManager">
        <property name="sessionFactory" ref="sessionFactory"/>
    </bean>
    <camelContext id="_context1"
xmlns="http://camel.apache.org/schema/blueprint">
        <route id="_route1">
            <from id="form" uri="timer://foo?repeatCount=1"/>
            <to id="to"
uri="hibernate:com.x.dto.ReferenceTable?consumer.query=from
com.example.ReferenceTable order by key"/>
            <log id="log" message="${body}"/>
        </route>
    </camelContext>
</blueprint>

Any help is accpreciated




--
View this message in context: http://camel.465427.n5.nabble.com/Camel-hibernate-issue-Unable-to-convert-value-org-springframework-orm-hibernate4-LocalSessionFactoryy-tp5800751.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Mime
View raw message