Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Virgo » From OSGi to Blueprints & Virgo?(Changes to the bundles when working with Virgo)
icon10.gif  From OSGi to Blueprints & Virgo? [message #1729584] Fri, 15 April 2016 16:16 Go to next message
Bill Mair is currently offline Bill MairFriend
Messages: 72
Registered: July 2009
Member
EDIT:
--

Now that I know wow to change the project file AND with the updated tools integration, everything is now working as expected.

Thanks to GianMaria Romanato for his help.

--

I've been doing "pure" OSGi (using equinox as implementation) and the services and applications are getting more complex and the management of the "server" configurations is becoming more complex too.

So after looking at virgo and blueprints, I thought that this might solve quite a few of the configuration issues.

So I've got the virgo tools in my eclipse installation and I have my 1st "Virgo Runtime" configured and running.

I was hoping that my existing OSGi bundles could be used as they are, with new applications using wiring defined in blueprints.

Now having looked at it in more depth, am I correct when I think that I have to define imports and exports (required bundles, packages, etc.) in the MANIFEST.MF and OSGI-INF/blueprint/somefile.xml ?

I'm not sure that I want to be defining everything twice.

I hope that I am barking up the wrong tree and that I have missed something in how I am using "Add and Remove ..." bundles to the server.

[Updated on: Wed, 20 April 2016 15:30]

Report message to a moderator

Re: From OSGi to Blueprints & Virgo? [message #1729612 is a reply to message #1729584] Sat, 16 April 2016 00:30 Go to previous messageGo to next message
Bill Mair is currently offline Bill MairFriend
Messages: 72
Registered: July 2009
Member
I am at a complete and utter loss as to how to use virgo and the associated tooling.

I created a simple inteface bundle called "test.iface" and an implementation called "test.iface.impl" the simply implements the test interface.

In the IDE it all works fine, compiles fine and does exactly as I expect.

Bundle "test.iface" (create PDE bundle -> OSGi standard)

Manifest: META-INF/MANIFEST.MF:
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Iface
Bundle-SymbolicName: test.iface
Bundle-Version: 1.0.0
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Export-Package: test.iface


Source: test/iface/TestIface:
package test.iface;

public interface TestIface {
	String getName();
}



Bundle "test.iface.impl" (create PDE bundle -> OSGi standard)

Manifest: META-INF/MANIFEST.MF:
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Impl
Bundle-SymbolicName: test.iface.impl
Bundle-Version: 1.0.0
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Require-Bundle: test.iface;bundle-version="1.0.0"


Source: test/iface/impl/TestIfaceImpl.java
package test.iface.impl;

import test.iface.TestIface;

public class TestIfaceImpl implements TestIface {
	@Override
	public String getName() {
		return toString();
	}
}


Blueprint: OSGI-INF/blueprint/test.iface.impl.TestIfaceImpl.xml
<?xml version="1.0" encoding="UTF-8"?>
<blueprint
  xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
  <bean id="ifaceImpl" class="test.iface.impl.TestIfaceImpl"/>
</blueprint>


Both projects are marked by adding "Virgo -> Add OSGi Bundle Project Nature"

So there is nothing spectacular about these 2 bundles and I think they are about as simple as it gets but it fails horribly when deploying to the server:

[2016-04-16 02:16:44.025]  TCP Connection(2)-127.0.0.1 <DE0000I> Installing bundle 'test.iface' version '0.0.0'. 
[2016-04-16 02:16:44.035]  TCP Connection(2)-127.0.0.1 <DE0001I> Installed bundle 'test.iface' version '0.0.0'. 
[2016-04-16 02:16:44.039]  TCP Connection(2)-127.0.0.1 <DE0004I> Starting bundle 'test.iface' version '0.0.0'. 
[2016-04-16 02:16:44.047] start-signalling-1           <DE0005I> Started bundle 'test.iface' version '0.0.0'. 
[2016-04-16 02:16:44.213]  TCP Connection(2)-127.0.0.1 <DE0000I> Installing bundle 'test.iface.impl' version '0.0.0'. 
[2016-04-16 02:16:44.237]  TCP Connection(2)-127.0.0.1 <DE0001I> Installed bundle 'test.iface.impl' version '0.0.0'. 
[2016-04-16 02:16:44.244]  TCP Connection(2)-127.0.0.1 <DE0004I> Starting bundle 'test.iface.impl' version '0.0.0'. 
[2016-04-16 02:16:44.404] start-signalling-1           <DE0005I> Started bundle 'org.eclipse.virgo.apps.repository-3.6.4.RELEASE-org.eclipse.virgo.apps.repository.core' version '3.6.4.RELEASE'. 
[2016-04-16 02:16:44.500] start-signalling-1           <DE0006E> Start failed for bundle 'test.iface.impl' version '0.0.0'. org.springframework.beans.factory.CannotLoadBeanClassException: Error loading class [test.iface.impl.TestIfaceImpl] for bean with name 'ifaceImpl' defined in OSGi resource[bundleentry://143.fwk1225373914/OSGI-INF/blueprint/test.iface.impl.TestIfaceImpl.xml|bnd.id=143|bnd.sym=test.iface.impl]: problem with class file or dependent class; nested exception is java.lang.NoClassDefFoundError: test.iface.impl.TestIfaceImpl not found from bundle [null (test.iface.impl)]
	at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1265)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:576)
	at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1331)
	at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:897)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:566)
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:913)
	at org.eclipse.gemini.blueprint.context.support.AbstractDelegatedExecutionApplicationContext.access$1600(AbstractDelegatedExecutionApplicationContext.java:60)
	at org.eclipse.gemini.blueprint.context.support.AbstractDelegatedExecutionApplicationContext$4.run(AbstractDelegatedExecutionApplicationContext.java:325)
	at org.eclipse.gemini.blueprint.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)
	at org.eclipse.gemini.blueprint.context.support.AbstractDelegatedExecutionApplicationContext.completeRefresh(AbstractDelegatedExecutionApplicationContext.java:290)
	at org.eclipse.gemini.blueprint.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$CompleteRefreshTask.run(DependencyWaiterApplicationContextExecutor.java:137)
	at org.eclipse.virgo.kernel.agent.dm.ContextPropagatingTaskExecutor$2.run(ContextPropagatingTaskExecutor.java:95)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NoClassDefFoundError: test.iface.impl.TestIfaceImpl not found from bundle [null (test.iface.impl)]
	at org.eclipse.gemini.blueprint.util.BundleDelegatingClassLoader.findClass(BundleDelegatingClassLoader.java:110)
	at org.eclipse.gemini.blueprint.util.BundleDelegatingClassLoader.loadClass(BundleDelegatingClassLoader.java:155)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	at org.springframework.util.ClassUtils.forName(ClassUtils.java:257)
	at org.springframework.beans.factory.support.AbstractBeanDefinition.resolveBeanClass(AbstractBeanDefinition.java:417)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doResolveBeanClass(AbstractBeanFactory.java:1283)
	at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1254)
	... 14 common frames omitted
