blueprint entityManagerFactory usage issue

Latest response

This is my persistence.xml

<?xml version="1.0" encoding="UTF-8"?>

<persistence-unit name="camelJpaContainer" transaction-type="JTA">
    <provider>org.hibernate.ejb.HibernatePersistence</provider>
    <jta-data-source>osgi:service/javax.sql.DataSource/(osgi.jndi.service.name=jdbc/connectDB2)</jta-data-source>
    <non-jta-data-source>osgi:service/javax.sql.DataSource/(osgi.jndi.service.name=jdbc/connectDB2)</non-jta-data-source>
    <class>com.ibm.as400.access.AS400JDBCDriver</class>
    <exclude-unlisted-classes>true</exclude-unlisted-classes>
    <properties>
        <property name="hibernate.connection.driver_class" value="com.ibm.as400.access.AS400JDBCDriver"/>
        <property name="hibernate.dialect" value="org.hibernate.dialect.DB2400Dialect"/>
        <property name = "hibernate.show_sql" value = "false" />
    </properties>
</persistence-unit>    

this my blueprint part

<reference id="springJtaTxManager" interface="org.springframework.transaction.PlatformTransactionManager"/>
        <reference id="entityManagerFactory" interface="javax.persistence.EntityManagerFactory" />
<bean activation="lazy"
    class="org.apache.camel.component.jpa.JpaComponent" id="jpa">
    <property name="transactionManager" ref="springJtaTxManager"/>
    <property name="joinTransaction" value="true"/>
    <property name="sharedEntityManager" value="false"/>
                <property name="entityManagerFactory" ref="camelJpaContainer" />
</bean>

the entitManagerFactory I have tried ref and value nothing . issue is that it cannot find camelJpaContainer ref/id and all is done pom xml and persisitence reference etc.

So either the blueprint entry or persistence issue? its something simple or something additional??

Appreciate some guidance in this as cannot find any solution. had this working in fuse 6.3 but not able in the jfuse 7.6.

Responses

After some rework on blueprint I finally got some realistic issue, the jt400 is seen in bundle and it shows that the application is referring to it yet it gets this issue, I have no idea what else I need to do, some help or direction greatly appreciated

