|
|
Re: Virgo, Spring & DataNucleus [message #727128 is a reply to message #727072] |
Tue, 20 September 2011 13:22 |
|
Ok, so DataNucleus has a property that tells it to use OSGi to locate any DataNucleus plugins: "datanucleus.plugin.pluginRegistryClassName". I set its value to "org.datanucleus.plugin.OSGiPluginRegistry" (as documented) and this causes DataNucleus to execute the following line:
BundleContext ctx = FrameworkUtil.getBundle(this.getClass()).getBundleContext();
When I run in Virgo with this configuration, I get the following error, which surprised me. I expected a framework class like org.osgi.framework.FrameworkUtil to be available without any special magic. What do I have to do to get the class FrameworkUtil to be found?
[2011-09-19 14:58:16.010] start-signalling-1 <DE0006E> Start failed for plan 'web-demo.plan' version '1.0.0.SNAPSHOT'. org.springframework.beans.factory.BeanCreationException: Error cre
ating bean with name 'dnEmf' defined in URL [bundleentry://138.fwk881373670/META-INF/spring/context.xml]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: org
/osgi/framework/FrameworkUtil
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1420)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:563)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.access$1600(AbstractDelegatedExecutionApplicationContext.java:69)
at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$4.run(AbstractDelegatedExecutionApplicationContext.java:355)
at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)
at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.completeRefresh(AbstractDelegatedExecutionApplicationContext.java:320)
at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$CompleteRefreshTask.run(DependencyWaiterApplicationContextExecutor.java:132)
at org.eclipse.virgo.kernel.agent.dm.ContextPropagatingTaskExecutor$2.run(ContextPropagatingTaskExecutor.java:95)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.NoClassDefFoundError: org/osgi/framework/FrameworkUtil
at org.datanucleus.plugin.OSGiPluginRegistry.registerExtensions(OSGiPluginRegistry.java:103)
at org.datanucleus.plugin.OSGiPluginRegistry.registerExtensionPoints(OSGiPluginRegistry.java:92)
at org.datanucleus.plugin.PluginManager.<init>(PluginManager.java:62)
at org.datanucleus.NucleusContext.<init>(NucleusContext.java:211)
at org.datanucleus.NucleusContext.<init>(NucleusContext.java:166)
at org.datanucleus.api.jpa.JPAEntityManagerFactory.initialiseNucleusContext(JPAEntityManagerFactory.java:716)
at org.datanucleus.api.jpa.JPAEntityManagerFactory.<init>(JPAEntityManagerFactory.java:279)
at org.datanucleus.api.jpa.PersistenceProviderImpl.createContainerEntityManagerFactory(PersistenceProviderImpl.java:61)
at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:225)
at com.ea.nucleus.nextgen.webdemo.db.jpa.datanucleus.DataNucleusOsgiLocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(DataNucleusOsgiLocalContainerEntityManagerFacto
ryBean.java:39)
at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:308)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1477)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1417)
... 17 common frames omitted
Caused by: org.eclipse.virgo.kernel.osgi.framework.ExtendedClassNotFoundException: org.osgi.framework.FrameworkUtil in KernelBundleClassLoader: [bundle=org.datanucleus_3.0.2]
at org.eclipse.virgo.kernel.userregion.internal.equinox.KernelBundleClassLoader.loadClass(KernelBundleClassLoader.java:138)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
... 30 common frames omitted
Caused by: java.lang.ClassNotFoundException: org.osgi.framework.FrameworkUtil
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:513)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
at org.eclipse.virgo.kernel.userregion.internal.equinox.KernelBundleClassLoader.loadClass(KernelBundleClassLoader.java:134)
... 31 common frames omitted
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.05475 seconds