Caused by: org.eclipse.virgo.kernel.osgi.framework.ExtendedNoClassDefFoundError: test/iface/TestIface in KernelBundleClassLoader: [bundle=test.iface.impl_0.0.0] in KernelBundleClassLoader: [bundle=test.iface.impl_0.0.0]
	at org.eclipse.virgo.kernel.userregion.internal.equinox.KernelBundleClassLoader.loadClass(KernelBundleClassLoader.java:152)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	at org.eclipse.osgi.internal.loader.BundleLoader.loadClass(BundleLoader.java:340)
	at org.eclipse.osgi.framework.internal.core.BundleHost.loadClass(BundleHost.java:229)
	at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadClass(AbstractBundle.java:1212)
	at org.eclipse.gemini.blueprint.util.BundleDelegatingClassLoader.findClass(BundleDelegatingClassLoader.java:97)
	... 20 common frames omitted
Caused by: org.eclipse.virgo.kernel.osgi.framework.ExtendedNoClassDefFoundError: test/iface/TestIface in KernelBundleClassLoader: [bundle=test.iface.impl_0.0.0]
	at org.eclipse.virgo.kernel.userregion.internal.equinox.KernelBundleClassLoader.defineClass(KernelBundleClassLoader.java:255)
	at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.defineClassHoldingLock(ClasspathManager.java:632)
	at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.defineClass(ClasspathManager.java:607)
	at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findClassImpl(ClasspathManager.java:568)
	at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClassImpl(ClasspathManager.java:492)
	at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.java:465)
	at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.java:216)
	at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:395)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:464)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:421)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:412)
	at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
	at org.eclipse.virgo.kernel.userregion.internal.equinox.KernelBundleClassLoader.loadClass(KernelBundleClassLoader.java:146)
	... 25 common frames omitted
