felix-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brad Cox <b...@virtualschool.edu>
Subject Re: Command line felix execution questions
Date Sun, 09 Nov 2008 17:51:14 GMT
WOOT! Lift off! I'd omitted "extends ServiceFactory" from the interface 
declaration somehow. Thanks for the help!!

-> ps
START LEVEL 1
    ID   State         Level  Name
[   0] [Active     ] [    0] System Bundle (1.2.1)
[   1] [Active     ] [    1] Apache Felix Shell Service (1.0.2)
[   2] [Active     ] [    1] Apache Felix Shell TUI (1.0.2)
[   3] [Active     ] [    1] Apache Felix Bundle Repository (1.2.0)
[   4] [Active     ] [    1] soakit.core (1.0.0.SNAPSHOT)
[   5] [Active     ] [    1] iPOJO (1.0.0)


clement escoffier wrote:
> 2008/11/9 Brad Cox <bcox@virtualschool.edu>
> 
>> That's because I'm transitioning to ipojo; still feeling my way.
>>
>> Commented that out in the pom and tried again. How is the ipojo determined?
>> I imagine here:
>>
>> <ipojo>
>>        <component classname="com.gestalt.soakit.core.CompositeService">
>>                <provides/>
>>        </component>
>>        <instance component="com.gestalt.soakit.core.Composite"/>
>> </ipojo>
> 
> 
> Exactly, iPOJO will analyze these metadata at runtime (translated in an
> internal format) to create and manage factories and instances.
> 
> 
>> and CompositeService is this
>>
>> package com.gestalt.soakit.core;
>>
>> import org.jdom.Element;
>> import org.osgi.framework.ServiceFactory;
>> /**
>>  * Defines a component factory service
>>  * that the composite can use to create configured component instances
>>  * as described in an XML component specification.
>> **/
>> public interface ComponentService extends ServiceFactory
>> {
>>    public Component createComponent(Element parentElmt);
>> }
>>
>> Pardon the dumb questions; still pretty shaky on all this. Really wishing I
>> knew how to make eclipse actually work.
>>
>> -> update 4
>> file:/Users/bradcox/.m2/repository/soakit/soakit.core/1.0-SNAPSHOT/soakit.core-1.0-SNAPSHOT.jar
>> -> [com.gestalt.soakit.core.CompositeService] ERROR: Service Providing:
>> Cannot instantiate a provided service : no specifications found (no
>> interfaces implemented by the pojo)
>> [IPOJO-Extender] ERROR: An error occurs when analyzing the content or
>> starting the management of 4
>> java.lang.IllegalStateException: Service Providing: Cannot instantiate a
>> provided service : no specifications found (no interfaces implemented by the
>> pojo)
>>        at
>> org.apache.felix.ipojo.IPojoFactory.computeDescription(IPojoFactory.java:658)
>>        at
>> org.apache.felix.ipojo.IPojoFactory.computeFactoryState(IPojoFactory.java:685)
>>        at
>> org.apache.felix.ipojo.ComponentFactory.addedService(ComponentFactory.java:358)
>>        at
>> org.apache.felix.ipojo.util.Tracker$Tracked.trackAdding(Tracker.java:707)
>>        at
>> org.apache.felix.ipojo.util.Tracker$Tracked.trackInitialServices(Tracker.java:593)
>>        at org.apache.felix.ipojo.util.Tracker.open(Tracker.java:202)
>>        at
>> org.apache.felix.ipojo.ComponentFactory.starting(ComponentFactory.java:235)
>>        at org.apache.felix.ipojo.IPojoFactory.start(IPojoFactory.java:559)
>>        at
>> org.apache.felix.ipojo.Extender.createAbstractFactory(Extender.java:383)
>>        at org.apache.felix.ipojo.Extender.parse(Extender.java:263)
>>        at
>> org.apache.felix.ipojo.Extender.startManagementFor(Extender.java:207)
>>        at org.apache.felix.ipojo.Extender.access$600(Extender.java:52)
>>        at
>> org.apache.felix.ipojo.Extender$CreatorThread.run(Extender.java:622)
>>        at java.lang.Thread.run(Thread.java:613)
>>
>>
> This error is because of the component implementation that doesn't implement
> any service interface (neither directly nor in parent classes). In fact,
> component implementations must be concrete classes and not interfaces.
> 
> Create an interface with your public Component createComponent(Element
> parentElmt) method. Then create a class implementing this interface and
> containing your code. The metadata.xml file will describe a component type
> (as yours) but the class name will be the qualified name of the class
> implementing your interface.
> 
> Regards,
> 
> Clement
> 
> 
> 
>>
>> clement escoffier wrote:
>>
>>> In your pom file, why do you have both iPOJO and a bundle activator. It is
>>> possible to have both, but it's rare because it means that your bundle
>>> contains a mixed set of iPOJO powered components and "regular" OSGi code.
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>> For additional commands, e-mail: users-help@felix.apache.org
>>
> 



Mime
View raw message