Hi All,
I am facing issue with EntityManager being null when I access it from my
Java Code.
Below is my camel-context in which I am defining Entity MAnager.
<bean id="entityManagerFactory"
class="org.springframework.orm.jpa.LocalEntityManagerFactoryBean">
<property name="persistenceUnitName" value="com.baselogic.jpa"
/>
<property name="jpaVendorAdapter" ref="jpaAdapter" />
<property name="jpaProperties">
<props>
<prop
key="openjpa.ConnectionURL">jdbc:sqlserver://10.10.10.11:1433;databaseName=XYZ;instanceName=SQLEXPRESS;</prop>
<prop
key="openjpa.jdbc.DBDictionary">org.apache.openjpa.jdbc.sql.SQLServerDictionary</prop>
<prop
key="openjpa.ConnectionDriverName">com.microsoft.sqlserver.jdbc.SQLServerDriver</prop>
<prop key="openjpa.ConnectionUserName">user1</prop>
<prop key="openjpa.ConnectionPassword">pass123</prop>
<prop key="openjpa.Log">Enhance=TRACE,SQL=TRACE</prop>
<prop key="openjpa.jdbc.SynchronizeMappings">true</prop>
</props>
</property>
</bean>
When I am persisting data using camel route its working perfectly fine, but
when I am trying to access Entity manager through code its null.
@PersistenceContext(unitName = "com.baselogic.jpa")
private EntityManager entityManager;
Can anybody tell me if I am missing anything ?
Thanks,
Abhi
--
View this message in context:
http://camel.465427.n5.nabble.com/Entity-Manager-is-null-tp5735076.html
Sent from the Camel - Users mailing list archive at Nabble.com.