Caused by: java.lang.NoClassDefFoundError: test/iface/TestIface
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
	at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.defineClass(DefaultClassLoader.java:188)
	at org.eclipse.virgo.kernel.userregion.internal.equinox.KernelBundleClassLoader.defineClass(KernelBundleClassLoader.java:251)
	... 37 common frames omitted
Caused by: org.eclipse.virgo.kernel.osgi.framework.ExtendedClassNotFoundException: test.iface.TestIface in KernelBundleClassLoader: [bundle=test.iface.impl_0.0.0]
	at org.eclipse.virgo.kernel.userregion.internal.equinox.KernelBundleClassLoader.loadClass(KernelBundleClassLoader.java:150)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	... 41 common frames omitted
Caused by: java.lang.ClassNotFoundException: test.iface.TestIface
	at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:501)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:421)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:412)
	at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
	at org.eclipse.virgo.kernel.userregion.internal.equinox.KernelBundleClassLoader.loadClass(KernelBundleClassLoader.java:146)
	... 42 common frames omitted

[2016-04-16 02:16:44.526] region-dm-1                  <AG0000E> Application context creation failure for bundle 'test.iface.impl' version '0.0.0'. org.springframework.beans.factory.CannotLoadBeanClassException: Error loading class [test.iface.impl.TestIfaceImpl] for bean with name 'ifaceImpl' defined in OSGi resource[bundleentry://143.fwk1225373914/OSGI-INF/blueprint/test.iface.impl.TestIfaceImpl.xml|bnd.id=143|bnd.sym=test.iface.impl]: problem with class file or dependent class; nested exception is java.lang.NoClassDefFoundError: test.iface.impl.TestIfaceImpl not found from bundle [null (test.iface.impl)]
	at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1265)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:576)
	at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1331)
	at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:897)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:566)
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:913)
	at org.eclipse.gemini.blueprint.context.support.AbstractDelegatedExecutionApplicationContext.access$1600(AbstractDelegatedExecutionApplicationContext.java:60)
	at org.eclipse.gemini.blueprint.context.support.AbstractDelegatedExecutionApplicationContext$4.run(AbstractDelegatedExecutionApplicationContext.java:325)
	at org.eclipse.gemini.blueprint.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)
	at org.eclipse.gemini.blueprint.context.support.AbstractDelegatedExecutionApplicationContext.completeRefresh(AbstractDelegatedExecutionApplicationContext.java:290)
	at org.eclipse.gemini.blueprint.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$CompleteRefreshTask.run(DependencyWaiterApplicationContextExecutor.java:137)
	at org.eclipse.virgo.kernel.agent.dm.ContextPropagatingTaskExecutor$2.run(ContextPropagatingTaskExecutor.java:95)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NoClassDefFoundError: test.iface.impl.TestIfaceImpl not found from bundle [null (test.iface.impl)]
	at org.eclipse.gemini.blueprint.util.BundleDelegatingClassLoader.findClass(BundleDelegatingClassLoader.java:110)
	at org.eclipse.gemini.blueprint.util.BundleDelegatingClassLoader.loadClass(BundleDelegatingClassLoader.java:155)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	at org.springframework.util.ClassUtils.forName(ClassUtils.java:257)
	at org.springframework.beans.factory.support.AbstractBeanDefinition.resolveBeanClass(AbstractBeanDefinition.java:417)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doResolveBeanClass(AbstractBeanFactory.java:1283)
	at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1254)
	... 14 common frames omitted
Caused by: org.eclipse.virgo.kernel.osgi.framework.ExtendedNoClassDefFoundError: test/iface/TestIface in KernelBundleClassLoader: [bundle=test.iface.impl_0.0.0] in KernelBundleClassLoader: [bundle=test.iface.impl_0.0.0]
	at org.eclipse.virgo.kernel.userregion.internal.equinox.KernelBundleClassLoader.loadClass(KernelBundleClassLoader.java:152)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	at org.eclipse.osgi.internal.loader.BundleLoader.loadClass(BundleLoader.java:340)
	at org.eclipse.osgi.framework.internal.core.BundleHost.loadClass(BundleHost.java:229)
	at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadClass(AbstractBundle.java:1212)
	at org.eclipse.gemini.blueprint.util.BundleDelegatingClassLoader.findClass(BundleDelegatingClassLoader.java:97)
	... 20 common frames omitted
