0

Fuse Fabric 6.1.0-redhat-379 を使用しています。Spring ベースのアプリケーションを blueprint osgi アプリケーションに移行します。以前は、db にアクセスするために hibernate で spring orm を使用していました。spring orm (service mix bundles) を blueprint container に移植してみました。現在、マッピング リソース ファイル内に存在するエンティティ オブジェクトが hibernate-core バンドルに見つからないというエラーに直面しています。しかし、私のアプリケーションバンドルにも同じものがあります。

<bean id="sessionFactoryBean"
    class="org.springframework.orm.hibernate4.LocalSessionFactoryBean"
    activation="eager" init-method="afterPropertiesSet">
    <property name="dataSource" ref="dataSourceRef" />
    <property name="mappingLocations">
        <list>
            <bean class="com.base.support.io.BundleResource">
                <argument index="0" type="java.lang.String" value="com/reference/vo/hbm/Reference.hbm.xml" />
                <argument index="1" type="org.osgi.framework.BundleContext" ref="blueprintBundleContext"/>
            </bean>
        </list>
    </property>
    <property name="hibernateProperties">
        <props>
            <prop key="hibernate.show_sql">${showSql}</prop>
            <prop key="hibernate.dialect">${dialect}</prop>
            <prop key="hibernate.cache.provider_class">net.sf.ehcache.hibernate.EhCacheProvider</prop>
            <prop key="hibernate.generate_statistics">false</prop>
            <prop key="hibernate.bytecode.use_reflection_optimizer">true</prop>             
        </props>
    </property>
