Return-Path: Delivered-To: apmail-incubator-felix-dev-archive@www.apache.org Received: (qmail 63280 invoked from network); 7 Jun 2006 02:45:10 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 7 Jun 2006 02:45:10 -0000 Received: (qmail 42975 invoked by uid 500); 7 Jun 2006 02:45:10 -0000 Delivered-To: apmail-incubator-felix-dev-archive@incubator.apache.org Received: (qmail 42937 invoked by uid 500); 7 Jun 2006 02:45:09 -0000 Mailing-List: contact felix-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: felix-dev@incubator.apache.org Delivered-To: mailing list felix-dev@incubator.apache.org Received: (qmail 42926 invoked by uid 99); 7 Jun 2006 02:45:09 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Jun 2006 19:45:09 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (asf.osuosl.org: local policy) Received: from [207.190.94.33] (HELO gadget.mwt.net) (207.190.94.33) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Jun 2006 19:45:08 -0700 Received: from 192.168.1.8 (dsl-67-41.westby.mwt.net [207.190.67.41]) by gadget.mwt.net (8.13.6/8.12.11) with ESMTP id k572iiNi019995 for ; Tue, 6 Jun 2006 21:44:45 -0500 Subject: Re: ServiceBinder and configuration management From: "John E. Conlon" Reply-To: jconlon@verticon.com To: felix-dev@incubator.apache.org In-Reply-To: <1149623873.3690.60.camel@trout> References: <1149297701.32289.49.camel@trout> <44857D06.40406@ungoverned.org> <1149623873.3690.60.camel@trout> Content-Type: text/plain Organization: Verticon, Inc. Date: Tue, 06 Jun 2006 21:44:44 -0500 Message-Id: <1149648284.3690.75.camel@trout> Mime-Version: 1.0 X-Mailer: Evolution 2.0.2 (2.0.2-27) Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Interesting to note the headers and the services of my experimental iPOJO EventHandler bundle. Look at the generated Import-Package it is missing the org.osgi.service.cm package yet: 1. services: shows that it offers org.osgi.service.cm.ManagedService 2. felix does not throw an error about missing a ManagedService 3. ApacheDS's ConfigurationAdmin implementations underlying ServiceBinder never sees the iPOJO's ManageService register with the framework??? -> headers 23 Fiona Experiment (23) --------------------- Archiver-Version = Plexus Archiver Build-Jdk = 1.5.0_06 Built-By = jconlon Bundle-Activator = org.apache.felix.ipojo.Activator Bundle-Classpath = .,. Bundle-Description = Experiment to test ipojo and configuration admin. Bundle-Name = Fiona Experiment Bundle-Version = 1.0.SNAPSHOT Created-By = Apache Maven Extension-Name = ipojo.configuration Implementation-Title = ipojo.configuration Implementation-Version = 1.0-SNAPSHOT Import-Package = org.apache.felix.ipojo, org.osgi.service.event, org.slf4j iPOJO-Components = component { $architecture=true $name=com.verticon.experiment.ipojo.configuration $classname=com.verticon.experiment.ipojo.configuration.ConfiguribleEventHandler provides { $interface=org.osgi.service.event.EventHandler dynamicproperty { $name=event.topics $value=com/verticon/rfid/MOVEMENT $field=topics }}configurableproperty { $name=event.topics $field=topics }callback { $initial=INVALID $final=VALID $method=starting }callback { $initial=VALID $final=INVALID $method=stopping }manipulation { interface { $name=org.osgi.service.event.EventHandler }field { $name=topics $type=java.lang.String }}} iPOJO-Metadata = metadata.xml Manifest-Version = 1.0 -> services 23 Fiona Experiment (23) provides: ------------------------------- Component Implementation Class = com.verticon.experiment.ipojo.configuration.ConfiguribleEventHandler objectClass = org.apache.felix.ipojo.architecture.Architecture service.id = 33 ---- event.topics = com/verticon/rfid/MOVEMENT objectClass = org.osgi.service.event.EventHandler service.id = 34 ---- objectClass = org.osgi.service.cm.ManagedService service.id = 35 service.pid = com.verticon.experiment.ipojo.configuration And if I generate the importPackage myself like: org.osgi.framework,org.apache.felix.ipojo,org.osgi.service.event,org.slf4j,org.osgi.service.cm in the configuraiton of the org.apache.felix.ipojo.plugin. I then get the following exception thrown by the ConfigurationAdmin's ServiceBinder: ### DependencyManager : exception while invoking setManagedService :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:585) at org.apache.felix.servicebinder.InstanceManager $DependencyManager.callBindMethod(InstanceManager.java:1116) at org.apache.felix.servicebinder.InstanceManager $DependencyManager.serviceChanged(InstanceManager.java:980) at org.apache.felix.framework.util.ServiceListenerWrapper.serviceChanged (ServiceListenerWrapper.java:108) at org.apache.felix.framework.Felix$8.dispatch(Felix.java:3326) at org.apache.felix.framework.util.FelixDispatchQueue.dispatch (FelixDispatchQueue.java:76) at org.apache.felix.framework.Felix.fireServiceEvent (Felix.java:3338) at org.apache.felix.framework.Felix.access$100(Felix.java:33) at org.apache.felix.framework.Felix$1.serviceChanged (Felix.java:240) at org.apache.felix.framework.ServiceRegistry.fireServiceChanged (ServiceRegistry.java:408) at org.apache.felix.framework.ServiceRegistry.registerService (ServiceRegistry.java:69) at org.apache.felix.framework.Felix.registerService (Felix.java:2241) at org.apache.felix.framework.BundleContextImpl.registerService (BundleContextImpl.java:173) at org.apache.felix.framework.BundleContextImpl.registerService (BundleContextImpl.java:165) at org.apache.felix.ipojo.handlers.configuration.ConfigurationHandler.start (ConfigurationHandler.java:187) at org.apache.felix.ipojo.ComponentManager.start (ComponentManager.java:180) at org.apache.felix.ipojo.ComponentManagerFactory.start (ComponentManagerFactory.java:111) at org.apache.felix.ipojo.Activator.start(Activator.java:241) at org.apache.felix.ipojo.Activator.start(Activator.java:187) at org.apache.felix.framework.Felix._startBundle (Felix.java:1362) at org.apache.felix.framework.Felix.startBundle(Felix.java:1296) at org.apache.felix.framework.Felix.setFrameworkStartLevel (Felix.java:737) at org.apache.felix.framework.StartLevelImpl.run (StartLevelImpl.java:179) at java.lang.Thread.run(Thread.java:595) DEBUG [FelixStartLevel] com.verticon.experiment.ipojo.configuration.ConfiguribleEventHandler.(ConfiguribleEventHandler.java:17) - Constructed DEBUG [FelixStartLevel] com.verticon.experiment.ipojo.configuration.ConfiguribleEventHandler.starting(ConfiguribleEventHandler.java:21) - Starting ### DependencyManager : exception while invoking setManagedService :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:585) at org.apache.felix.servicebinder.InstanceManager $DependencyManager.callBindMethod(InstanceManager.java:1116) at org.apache.felix.servicebinder.InstanceManager $DependencyManager.serviceChanged(InstanceManager.java:980) at org.apache.felix.framework.util.ServiceListenerWrapper.serviceChanged (ServiceListenerWrapper.java:108) at org.apache.felix.framework.Felix$8.dispatch(Felix.java:3326) at org.apache.felix.framework.util.FelixDispatchQueue.dispatch (FelixDispatchQueue.java:76) at org.apache.felix.framework.Felix.fireServiceEvent (Felix.java:3338) at org.apache.felix.framework.Felix.access$100(Felix.java:33) at org.apache.felix.framework.Felix$1.serviceChanged (Felix.java:240) at org.apache.felix.framework.ServiceRegistry.fireServiceChanged (ServiceRegistry.java:408) at org.apache.felix.framework.ServiceRegistry.registerService (ServiceRegistry.java:69) at org.apache.felix.framework.Felix.registerService (Felix.java:2241) at org.apache.felix.framework.BundleContextImpl.registerService (BundleContextImpl.java:173) at org.apache.felix.framework.BundleContextImpl.registerService (BundleContextImpl.java:165) at org.apache.felix.ipojo.handlers.configuration.ConfigurationHandler.start (ConfigurationHandler.java:187) at org.apache.felix.ipojo.handlers.configuration.ConfigurationHandler.stateChanged(ConfigurationHandler.java:221) at org.apache.felix.ipojo.ComponentManager.setState (ComponentManager.java:214) at org.apache.felix.ipojo.ComponentManager.check (ComponentManager.java:439) at org.apache.felix.ipojo.ComponentManager.start (ComponentManager.java:184) at org.apache.felix.ipojo.ComponentManagerFactory.start (ComponentManagerFactory.java:111) at org.apache.felix.ipojo.Activator.start(Activator.java:241) at org.apache.felix.ipojo.Activator.start(Activator.java:187) at org.apache.felix.framework.Felix._startBundle (Felix.java:1362) at org.apache.felix.framework.Felix.startBundle(Felix.java:1296) at org.apache.felix.framework.Felix.setFrameworkStartLevel (Felix.java:737) at org.apache.felix.framework.StartLevelImpl.run (StartLevelImpl.java:179) at java.lang.Thread.run(Thread.java:595) Clement or Richard any clues? John On Tue, 2006-06-06 at 14:57 -0500, John E. Conlon wrote: > On Tue, 2006-06-06 at 09:03 -0400, Richard S. Hall wrote: > > Also, if you are willing to play with more experimental stuff, > > iPOJO has > > some support for Config Admin: > > > > > > http://www-adele.imag.fr/~escoffie/dev/ipojo/using_iPOJO_component_model.html > > > > Search for "Configuration" and you should find some info under the > > "Other iPOJO features" section... > Not easy to refuse a chance to experiment with volatile substances, so I > downloaded the iPOJO plugin, bundle and tried building a iPOJO that > implements org.osgi.service.event.EventHandler and where the > event.topics property can be updated Configuration Admin. > > IPOJO seems like an easy way to do things. > > So with high hopes using the apacheDS's configurationAdmin implemenation > I configured the target bundle's event.topics to receive events from > another topic. Probably a set up snafu on my side but I couldnot pass > the new configuration to iPOJO component and get the eventHandler to > listen to a new topic. > > > Here is my metadata.xml > > > className="com.verticon.experiment.ipojo.configuration.ConfiguribleEventHandler" > name="com.verticon.experiment.ipojo.configuration" > architecture="true"> > > > field="topics" > value="com/verticon/rfid/MOVEMENT"/> > > > > > > > > > > Am I setting up the metadata correctly? > > cheers, > John