From OSGi to Blueprints & Virgo? [message #1729584] |
Fri, 15 April 2016 16:16 |
|
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 |
|
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?
|
|
|
Re: From OSGi to Blueprints & Virgo? [message #1729638 is a reply to message #1729612] |
Sat, 16 April 2016 13:47 |
|
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 #1729673 is a reply to message #1729665] |
Sun, 17 April 2016 17:22 |
|
GianMaria Romanato wrote on Sun, 17 April 2016 13:13A 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
|
|
|
Re: From OSGi to Blueprints & Virgo? [message #1729680 is a reply to message #1729671] |
Mon, 18 April 2016 05:40 |
|
GianMaria Romanato wrote on Sun, 17 April 2016 17:50Hi 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 #1729967 is a reply to message #1729796] |
Wed, 20 April 2016 15:27 |
|
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.
|
|
|
|
Powered by
FUDForum. Page generated in 0.08064 seconds