</bean>
t.core - 1.0.1.redhat-610379 | バンドル共通のブループリント コンテナーを開始できません
org.osgi.service.blueprint.container.ComponentDefinitionException: Bean sessionFactoryBean を初期化できません
        org.apache.aries.blueprint.container.BeanRecipe.runBeanProcInit (BeanRecipe.java:714) [9:org.apache.aries.blueprint.core:1.0.1.redhat-610379] で
        org.apache.aries.blueprint.container.BeanRecipe.internalCreate2 (BeanRecipe.java:824) [9:org.apache.aries.blueprint.core:1.0.1.redhat-610379] で
        org.apache.aries.blueprint.container.BeanRecipe.internalCreate (BeanRecipe.java:787) [9:org.apache.aries.blueprint.core:1.0.1.redhat-610379] で
        org.apache.aries.blueprint.di.AbstractRecipe$1.call(AbstractRecipe.java:79)[9:org.apache.aries.blueprint.core:1.0.1.redhat-610379] で
        java.util.concurrent.FutureTask.run(FutureTask.java:262)[:1.7.0_75]で
        org.apache.aries.blueprint.di.AbstractRecipe.create (AbstractRecipe.java:88) [9:org.apache.aries.blueprint.core:1.0.1.redhat-610379] で
        org.apache.aries.blueprint.container.BlueprintRepository.createInstances (BlueprintRepository.java:245) [9:org.apache.aries.blueprint.core:1.0.1.redhat-610379] で
        org.apache.aries.blueprint.container.BlueprintRepository.createAll (BlueprintRepository.java:183) [9:org.apache.aries.blueprint.core:1.0.1.redhat-610379] で
        org.apache.aries.blueprint.container.BlueprintContainerImpl.instantiateEagerComponents (BlueprintContainerImpl.java:676) [9:org.apache.aries.blueprint.core:1.0.1.redhat-610379] で
        org.apache.aries.blueprint.container.BlueprintContainerImpl.doRun (BlueprintContainerImpl.java:374) [9:org.apache.aries.blueprint.core:1.0.1.redhat-610379] で
        org.apache.aries.blueprint.container.BlueprintContainerImpl.run (BlueprintContainerImpl.java:261) [9:org.apache.aries.blueprint.core:1.0.1.redhat-610379] で
        org.apache.aries.blueprint.container.BlueprintExtender.createContainer (BlueprintExtender.java:270) [9:org.apache.aries.blueprint.core:1.0.1.redhat-610379] で
        org.apache.aries.blueprint.container.BlueprintExtender.modifiedBundle (BlueprintExtender.java:233) [9:org.apache.aries.blueprint.core:1.0.1.redhat-610379] で
        org.apache.aries.util.tracker.hook.BundleHookBundleTracker$Tracked.customizerModified (BundleHookBundleTracker.java:500) [11:org.apache.aries.util:1.0.1.redhat-610379] で
        org.apache.aries.util.tracker.hook.BundleHookBundleTracker$Tracked.customizerModified(BundleHookBundleTracker.java:433)[11:org.apache.aries.util:1.0.1.redhat-610379] で
        org.apache.aries.util.tracker.hook.BundleHookBundleTracker$AbstractTracked.track(BundleHookBundleTracker.java:725)[11:org.apache.aries.util:1.0.1.redhat-610379] で
        org.apache.aries.util.tracker.hook.BundleHookBundleTracker$Tracked.bundleChanged (BundleHookBundleTracker.java:463) [11:org.apache.aries.util:1.0.1.redhat-610379] で
        org.apache.aries.util.tracker.hook.BundleHookBundleTracker$BundleEventHook.event(BundleHookBundleTracker.java:422)[11:org.apache.aries.util:1.0.1.redhat-610379] で
        org.apache.felix.framework.util.SecureAction.invokeBundleEventHook (SecureAction.java:1103) [org.apache.felix.framework-4.0.3.redhat-610379.jar:] で
        org.apache.felix.framework.util.EventDispatcher.createWhitelistFromHooks (EventDispatcher.java:696) [org.apache.felix.framework-4.0.3.redhat-610379.jar:] で
        org.apache.felix.framework.util.EventDispatcher.fireBundleEvent(EventDispatcher.java:484)[org.apache.felix.framework-4.0.3.redhat-610379.jar:] で
        org.apache.felix.framework.Felix.fireBundleEvent (Felix.java:4650) [org.apache.felix.framework-4.0.3.redhat-610379.jar:] で
        org.apache.felix.framework.Felix$4.run(Felix.java:2123)[org.apache.felix.framework-4.0.3.redhat-610379.jar:]で
        org.apache.felix.framework.Felix.runInContext (Felix.java:2147) [org.apache.felix.framework-4.0.3.redhat-610379.jar:] で
        org.apache.felix.framework.Felix.startBundle(Felix.java:2121)[org.apache.felix.framework-4.0.3.redhat-610379.jar:]で
        org.apache.felix.framework.BundleImpl.start(BundleImpl.java:955)[org.apache.felix.framework-4.0.3.redhat-610379.jar:]で
        org.apache.felix.framework.BundleImpl.start(BundleImpl.java:942)[org.apache.felix.framework-4.0.3.redhat-610379.jar:]で
        io.fabric8.agent.DeploymentAgent.install (DeploymentAgent.java:743) [60:io.fabric8.fabric-agent:1.0.0.redhat-379] で
        io.fabric8.agent.DeploymentAgent.doUpdate (DeploymentAgent.java:525) [60:io.fabric8.fabric-agent:1.0.0.redhat-379] で
        io.fabric8.agent.DeploymentAgent$2.run(DeploymentAgent.java:252)[60:io.fabric8.fabric-agent:1.0.0.redhat-379] で
        java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)[:1.7.0_75] で
        java.util.concurrent.FutureTask.run(FutureTask.java:262)[:1.7.0_75]で
        java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)[:1.7.0_75] で
        java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)[:1.7.0_75] で
        java.lang.Thread.run(Thread.java:745)[:1.7.0_75]で
