Hi,
I just add the annotation support :-)
About your test case, I did two small modifications:
Add add a filter to your @Requires in order to avoid using an instance
of the bad version (version conflict)
@Requires(id = "plugins", optional = true,
filter="(factory.version=2.0.0)")
Then, everything works:
-> start file:/Users/clement/.m2/repository/ipojo/testcase/module/1.0-
SNAPSHOT/module-1.0-SNAPSHOT.jar
start file:/Users/clement/.m2/repository/ipojo/testcase/plugin/1.0-
SNAPSHOT/plugin-1.0-SNAPSHOT.jar
start file:/Users/clement/.m2/repository/ipojo/testcase/module/2.0-
SNAPSHOT/module-2.0-SNAPSHOT.jar
start file:/Users/clement/.m2/repository/ipojo/testcase/plugin/2.0-
SNAPSHOT/plugin-2.0-SNAPSHOT.jar
-> module(V 1.0.0.SNAPSHOT) - ModuleManager (Vm1.0) started
plugin(V 1.0.0.SNAPSHOT), apiVersion=a1.0
-> -> plugin(V 1.0.0.SNAPSHOT) - MyPlugin (Vp1.0) started
module(V 1.0.0.SNAPSHOT) +++ Plugin added: My Module (Vp1.0),
className=ipojo.testcase.plugin.MyPlugin
module(V 2.0.0.SNAPSHOT) - ModuleManager (Vm2.0) started
plugin(V 2.0.0.SNAPSHOT), apiVersion=a2.0
However, I don't really understand why getServiceReferences returns
"incompatible" services, as you will the version range in the
manifest. I will try to figure out what happen there...
Regards,
Clement
On 20.05.2009, at 18:59, Vrignaud Etienne wrote:
Hi,
Thanks for this new feature.
http://www.nabble.com/file/p23639495/ipojo-component-testcase-metadata.tar.gz
ipojo-component-testcase-metadata.tar.gz
My first remark will be that I didn't use the Xml syntax of iPojo.
Only
annotations and the new version attribut is not available in the
@Component
annotation.
Secondly, I have modified my testcase in order to use the Xml syntax
and it
works "quite great".
Perhaps something is wrong with my testcase.
The fact is that when I start those two bundles (module-1.0-
SNAPSHOT.jar,
plugin-1.0-SNAPSHOT.jar) or those ones (module-2.0-SNAPSHOT.jar,
plugin-2.0-SNAPSHOT.jar), everything is ok.
But when I start the four ones, I obtain an ugly stack trace on my
console
output.
To make this test, I have built Felix from the trunk.
I have attached also the complete testcase that I use.
Thanks!
/Etienne
--------------------------------------------------------------------------------------------------------------------
Welcome to Felix.
=================
->
org.ops4j.pax.logging.pax-logging-
api[org.ops4j.pax.logging.internal.Activator]
: Enabling SLF4J API support.
org.ops4j.pax.logging.pax-logging-
api[org.ops4j.pax.logging.internal.Activator]
: Enabling Jakarta Commons Logging API support.
org.ops4j.pax.logging.pax-logging-
api[org.ops4j.pax.logging.internal.Activator]
: Enabling Log4J API support.
org.ops4j.pax.logging.pax-logging-
api[org.ops4j.pax.logging.internal.Activator]
: Enabling Avalon Logger API support.
org.ops4j.pax.logging.pax-logging-
api[org.ops4j.pax.logging.internal.Activator]
: Enabling JULI Logger API support.
plugin(V 1.0.0.SNAPSHOT), apiVersion=a1.0
plugin(V 2.0.0.SNAPSHOT), apiVersion=a2.0
module(V 1.0.0.SNAPSHOT) - ModuleManager (Vm1.0) started
module(V 2.0.0.SNAPSHOT) - ModuleManager (Vm2.0) started
plugin(V 1.0.0.SNAPSHOT) - MyPlugin (Vp1.0) started
ERROR: EventDispatcher: Error during dispatch.
(java.lang.IllegalArgumentException: argument type mismatch)
java.lang.IllegalArgumentException: argument type mismatch
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun
.reflect
.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun
.reflect
.DelegatingMethodAccessorImpl
.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.felix.ipojo.util.Callback.call(Callback.java:235)
at
org
.apache
.felix
.ipojo
.handlers.dependency.DependencyCallback.call(DependencyCallback.java:
234)
at
org
.apache
.felix
.ipojo.handlers.dependency.Dependency.invokeCallback(Dependency.java:
272)
at
org
.apache
.felix
.ipojo.handlers.dependency.Dependency.callBindMethod(Dependency.java:
299)
at
org
.apache
.felix
.ipojo
.handlers.dependency.Dependency.onServiceArrival(Dependency.java:387)
at
org
.apache
.felix.ipojo.util.DependencyModel.manageArrival(DependencyModel.java:
392)
at
org
.apache
.felix.ipojo.util.DependencyModel.addedService(DependencyModel.java:
335)
at
org.apache.felix.ipojo.util.Tracker$Tracked.trackAdding(Tracker.java:
709)
at org.apache.felix.ipojo.util.Tracker$Tracked.track(Tracker.java:
671)
at
org.apache.felix.ipojo.util.Tracker
$Tracked.serviceChanged(Tracker.java:632)
at
org
.apache
.felix
.framework
.util
.EventDispatcher.invokeServiceListenerCallback(EventDispatcher.java:
846)
at
org
.apache
.felix
.framework
.util.EventDispatcher.fireEventImmediately(EventDispatcher.java:704)
at
org
.apache
.felix
.framework
.util.EventDispatcher.fireServiceEvent(EventDispatcher.java:635)
at org.apache.felix.framework.Felix.fireServiceEvent(Felix.java:3420)
at org.apache.felix.framework.Felix.access$000(Felix.java:39)
at org.apache.felix.framework.Felix$1.serviceChanged(Felix.java:622)
at
org
.apache
.felix
.framework.ServiceRegistry.fireServiceChanged(ServiceRegistry.java:
576)
at
org
.apache
.felix
.framework.ServiceRegistry.registerService(ServiceRegistry.java:86)
at org.apache.felix.framework.Felix.registerService(Felix.java:2548)
at
org
.apache
.felix
.framework.BundleContextImpl.registerService(BundleContextImpl.java:
252)
at
org
.apache.felix.ipojo.IPojoContext.registerService(IPojoContext.java:
338)
at
org
.apache
.felix
.ipojo
.handlers
.providedservice
.ProvidedService.registerService(ProvidedService.java:289)
at
org
.apache
.felix
.ipojo
.handlers
.providedservice
.ProvidedServiceHandler.__stateChanged(ProvidedServiceHandler.java:
443)
at
org
.apache
.felix
.ipojo
.handlers
.providedservice
.ProvidedServiceHandler.stateChanged(ProvidedServiceHandler.java)
at
org.apache.felix.ipojo.InstanceManager.setState(InstanceManager.java:
440)
at
org.apache.felix.ipojo.InstanceManager.start(InstanceManager.java:321)
at
org
.apache
.felix.ipojo.ComponentFactory.createInstance(ComponentFactory.java:
155)
at
org
.apache
.felix.ipojo.IPojoFactory.createComponentInstance(IPojoFactory.java:
298)
at
org
.apache
.felix.ipojo.IPojoFactory.createComponentInstance(IPojoFactory.java:
235)
at
org.apache.felix.ipojo.InstanceCreator
$ManagedInstance.create(InstanceCreator.java:360)
at
org
.apache.felix.ipojo.InstanceCreator.addInstance(InstanceCreator.java:
89)
at org.apache.felix.ipojo.Extender.parse(Extender.java:269)
at org.apache.felix.ipojo.Extender.startManagementFor(Extender.java:
208)
at org.apache.felix.ipojo.Extender.access$600(Extender.java:52)
at org.apache.felix.ipojo.Extender$CreatorThread.run(Extender.java:
669)
at java.lang.Thread.run(Thread.java:619)
module(V 1.0.0.SNAPSHOT) +++ Plugin added: My Module (Vp1.0),
className=ipojo.testcase.plugin.MyPlugin
plugin(V 2.0.0.SNAPSHOT) - MyPlugin (Vp2.0) started
module(V 2.0.0.SNAPSHOT) +++ Plugin added: My Module (Vp2.0),
className=ipojo.testcase.plugin.MyPlugin
ERROR: EventDispatcher: Error during dispatch.
(java.lang.IllegalArgumentException: argument type mismatch)
java.lang.IllegalArgumentException: argument type mismatch
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun
.reflect
.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun
.reflect
.DelegatingMethodAccessorImpl
.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.felix.ipojo.util.Callback.call(Callback.java:235)
at
org
.apache
.felix
.ipojo
.handlers.dependency.DependencyCallback.call(DependencyCallback.java:
234)
at
org
.apache
.felix
.ipojo.handlers.dependency.Dependency.invokeCallback(Dependency.java:
272)
at
org
.apache
.felix
.ipojo.handlers.dependency.Dependency.callBindMethod(Dependency.java:
299)
at
org
.apache
.felix
.ipojo
.handlers.dependency.Dependency.onServiceArrival(Dependency.java:387)
at
org
.apache
.felix.ipojo.util.DependencyModel.manageArrival(DependencyModel.java:
392)
at
org
.apache
.felix.ipojo.util.DependencyModel.addedService(DependencyModel.java:
335)
at
org.apache.felix.ipojo.util.Tracker$Tracked.trackAdding(Tracker.java:
709)
at org.apache.felix.ipojo.util.Tracker$Tracked.track(Tracker.java:
671)
at
org.apache.felix.ipojo.util.Tracker
$Tracked.serviceChanged(Tracker.java:632)
at
org
.apache
.felix
.framework
.util
.EventDispatcher.invokeServiceListenerCallback(EventDispatcher.java:
846)
at
org
.apache
.felix
.framework
.util.EventDispatcher.fireEventImmediately(EventDispatcher.java:704)
at
org
.apache
.felix
.framework
.util.EventDispatcher.fireServiceEvent(EventDispatcher.java:635)
at org.apache.felix.framework.Felix.fireServiceEvent(Felix.java:3420)
at org.apache.felix.framework.Felix.access$000(Felix.java:39)
at org.apache.felix.framework.Felix$1.serviceChanged(Felix.java:622)
at
org
.apache
.felix
.framework.ServiceRegistry.fireServiceChanged(ServiceRegistry.java:
576)
at
org
.apache
.felix
.framework.ServiceRegistry.registerService(ServiceRegistry.java:86)
at org.apache.felix.framework.Felix.registerService(Felix.java:2548)
at
org
.apache
.felix
.framework.BundleContextImpl.registerService(BundleContextImpl.java:
252)
at
org
.apache.felix.ipojo.IPojoContext.registerService(IPojoContext.java:
338)
at
org
.apache
.felix
.ipojo
.handlers
.providedservice
.ProvidedService.registerService(ProvidedService.java:289)
at
org
.apache
.felix
.ipojo
.handlers
.providedservice
.ProvidedServiceHandler.__stateChanged(ProvidedServiceHandler.java:
443)
at
org
.apache
.felix
.ipojo
.handlers
.providedservice
.ProvidedServiceHandler.stateChanged(ProvidedServiceHandler.java)
at
org.apache.felix.ipojo.InstanceManager.setState(InstanceManager.java:
440)
at
org.apache.felix.ipojo.InstanceManager.start(InstanceManager.java:321)
at
org
.apache
.felix.ipojo.ComponentFactory.createInstance(ComponentFactory.java:
155)
at
org
.apache
.felix.ipojo.IPojoFactory.createComponentInstance(IPojoFactory.java:
298)
at
org
.apache
.felix.ipojo.IPojoFactory.createComponentInstance(IPojoFactory.java:
235)
at
org.apache.felix.ipojo.InstanceCreator
$ManagedInstance.create(InstanceCreator.java:360)
at
org
.apache.felix.ipojo.InstanceCreator.addInstance(InstanceCreator.java:
89)
at org.apache.felix.ipojo.Extender.parse(Extender.java:269)
at org.apache.felix.ipojo.Extender.startManagementFor(Extender.java:
208)
at org.apache.felix.ipojo.Extender.access$600(Extender.java:52)
at org.apache.felix.ipojo.Extender$CreatorThread.run(Extender.java:
669)
at java.lang.Thread.run(Thread.java:619)
--------------------------------------------------------------------------------------------------------------------
--
View this message in context:
http://www.nabble.com/iPojo---How-to-create-several-instances-of-the-same-component-installed-in-different-versions-tp23544877p23639495.html
Sent from the Apache Felix - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]