Hi..
I have an application with ServiceMix 3.2 and Camel component.
Well, I want to use the JPA Component in camel to store Exchange in a
persistent database. But i have a problem when I install the application in
ServiceMix. 

in Camel-context.xml
[..]
  <bean id="transactionTemplate"
class="org.springframework.transaction.support.TransactionTemplate">
    <property name="transactionManager">
      <bean class="org.springframework.orm.jpa.JpaTransactionManager">
        <property name="entityManagerFactory" ref="entityManagerFactory"/>
      </bean>
    </property>
  </bean>

  <bean id="jpaTemplate" class="org.springframework.orm.jpa.JpaTemplate">
    <property name="entityManagerFactory" ref="entityManagerFactory"/>
  </bean>

  <bean id="entityManagerFactory"
class="org.springframework.orm.jpa.LocalEntityManagerFactoryBean">
    <property name="persistenceUnitName" value="camel"/>
  </bean>
  
my Persistence.xml

<persistence xmlns=".." xmlns:xsi=".." version="1.0">

  <persistence-unit name="camel" transaction-type="RESOURCE_LOCAL">

    <properties>
      <property name="hibernate.dialect"
value="org.hibernate.dialect.HSQLDialect"/>
      <property name="hibernate.connection.driver_class"
value="org.hsqldb.jdbcDriver"/>
      <property name="hibernate.connection.username" value="sa"/>
      <property name="hibernate.connection.password" value=""/>
      <property name="hibernate.connection.url"
value="jdbc:hsqldb:mem:camel_etl"/>
      <property name="hibernate.hbm2ddl.auto" value="create"/>
    </properties>

  </persistence-unit>
</persistence>

the error is "Invocation of init method failed; nested exception is
javax.persistence.PersistenceException: No Persistence provider for
EntityManager named camel"

I think that it is a problem of the position of file persistence.xml. My
service activator has the follow structure

test-su.zip
|--test-camel-su.zip
   |---camel-context.xml
   |---persistence.xml
   |---META-INF
       |--jbi.xml       
|--META-INF
   |--- jbi.xml
-- 
View this message in context: 
http://www.nabble.com/Using-JPA-in-ServiceMix-%2B-Camel-tf4811001s22882.html#a13765083
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to