原因: org.hibernate.MappingException: エンティティ クラスが見つかりません: com.common.reference.vo.ReferenceVO
        org.hibernate.mapping.PersistentClass.getMappedClass (PersistentClass.java:138) で
        org.hibernate.tuple.PropertyFactory.getGetter (PropertyFactory.java:497) で
        org.hibernate.tuple.PropertyFactory.buildIdentifierAttribute (PropertyFactory.java:87) で
        org.hibernate.tuple.entity.EntityMetamodel.(EntityMetamodel.java:163) で
        org.hibernate.persister.entity.AbstractEntityPersister.(AbstractEntityPersister.java:520) で
        org.hibernate.persister.entity.SingleTableEntityPersister.(SingleTableEntityPersister.java:148) で
        sun.reflect.NativeConstructorAccessorImpl.newInstance0(ネイティブメソッド)[:1.7.0_75]
        sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)[:1.7.0_75] で
        sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)[:1.7.0_75]
        java.lang.reflect.Constructor.newInstance(Constructor.java:526)[:1.7.0_75] で
        org.hibernate.persister.internal.PersisterFactoryImpl.create (PersisterFactoryImpl.java:163) で
        org.hibernate.persister.internal.PersisterFactoryImpl.createEntityPersister (PersisterFactoryImpl.java:135) で
        org.hibernate.internal.SessionFactoryImpl.(SessionFactoryImpl.java:401) で
        org.hibernate.cfg.Configuration.buildSessionFactory (Configuration.java:1857) で
        org.hibernate.cfg.Configuration.buildSessionFactory (Configuration.java:1928) で
        org.springframework.orm.hibernate4.LocalSessionFactoryBuilder.buildSessionFactory(LocalSessionFactoryBuilder.java:252) で
        org.springframework.orm.hibernate4.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:377) で
        org.springframework.orm.hibernate4.LocalSessionFactoryBean.afterPropertiesSet(LocalSessionFactoryBean.java:362) で
        sun.reflect.NativeMethodAccessorImpl.invoke0(ネイティブメソッド)[:1.7.0_75]
        sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)[:1.7.0_75] で
        sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:1.7.0_75]
        java.lang.reflect.Method.invoke(Method.java:606)[:1.7.0_75]
        org.apache.aries.blueprint.utils.ReflectionUtils.invoke(ReflectionUtils.java:297)[9:org.apache.aries.blueprint.core:1.0.1.redhat-610379] で
        org.apache.aries.blueprint.container.BeanRecipe.invoke (BeanRecipe.java:958) [9:org.apache.aries.blueprint.core:1.0.1.redhat-610379] で
        org.apache.aries.blueprint.container.BeanRecipe.runBeanProcInit (BeanRecipe.java:712) [9:org.apache.aries.blueprint.core:1.0.1.redhat-610379] で
        ... 34 以上
原因: java.lang.ClassNotFoundException: com.common.reference.vo.ReferenceVO が org.hibernate.core によって見つからない [1161]
        org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation (BundleWiringImpl.java:1532) で
        org.apache.felix.framework.BundleWiringImpl.access$400 (BundleWiringImpl.java:75) で
        org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass (BundleWiringImpl.java:1955) で
        java.lang.ClassLoader.loadClass(ClassLoader.java:358)[:1.7.0_75] で
        at java.lang.Class.forName0(Native Method)[:1.7.0_75]
        java.lang.Class.forName(Class.java:191)[:1.7.0_75]
        org.hibernate.internal.util.ReflectHelper.classForName (ReflectHelper.java:193) で
        org.hibernate.mapping.PersistentClass.getMappedClass (PersistentClass.java:133) で
        ... 58以上
2015-02-17 18:11:52,704 | 情報 | エージェント-1-スレッド-1 | 展開エージェント | io.fabric8.agent.DeploymentAgent 741 | 60 - io.fabric8.fabric-agent - 1.0.0.redhat-379 | org.hibernate.osgi / 4.3.6.Final
2015-02-17 18:11:52,713 | 情報 | エージェント-1-スレッド-1 | 展開エージェント | io.fabric8.agent.DeploymentAgent 753 | 60 - io.fabric8.fabric-agent - 1.0.0.redhat-379 | 終わり。

4

2 に答える 2

0

これは、選択した hibernate のバージョンに応じて適切な JPA バージョンの Fuse 6.2 で動作します。

于 2015-12-09T02:52:54.560 に答える