Caused by: org.eclipse.virgo.kernel.osgi.framework.ExtendedNoClassDefFoundError: test/iface/TestIface in KernelBundleClassLoader: [bundle=test.iface.impl_0.0.0]
	at org.eclipse.virgo.kernel.userregion.internal.equinox.KernelBundleClassLoader.defineClass(KernelBundleClassLoader.java:255)
	at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.defineClassHoldingLock(ClasspathManager.java:632)
	at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.defineClass(ClasspathManager.java:607)
	at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findClassImpl(ClasspathManager.java:568)
	at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClassImpl(ClasspathManager.java:492)
	at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.java:465)
	at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.java:216)
	at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:395)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:464)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:421)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:412)
	at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
	at org.eclipse.virgo.kernel.userregion.internal.equinox.KernelBundleClassLoader.loadClass(KernelBundleClassLoader.java:146)
	... 25 common frames omitted
Caused by: java.lang.NoClassDefFoundError: test/iface/TestIface
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
	at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.defineClass(DefaultClassLoader.java:188)
	at org.eclipse.virgo.kernel.userregion.internal.equinox.KernelBundleClassLoader.defineClass(KernelBundleClassLoader.java:251)
	... 37 common frames omitted
Caused by: org.eclipse.virgo.kernel.osgi.framework.ExtendedClassNotFoundException: test.iface.TestIface in KernelBundleClassLoader: [bundle=test.iface.impl_0.0.0]
	at org.eclipse.virgo.kernel.userregion.internal.equinox.KernelBundleClassLoader.loadClass(KernelBundleClassLoader.java:150)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	... 41 common frames omitted
Caused by: java.lang.ClassNotFoundException: test.iface.TestIface
	at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:501)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:421)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:412)
	at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
	at org.eclipse.virgo.kernel.userregion.internal.equinox.KernelBundleClassLoader.loadClass(KernelBundleClassLoader.java:146)
	... 42 common frames omitted

[2016-04-16 02:16:44.580] start-signalling-1           <DE0010I> Stopping bundle 'test.iface.impl' version '0.0.0'. 
[2016-04-16 02:16:44.588] sync Event Dispatcher Thread <AG0000E> Application context creation failure for bundle 'test.iface.impl' version '0.0.0'. org.springframework.beans.factory.CannotLoadBeanClassException: Error loading class [test.iface.impl.TestIfaceImpl] for bean with name 'ifaceImpl' defined in OSGi resource[bundleentry://143.fwk1225373914/OSGI-INF/blueprint/test.iface.impl.TestIfaceImpl.xml|bnd.id=143|bnd.sym=test.iface.impl]: problem with class file or dependent class; nested exception is java.lang.NoClassDefFoundError: test.iface.impl.TestIfaceImpl not found from bundle [null (test.iface.impl)]
	at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1265)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:576)
	at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1331)
	at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:897)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:566)
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:913)
	at org.eclipse.gemini.blueprint.context.support.AbstractDelegatedExecutionApplicationContext.access$1600(AbstractDelegatedExecutionApplicationContext.java:60)
	at org.eclipse.gemini.blueprint.context.support.AbstractDelegatedExecutionApplicationContext$4.run(AbstractDelegatedExecutionApplicationContext.java:325)
	at org.eclipse.gemini.blueprint.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)
	at org.eclipse.gemini.blueprint.context.support.AbstractDelegatedExecutionApplicationContext.completeRefresh(AbstractDelegatedExecutionApplicationContext.java:290)
	at org.eclipse.gemini.blueprint.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$CompleteRefreshTask.run(DependencyWaiterApplicationContextExecutor.java:137)
	at org.eclipse.virgo.kernel.agent.dm.ContextPropagatingTaskExecutor$2.run(ContextPropagatingTaskExecutor.java:95)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NoClassDefFoundError: test.iface.impl.TestIfaceImpl not found from bundle [null (test.iface.impl)]
	at org.eclipse.gemini.blueprint.util.BundleDelegatingClassLoader.findClass(BundleDelegatingClassLoader.java:110)
	at org.eclipse.gemini.blueprint.util.BundleDelegatingClassLoader.loadClass(BundleDelegatingClassLoader.java:155)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	at org.springframework.util.ClassUtils.forName(ClassUtils.java:257)
	at org.springframework.beans.factory.support.AbstractBeanDefinition.resolveBeanClass(AbstractBeanDefinition.java:417)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doResolveBeanClass(AbstractBeanFactory.java:1283)
	at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1254)
	... 14 common frames omitted
