Quantcast

Jpa Idempotent + OSGi

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Jpa Idempotent + OSGi

renalexster
Hello All,

I'm have problem when i try to use JPA Idempotent in a Fuse Fabric OSGI container (fuse-karaf).
I got this exception:

Caused by: java.lang.ClassNotFoundException: org.hibernate.proxy.HibernateProxy not found by org.apache.camel.camel-jpa [121]

I created a simple project with example: camel-jpa-idempotent

This is my route:
========================================
from("jpa:com.mycompany.model.Client?persistenceUnit=persistenceUnit&consumeDelete=false")
                .split().simple("${body}")
                        .idempotentConsumer(simple("${body.id}/${body.name}"), JpaMessageIdRepository.jpaMessageIdRepository("persistenceUnit", "ClientRepository"))
                        .log("${body.name} processed");

========================================

My context:
=====================================================
 <osgix:cm-properties id="parametros.spring" persistent-id="parametros.spring">
        <prop key="db.driverClassName">org.postgresql.Driver</prop>
        <prop key="db.url">jdbc:postgresql://192.168.238.1:5432/camel-jpa
                </prop>
        <prop key="db.username">camel-jpa</prop>
        <prop key="db.password">123456</prop>
    </osgix:cm-properties>
    <ctx:property-placeholder properties-ref="parametros.spring"/>
   
    <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
                <property name="driverClassName" value="${db.driverClassName}" />
                <property name="url" value="${db.url}" />
                <property name="username" value="${db.username}" />
                <property name="password" value="${db.password}" />
        </bean>
    <bean class="com.mycompany.routes.CamelRoute" id="javaCamelRoute"/>
    <bean class="org.apache.camel.component.jpa.JpaComponent" id="jpa">
        <property name="entityManagerFactory" ref="entityManagerFactory"/>
        <property name="transactionManager" ref="jpaTxManager"/>
    </bean>
    <bean class="org.springframework.orm.jpa.JpaTransactionManager" id="jpaTxManager">
        <property name="entityManagerFactory" ref="entityManagerFactory"/>
    </bean>
    <bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalEntityManagerFactoryBean">
        <property name="persistenceUnitName" value="persistenceUnit"/>
        <property name="dataSource" ref="dataSource"/>
    </bean>
   
    <camelContext id="amq-example-context"
        xmlns="http://camel.apache.org/schema/spring" xmlns:order="http://com.mycompany/examples/order">
        <propertyPlaceholder id="properties" location="ref:parametros.spring"/>
        <routeBuilder ref="javaCamelRoute"/>
    </camelContext>

============================================================
Loading...