title: ServiceMix / JPA Integration - LocalContainerEntityManagerFactoryBean to type EntityManagerFactory
body: <p>I'm fairly new to ServiceMix / JPA / Camel / Spring.  I'm attempting to use the camel-jpa component as part of my camel route.  I'm using the latest release of ServiceMix, which is 4.5.1.  This uses camel 2.10.4 and spring 3.0.7.</p>
  
  <p>After updating the OSGi manifest and deploying some additional modules to servicemix, I am stuck on the following stack trace:</p>
  
  <pre><code>org.osgi.service.blueprint.container.ComponentDefinitionException: Error setting property: PropertyDescriptor &lt;name: entityManagerFactory, getter: class org.springframework.orm.jpa.JpaTransactionManager.getEntityManagerFactory(, setter: [class org.springframework.orm.jpa.JpaTransactionManager.setEntityManagerFactory(interface javax.persistence.EntityManagerFactory]
  [...]
  Caused by: java.lang.Exception: Unable to convert value org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean@46e9e26a to type javax.persistence.EntityManagerFactory
  at org.apache.aries.blueprint.container.AggregateConverter.convert(AggregateConverter.java:172)[10:org.apache.aries.blueprint:0.3.2]
  at org.apache.aries.blueprint.container.BlueprintRepository.convert(BlueprintRepository.java:373)[10:org.apache.aries.blueprint:0.3.2]
  at org.apache.aries.blueprint.utils.ReflectionUtils$PropertyDescriptor.convert(ReflectionUtils.java:322)[10:org.apache.aries.blueprint:0.3.2]
  at org.apache.aries.blueprint.utils.ReflectionUtils$MethodPropertyDescriptor.internalSet(ReflectionUtils.java:555)[10:org.apache.aries.blueprint:0.3.2]
  at org.apache.aries.blueprint.utils.ReflectionUtils$PropertyDescriptor.set(ReflectionUtils.java:306)[10:org.apache.aries.blueprint:0.3.2]
  at org.apache.aries.blueprint.container.BeanRecipe.setProperty(BeanRecipe.java:819)[10:org.apache.aries.blueprint:0.3.2]
  </code></pre>
  
  <p>I've played around with my persistence.xml, camel-context.xml (blueprint/spring xml) and have not been able to make much progress.  My current configuration is:</p>
  
  <p>camel-context.xml</p>
  
  <pre><code>&lt;bean id="mysqlDataSource" class="org.apache.commons.dbcp.BasicDataSource"&gt;
      &lt;property name="driverClassName"        value="com.mysql.jdbc.Driver"/&gt;
      &lt;property name="url"                    value="jdbc:mysql://localhost/prototype"/&gt;
      &lt;property name="username"               value="...."/&gt;
      &lt;property name="password"               value="...."/&gt;
  &lt;/bean&gt;
  
  &lt;bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"&gt;
      &lt;property name="dataSource"             ref="mysqlDataSource"/&gt;
      &lt;property name="persistenceUnitName"    value="customer1"/&gt;
      &lt;property name="loadTimeWeaver"&gt;
          &lt;bean class="org.springframework.instrument.classloading.SimpleLoadTimeWeaver" /&gt;
      &lt;/property&gt;
      &lt;property name="jpaVendorAdapter"&gt;
          &lt;bean class="org.springframework.orm.jpa.vendor.OpenJpaVendorAdapter"&gt;
              &lt;property name="databasePlatform"   value="org.apache.openjpa.jdbc.sql.MySQLDictionary" /&gt;
              &lt;property name="showSql"            value="true"/&gt;
          &lt;/bean&gt;
      &lt;/property&gt;
  &lt;/bean&gt;
  
  &lt;bean id="jpaTxManager" class="org.springframework.orm.jpa.JpaTransactionManager"&gt;
      &lt;property name="entityManagerFactory"   ref="entityManagerFactory"/&gt;
  &lt;/bean&gt;
  
  &lt;bean id="jpa" class="org.apache.camel.component.jpa.JpaComponent"&gt;
      &lt;property name="entityManagerFactory"   ref="entityManagerFactory"/&gt;
      &lt;property name="transactionManager"     ref="jpaTxManager"/&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>persistence.xml</p>
  
  <pre><code>&lt;persistence xmlns="http://java.sun.com/xml/ns/persistence"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
           version="2.0"&gt;
  &lt;persistence-unit name="customer1" transaction-type="RESOURCE_LOCAL"&gt;
      &lt;provider&gt;org.apache.openjpa.persistence.PersistenceProviderImpl&lt;/provider&gt;
      &lt;class&gt;....&lt;/class&gt;
  &lt;/persistence-unit&gt;
  </code></pre>
  
  <p></p>
  
  <p>Any help would be appreciated.  I've been spinning on this problem for a couple days now.</p>