Cannot load JDBC driver class 'com.ibm.as400.access.AS400JDBCDriver' java.lang.ClassNotFoundException: com.ibm.as400.access.AS400JDBCDriver not found by org.apache.karaf.management.server [141] at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1639) at org.apache.felix.framework.BundleWiringImpl.access$200(BundleWiringImpl.java:80) at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:2053) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) at org.apache.commons.dbcp.BasicDataSource.createConnectionFactory(BasicDataSource.java:1422) at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1373) at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1046) at org.hibernate.engine.jdbc.connections.internal.DatasourceConnectionProviderImpl.getConnection(DatasourceConnectionProviderImpl.java:122) at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator$ConnectionProviderJdbcConnectionAccess.obtainConnection(JdbcEnvironmentInitiator.java:180) at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.initiateService(JdbcEnvironmentInitiator.java:68) at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.initiateService(JdbcEnvironmentInitiator.java:35) at org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.initiateService(StandardServiceRegistryImpl.java:94) at org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:263) at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:237) at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:214) at org.hibernate.id.factory.internal.DefaultIdentifierGeneratorFactory.injectServices(DefaultIdentifierGeneratorFactory.java:152) at org.hibernate.service.internal.AbstractServiceRegistryImpl.injectDependencies(AbstractServiceRegistryImpl.java:286) at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:243) at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:214) at org.hibernate.boot.internal.InFlightMetadataCollectorImpl.(InFlightMetadataCollectorImpl.java:179) at org.hibernate.boot.model.process.spi.MetadataBuildingProcess.complete(MetadataBuildingProcess.java:119) at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.metadata(EntityManagerFactoryBuilderImpl.java:904) at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:935) at org.hibernate.osgi.OsgiPersistenceProvider.createContainerEntityManagerFactory(OsgiPersistenceProvider.java:96) at org.apache.aries.jpa.container.impl.AriesEntityManagerFactoryBuilder.createAndPublishEMF(AriesEntityManagerFactoryBuilder.java:371) at org.apache.aries.jpa.container.impl.AriesEntityManagerFactoryBuilder.createEntityManagerFactory(AriesEntityManagerFactoryBuilder.java:183) at org.apache.aries.jpa.container.impl.AriesEntityManagerFactoryBuilder.dataSourceReady(AriesEntityManagerFactoryBuilder.java:538) at org.apache.aries.jpa.container.impl.AriesEntityManagerFactoryBuilder.foundDS(AriesEntityManagerFactoryBuilder.java:510) at org.apache.aries.jpa.container.impl.DataSourceTracker.addingService(DataSourceTracker.java:86) at org.apache.aries.jpa.container.impl.DataSourceTracker.addingService(DataSourceTracker.java:34) at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:941) at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:870) at org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:256) at org.osgi.util.tracker.AbstractTracked.track(AbstractTracked.java:229) at org.osgi.util.tracker.ServiceTracker$Tracked.serviceChanged(ServiceTracker.java:901) at org.apache.felix.framework.EventDispatcher.invokeServiceListenerCallback(EventDispatcher.java:990) at org.apache.felix.framework.EventDispatcher.fireEventImmediately(EventDispatcher.java:838) at org.apache.felix.framework.EventDispatcher.fireServiceEvent(EventDispatcher.java:545) at org.apache.felix.framework.Felix.fireServiceEvent(Felix.java:4595) at org.apache.felix.framework.Felix.registerService(Felix.java:3587) at org.apache.felix.framework.BundleContextImpl.registerService(BundleContextImpl.java:348) at org.apache.aries.blueprint.container.BlueprintContainerImpl.registerService(BlueprintContainerImpl.java:496) at org.apache.aries.blueprint.container.ServiceRecipe.register(ServiceRecipe.java:193) at org.apache.aries.blueprint.container.BlueprintContainerImpl.registerServices(BlueprintContainerImpl.java:759) at org.apache.aries.blueprint.container.BlueprintContainerImpl.doRun(BlueprintContainerImpl.java:435) at org.apache.aries.blueprint.container.BlueprintContainerImpl.run(BlueprintContainerImpl.java:298) at org.apache.aries.blueprint.container.BlueprintExtender.createContainer(BlueprintExtender.java:311) at org.apache.aries.blueprint.container.BlueprintExtender.createContainer(BlueprintExtender.java:280) at org.apache.aries.blueprint.container.BlueprintExtender.createContainer(BlueprintExtender.java:276) at org.apache.aries.blueprint.container.BlueprintExtender.modifiedBundle(BlueprintExtender.java:266) at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$Tracked.customizerModified(BundleHookBundleTracker.java:500) at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$Tracked.customizerModified(BundleHookBundleTracker.java:433) at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$AbstractTracked.track(BundleHookBundleTracker.java:725) at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$Tracked.bundleChanged(BundleHookBundleTracker.java:463) at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$BundleEventHook.event(BundleHookBundleTracker.java:422) at org.apache.felix.framework.util.SecureAction.invokeBundleEventHook(SecureAction.java:1179) at org.apache.felix.framework.EventDispatcher.createWhitelistFromHooks(EventDispatcher.java:730) at org.apache.felix.framework.EventDispatcher.fireBundleEvent(EventDispatcher.java:485) at org.apache.felix.framework.Felix.fireBundleEvent(Felix.java:4579) at org.apache.felix.framework.Felix.startBundle(Felix.java:2174) at org.apache.felix.framework.Felix.updateBundle(Felix.java:2510) at org.apache.felix.framework.BundleImpl.update(BundleImpl.java:1018) at org.apache.karaf.bundle.core.internal.BundlesMBeanImpl.update(BundlesMBeanImpl.java:172) at org.apache.karaf.bundle.core.internal.BundlesMBeanImpl.update(BundlesMBeanImpl.java:153) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:71) at sun.reflect.GeneratedMethodAccessor20.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:275) at com.sun.jmx.mbeanserver.StandardMBeanIntrospector.invokeM2(StandardMBeanIntrospector.java:112) at com.sun.jmx.mbeanserver.StandardMBeanIntrospector.invokeM2(StandardMBeanIntrospector.java:46) at com.sun.jmx.mbeanserver.MBeanIntrospector.invokeM(MBeanIntrospector.java:237) at com.sun.jmx.mbeanserver.PerInterface.invoke(PerInterface.java:138) at com.sun.jmx.mbeanserver.MBeanSupport.invoke(MBeanSupport.java:252) at javax.management.StandardMBean.invoke(StandardMBean.java:405) at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819) at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)