Caused by: org.eclipse.virgo.kernel.osgi.framework.ExtendedNoClassDefFoundError: test/iface/TestIface in KernelBundleClassLoader: [bundle=test.iface.impl_0.0.0] in KernelBundleClassLoader: [bundle=test.iface.impl_0.0.0]
	at org.eclipse.virgo.kernel.userregion.internal.equinox.KernelBundleClassLoader.loadClass(KernelBundleClassLoader.java:152)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	at org.eclipse.osgi.internal.loader.BundleLoader.loadClass(BundleLoader.java:340)
	at org.eclipse.osgi.framework.internal.core.BundleHost.loadClass(BundleHost.java:229)
	at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadClass(AbstractBundle.java:1212)
	at org.eclipse.gemini.blueprint.util.BundleDelegatingClassLoader.findClass(BundleDelegatingClassLoader.java:97)
	... 20 common frames omitted
Caused by: org.eclipse.virgo.kernel.osgi.framework.ExtendedNoClassDefFoundError: test/iface/TestIface in KernelBundleClassLoader: [bundle=test.iface.impl_0.0.0]
	at org.eclipse.virgo.kernel.userregion.internal.equinox.KernelBundleClassLoader.defineClass(KernelBundleClassLoader.java:255)
	at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.defineClassHoldingLock(ClasspathManager.java:632)
	at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.defineClass(ClasspathManager.java:607)
	at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findClassImpl(ClasspathManager.java:568)
	at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClassImpl(ClasspathManager.java:492)
	at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.java:465)
	at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.java:216)
	at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:395)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:464)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:421)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:412)
	at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
	at org.eclipse.virgo.kernel.userregion.internal.equinox.KernelBundleClassLoader.loadClass(KernelBundleClassLoader.java:146)
	... 25 common frames omitted
Caused by: java.lang.NoClassDefFoundError: test/iface/TestIface
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
	at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.defineClass(DefaultClassLoader.java:188)
	at org.eclipse.virgo.kernel.userregion.internal.equinox.KernelBundleClassLoader.defineClass(KernelBundleClassLoader.java:251)
	... 37 common frames omitted
Caused by: org.eclipse.virgo.kernel.osgi.framework.ExtendedClassNotFoundException: test.iface.TestIface in KernelBundleClassLoader: [bundle=test.iface.impl_0.0.0]
	at org.eclipse.virgo.kernel.userregion.internal.equinox.KernelBundleClassLoader.loadClass(KernelBundleClassLoader.java:150)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	... 41 common frames omitted
Caused by: java.lang.ClassNotFoundException: test.iface.TestIface
	at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:501)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:421)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:412)
	at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
	at org.eclipse.virgo.kernel.userregion.internal.equinox.KernelBundleClassLoader.loadClass(KernelBundleClassLoader.java:146)
	... 42 common frames omitted

[2016-04-16 02:16:44.594] start-signalling-1           <DE0011I> Stopped bundle 'test.iface.impl' version '0.0.0'. 
[2016-04-16 02:16:44.596]  TCP Connection(2)-127.0.0.1 <DE0013I> Uninstalling bundle 'test.iface.impl' version '0.0.0'. 
[2016-04-16 02:16:44.602]  TCP Connection(2)-127.0.0.1 <DE0014I> Uninstalled bundle 'test.iface.impl' version '0.0.0'. 


