Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Virgo » Virgo, Spring & DataNucleus
icon9.gif  Virgo, Spring & DataNucleus [message #726857] Mon, 19 September 2011 18:06 Go to next message
Matthew T. Adams is currently offline Matthew T. AdamsFriend
Messages: 58
Registered: July 2009
Location: Austin, TX
Member

Hi all,

Since some of you might know where to point me, I thought I'd crosspost here with a pointer to my question about configuring DataNucleus 3.0.2-SNAPSHOT in Virgo 3.0.1 with Spring 3.0.5.RELEASE.

Please see http://www.datanucleus.org/servlet/forum/viewthread_thread,6863 for my post and respond there if you can think of anything I should try.

Thanks,
Matthew
Re: Virgo, Spring & DataNucleus [message #727072 is a reply to message #726857] Tue, 20 September 2011 11:00 Go to previous messageGo to next message
Jochen Szostek is currently offline Jochen SzostekFriend
Messages: 24
Registered: January 2011
Location: Maasmechelen
Junior Member

If the problem is JPA related...there's a JPA + hibernate example of the greenpages sample at github: https://github.com/dsklyut/virgo-samples-greenpages

Maybe that could help in resolving the issue somehow...

Good luck! Smile

ps: if you'd be able to make it work, I'd be happy to hear as I've been struggling quite a lot with Hibernate+JPA...
Re: Virgo, Spring & DataNucleus [message #727128 is a reply to message #727072] Tue, 20 September 2011 13:22 Go to previous messageGo to next message
Matthew T. Adams is currently offline Matthew T. AdamsFriend
Messages: 58
Registered: July 2009
Location: Austin, TX
Member

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
Re: Virgo, Spring & DataNucleus [message #727288 is a reply to message #727128] Tue, 20 September 2011 19:36 Go to previous messageGo to next message
Dmitry Sklyut is currently offline Dmitry SklyutFriend
Messages: 279
Registered: January 2010
Senior Member
You still need to import org.osgi.framework. Only classes that are visible by default are in [java.*] namespace. Other than that there are some configuration options you can turn to allow for bypassing of osgi classloading structure (i.e. delegation to boot classloader for example)
Re: Virgo, Spring & DataNucleus [message #727627 is a reply to message #727288] Wed, 21 September 2011 17:26 Go to previous message
Matthew T. Adams is currently offline Matthew T. AdamsFriend
Messages: 58
Registered: July 2009
Location: Austin, TX
Member

Right. Got that yesterday & forgot to update thread.
Previous Topic:Problem deploying a plan that contains an already active bundle
Next Topic:Why is my plan being stopped?
Goto Forum:
  


Current Time: Tue Apr 23 07:45:03 GMT 2024

Powered by FUDForum. Page generated in 0.02791 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top