What is missing? What am I doing wrong?
icon8.gif  Re: From OSGi to Blueprints & Virgo? [message #1729638 is a reply to message #1729612] Sat, 16 April 2016 13:47 Go to previous messageGo to next message
Bill Mair is currently offline Bill MairFriend
Messages: 72
Registered: July 2009
Member
I have found what appears to be the problem.

When you create OSGi bundles (plug ins) the META-INF directory is in the base directory of the project, NOT in the src directory.

When adding a project from the IDE the META-INF directory is NOT copied to /stage/ and so the bundle definition is completely lost.

To get it to run I basically copied {base}/META-INF to {src}/META-INF and then everything worked.

The PDE tools expect the META-INF directory to be in the project base but Virgo tooling doesn't.

I really don't want to have to move all the META-INF directories in my current development in to my {src} directories just for Virgo deployment and I think that it would break the PDE settings anyway.

I definitely don't want to keep and maintain 2 copies of the directory either.

What can I do to get this working with existing OSGi bundles?
Re: From OSGi to Blueprints & Virgo? [message #1729655 is a reply to message #1729638] Sun, 17 April 2016 07:58 Go to previous messageGo to next message
GianMaria Romanato is currently offline GianMaria RomanatoFriend
Messages: 57
Registered: November 2015
Member
Hi Bill,

please see my other reply [1] in your other thread regarding PDE support in the VIrgo tools.

You cannot use a standard Plug-in project with Virgo, you have to use Virgo's own flavour of Plug-in projects created using the "New -> Virgo -> PDE bundle project" wizard.

The key point is that the above wizard creates an enhanced Plug-in project with additional natures and an additional builder. These aspects are declared in the .project file within the project root folder.

If you want to use a pre-existing Plug-in project with Virgo, you must manually migrate the .project file to include the necessary information. The easiest way to understand the required changes is to create a new project using the aforementioned wizard and to compare the .project of the newly created project with the corresponding file of your pre-existing Plug-in project.

The differences are commented in the sample below:

<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
	<name>myproject</name>
	<comment></comment>
	<projects>
	</projects>
	<buildSpec>
		<buildCommand>
			<name>org.eclipse.wst.common.project.facet.core.builder</name>
			<arguments>
			</arguments>
		</buildCommand>
		<buildCommand>
			<name>org.eclipse.jdt.core.javabuilder</name>
			<arguments>
			</arguments>
		</buildCommand>
		<buildCommand>
			<name>org.eclipse.pde.ManifestBuilder</name>
			<arguments>
			</arguments>
		</buildCommand>
		<buildCommand>
			<name>org.eclipse.pde.SchemaBuilder</name>
			<arguments>
			</arguments>
		</buildCommand>

                <!-- one extra build command required by Virgo tools -->
		<buildCommand>                     
			<name>org.eclipse.virgo.ide.pde.core.builder</name>
			<arguments>
			</arguments>
		</buildCommand>

	</buildSpec>
	<natures>
		<nature>org.eclipse.pde.PluginNature</nature>
		<nature>org.eclipse.jdt.core.javanature</nature>                                                  

                <!-- thre extra natures required by Virgo tools -->
		<nature>org.eclipse.wst.common.project.facet.core.nature</nature>            
		<nature>org.eclipse.virgo.ide.facet.core.bundlenature</nature>                      
		<nature>org.eclipse.virgo.ide.pde.core.nature</nature>                                      


	</natures>
</projectDescription>


Hope this helps.
GianMaria.

[1] https://www.eclipse.org/forums/index.php?t=msg&th=1076631&goto=1729653&#msg_1729653

Re: From OSGi to Blueprints & Virgo? [message #1729658 is a reply to message #1729655] Sun, 17 April 2016 08:26 Go to previous messageGo to next message
Bill Mair is currently offline Bill MairFriend
Messages: 72
Registered: July 2009
Member
I thought that these changes would be made by the menu option "Virgo -> Migrate PDE2Virgo project". I shall have to try this.

I've tried it now and it seems to work. Thanks for the heads up on the changes required.

Shouldn't the above menu option be doing that for me though?

[Updated on: Sun, 17 April 2016 08:31]

Report message to a moderator

Re: From OSGi to Blueprints & Virgo? [message #1729665 is a reply to message #1729658] Sun, 17 April 2016 12:13 Go to previous messageGo to next message
GianMaria Romanato is currently offline GianMaria RomanatoFriend
Messages: 57
Registered: November 2015
Member
No, prior to 1.5.0 PDE plug-in projects did not work with Virgo Tools and to be able to develop for Virgo using PDE I created a simple plug-in for Eclipse named PDE2Virgo [1].
That plug-in is still listed in the Virgo FAQ as a work-around to the lack of PDE support in Virgo tools.

Now that official PDE support was added the "Virgo -> Migrate PDE2Virgo project" action was created to simplify migration for PDE2Virgo users.

A similar action could be implemented for adapting PDE plug-in projects for Virgo.

GianMaria.


[1] https://github.com/giamma/pde2virgo
Re: From OSGi to Blueprints & Virgo? [message #1729671 is a reply to message #1729665] Sun, 17 April 2016 16:50 Go to previous messageGo to next message
GianMaria Romanato is currently offline GianMaria RomanatoFriend
Messages: 57
Registered: November 2015
Member
Hi Bill,

based on our discussion, I created a bugzilla entry [1] and a conversion action to convert PDE plug-in projects into Virgo Tools PDE bundle projects.
The action is already committed into the code-base and will appear in the next snapshot build.

GianMaria.

[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=491869
Re: From OSGi to Blueprints & Virgo? [message #1729673 is a reply to message #1729665] Sun, 17 April 2016 17:22 Go to previous messageGo to next message
Bill Mair is currently offline Bill MairFriend
Messages: 72
Registered: July 2009
Member
GianMaria Romanato wrote on Sun, 17 April 2016 13:13
A similar action could be implemented for adapting PDE plug-in projects for Virgo.

I think that such an option should be added, especially when I look at the number of bundles I have to extend/convert Very Happy
Re: From OSGi to Blueprints & Virgo? [message #1729680 is a reply to message #1729671] Mon, 18 April 2016 05:40 Go to previous messageGo to next message
Bill Mair is currently offline Bill MairFriend
Messages: 72
Registered: July 2009
Member
GianMaria Romanato wrote on Sun, 17 April 2016 17:50
Hi Bill,

based on our discussion, I created a bugzilla entry [1] and a conversion action to convert PDE plug-in projects into Virgo Tools PDE bundle projects.
The action is already committed into the code-base and will appear in the next snapshot build.

GianMaria.

[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=491869


Hi GianMaria,

That sounds great!

Did you extend the existing "Add OSGi Bundle Nature" action to check to see if the project is a PDE project and add the required build and nature accordingly (same for the "Remove OSGi Bundle Nature" of course) ?

Bill

P.S. I can't wait to test it. With what frequency are snapshot builds made?

[Updated on: Mon, 18 April 2016 05:42]

Report message to a moderator

Re: From OSGi to Blueprints & Virgo? [message #1729796 is a reply to message #1729680] Tue, 19 April 2016 07:21 Go to previous messageGo to next message
GianMaria Romanato is currently offline GianMaria RomanatoFriend
Messages: 57
Registered: November 2015
Member
It's a new action with a different purpose.

The "Add OSGi bundle nature" action is part of the tooling for developing for Virgo without using PDE and I am not going to change it.

The new action appears in the same menu when one or more plug-in projects are selected.

Snapshot builds are executed automatically every day. The new action should already appear if you update the Virgo Tools.

GianMaria.
Re: From OSGi to Blueprints & Virgo? [message #1729967 is a reply to message #1729796] Wed, 20 April 2016 15:27 Go to previous messageGo to next message
Bill Mair is currently offline Bill MairFriend
Messages: 72
Registered: July 2009
Member
I installed the Virgo Tools in to my work IDE and one thing did happen that took me by surprise.

During the installation on Mars 4.5.2, in "Preferences -> Plug-in Development -> Target Platform", my default target definition was switched from my current one to the newly created "Virgo Runtime".

Apart from flagging a few dependency issues (to framework version 1.8, even though none of the new 1.8 APIs are being used) everything appears to be working as it should.
Re: From OSGi to Blueprints & Virgo? [message #1729971 is a reply to message #1729967] Wed, 20 April 2016 15:44 Go to previous message
GianMaria Romanato is currently offline GianMaria RomanatoFriend
Messages: 57
Registered: November 2015
Member
Hi Bill,

I am glad it's working as it should.

PDE support is a new feature in the 1.5 version of the Virgo Tools, so please report bugs in bugzilla when you find them.

We are also open to suggestions for improvements, and while we cannot commit to specific release dates, we would be happy to discuss feasibility and priorities.
Finally, as Florian mentioned multiple times in this forum, the team is more than happy to receive contributions Smile

GianMaria.
Previous Topic:VIRGO -NANO 3.6.4 Tomcat version
Next Topic:Undelopying a Spring MVC bundle also leads to undeploying the other bundles
Goto Forum:
  


Current Time: Thu Mar 28 13:42:52 GMT 2024

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

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

Back to the top