You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by Stephan-Frank Henry <Fr...@gmx.net> on 2012/01/17 10:44:11 UTC

Dumb question about iPojo service structure

Howdy,

I have been following the tutorials on iPojo but have run into a snag.
>From most of the tutorials, you always have one service definition bundle, N service instances and then the consumers.

Is it not possible to have one service definition and on service instance in one bundle?
I'm just wondering.

btw: is there a guide to troubleshooting for iPojo anywhere? We are looking into Felix & iPojo as an alternative to JBoss and troubleshooting for JBoss was often a nightmare. So any effort towards improvement in that direction would be worth gold.

thanks

Frank
-- 
NEU: FreePhone - 0ct/min Handyspartarif mit Geld-zurück-Garantie!		
Jetzt informieren: http://www.gmx.net/de/go/freephone

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Dumb question about iPojo service structure

Posted by Stephan-Frank Henry <Fr...@gmx.net>.
Bengt,

On 18.01.2012, at 13:45, Bengt Rodehav wrote:

> Frank,
> 
> It's not the symbolic name that's important, it's the export directive.
> You
> need to make sure that the packages are exported.

Ah ok, yeah I like tripple checked them and they look good.
Perhaps I will see if any 'special hidden characters' has slipped in.

thanks for the tip though.

> 2012/1/18 Stephan-Frank Henry
> 
> > Hi,
> >
> > > On 18.01.2012, at 12:27, Bengt Rodehav wrote:
> > > I'm not an expert on either iPOJO or OSGi although I use them both.
> One
> > of
> > > the mistakes I sometimes do is to forget to export my packages. Since
> you
> > > have renamed the packages from the example you need to make sure that
> > > those
> > > packages are exported. Might be worth to check?
> > >
> > > /Bengt
> >
> > Thanks for the answer, but like in the examples I used the maven project
> > environment variable:
> > <Bundle-SymbolicName>
> >  ${project.artifactId}
> > </Bundle-SymbolicName>
> >
> > Though it is like that in the examples, it could also be wrong or
> > something is not picking it up. Really hard to trace any problems.
> >
> > br
> >
> > Frank
> >
> > > 2012/1/18 Stephan-Frank Henry
> > >
> > > >
> > > > On 17.01.2012, at 17:45, Stephan-Frank Henry wrote:
> > > > >
> > > > > On 17.01.2012, at 16:51, Clement Escoffier wrote:
> > > > >
> > > > > > Hi,
> > > > > >
> > > > > > On 17.01.2012, at 15:48, Stephan-Frank Henry wrote:
> > > > > >
> > > > > > >
> > > > > > > On 17.01.2012, at 11:51, Clement Escoffier  wrote:
> > > > > > >>
> > > > > > >> On 17.01.2012, at 11:42, Stephan-Frank Henry wrote:
> > > > > > >>
> > > > > > >>> Hi,
> > > > > > >>>
> > > > > > >>> first off, thanks for the feedback.
> > > > > > >>>
> > > > > > >>> On 17.01.2012, at 11:25, Clement Escoffier wrote:
> > > > > > >>>
> > > > > > >>>> Hi,
> > > > > > >>>>
> > > > > > >>>> On 17.01.2012, at 10:44, Stephan-Frank Henry wrote:
> > > > > > >>>>
> > > > > > >>>>> Howdy,
> > > > > > >>>>>
> > > > > > >>>>> I have been following the tutorials on iPojo but have run
> > into
> > > a
> > > > > > snag.
> > > > > > >>>>> From most of the tutorials, you always have one service
> > > > definition
> > > > > > >>>> bundle, N service instances and then the consumers.
> > > > > > >>>>>
> > > > > > >>>>> Is it not possible to have one service definition and on
> > > service
> > > > > > >>>> instance in one bundle?
> > > > > > >>>>> I'm just wondering.
> > > > > > >>>>
> > > > > > >>>> Of course :-)
> > > > > > >>>> The tutorial just use one of the good practice, but you can
> > > have
> > > > > > >>>> everything in one bundle. However, to really benefit from
> the
> > > > > > dynamism
> > > > > > >> when you
> > > > > > >>>> update service provider, it's recommended to package your
> > > service
> > > > > > >> interfaces
> > > > > > >>>> into a separated bundle (evolving more slowly than the
> > provider
> > > /
> > > > > > >> consumer
> > > > > > >>>> bundles).
> > > > > > >>>
> > > > > > >>> I thought so, though that means my code does not work. :(
> > > > > > >>> I followed the tutorials, but just kept the one service
> > > definition
> > > > > and
> > > > > > >> on service instance in one bundle.
> > > > > > >>>
> > > > > > >>> Though when I start felix, it always shows the consumer as
> > > invalid.
> > > > > > >>> If I remove the @Requires, it starts the consumer, but that
> is
> > > not
> > > > > > >> really the goal.
> > > > > > >>>
> > > > > > >>> ipojo:instances
> > > > > > >>> Instance ArchCommand -> valid
> > > > > > >>> Instance org.apache.felix.ipojo.arch.gogo.Arch-0 -> valid
> > > > > > >>> Instance HelloConsumer-0 -> invalid
> > > > > > >>>
> > > > > > >>> g! ipojo:factories
> > > > > > >>> Factory com.test.hello.HelloImpl (VALID)
> > > > > > >>> Factory HelloConsumer (VALID)
> > > > > > >>
> > > > > > >> It seems that the service provider is missing.
> > > > > > >> Could you check with ipojo:instance  HelloConsumer-0
> > > > > > >
> > > > > > > g! ipojo:instance  HelloConsumer-0
> > > > > > > instance name="HelloConsumer-0" component.type="HelloConsumer"
> > > > > > state="invalid" bundle="10"
> > > > > > >   handler name="org.apache.felix.ipojo:requires"
> state="invalid"
> > > > > > >           requires id="com.test.hello.Hello" aggregate="false"
> > > > proxy="true"
> > > > > > optional="false" state="unresolved"
> > > > specification="com.test.hello.Hello"
> > > > > > binding-policy="dynamic"
> > > > > > >   handler name="org.apache.felix.ipojo:callback" state="valid"
> > > > > > >   handler name="org.apache.felix.ipojo:architecture"
> > state="valid"
> > > > > > >
> > > > > > > Is there any way to see the providers? i.e. anything providing
> > > > > > "com.test.hello.Hello"?
> > > > > > >
> > > > > >
> > > > > > It looks like you don't have any service provider providing
> > > > > > com.test.hello.Hello.
> > > > > > In the tutorial, you have 3 bundles: a plain bundle containing
> the
> > > > > service
> > > > > > interface, and 2 iPOJO bundle (one publishing the service and
> one
> > > > > > consuming it).
> > > > >
> > > > > Yes, as I mentioned I have both the service definition and the
> > service
> > > > > provider in one bundle.
> > > > >
> > > > > I had used the iPojo some time before and know that it works if I
> > have
> > > > the
> > > > > 3 independent bundles. Though perhaps I will test it again, just
> to
> > be
> > > > > sure an update somewhere did not break the functionality.
> > > > >
> > > > > > >
> > > > > > > Also, since I am packaging both service and service provider
> into
> > > one
> > > > > > bundle, how does the pom.xml have to look like?
> > > > > > >
> > > > > > > <instructions>
> > > > > > > <Bundle-SymbolicName>${pom.artifactId}</Bundle-SymbolicName>
> > > > > > > <Export-Package>com.test.hello</Export-Package>
> > > > > > > </instructions>
> > > > > > >
> > > > > > > My impl (HelloImpl) is in the same package (com.test.hello).
> > > > > >
> > > > > > Then, you need to use the maven-ipojo-plugin for this bundle to
> > > prepare
> > > > > > the bundle to be managed by iPOJO. If you're using annotations,
> > just
> > > > add
> > > > > the
> > > > > > following XML snippet to your build section of your pom file:
> > > > > >
> > > > > > <plugin>
> > > > > >       <groupId>org.apache.felix</groupId>
> > > > > >       <artifactId>maven-ipojo-plugin</artifactId>
> > > > > >       <version>1.8.0</version>
> > > > > >       <executions>
> > > > > >        <execution>
> > > > > >            <goals>
> > > > > >                   <goal>ipojo-bundle</goal>
> > > > > >            </goals>
> > > > > >       </execution>
> > > > > >      </executions>
> > > > > > </plugin>
> > > > >
> > > > > I am exactly using that. I have built with package (usually
> enough)
> > > and
> > > > > install, with same results.
> > > > > So I am kinda confused what I really have to do to get it working.
> > > > >
> > > > > I have also tried out different combinations of what is in the
> > > examples
> > > > > and what is on the page, as well as Richard's book.
> > > > > Perhaps that is my problem. ;)
> > > > >
> > > > > I'll do the 3-bundle setup tomorrow and if that fixes everything,
> > I'll
> > > > > stick with it for now.
> > > > >
> > > >
> > > > Update:
> > > > after moving to the 3-bundle setup and creating a near 1:1 copy of
> the
> > > > examples from svn, it (the injection) is still not working.
> > > > Only the project and package names and the name of the
> Consumer/Client
> > > is
> > > > different.
> > > > I even copied the maven settings and all (source 1.5, plugin
> versions,
> > > no
> > > > junit). no luck.
> > > > Though I do not have the same module-based structure as in the
> > examples,
> > > I
> > > > did not see any module-parent level settings that are needed.
> > > >
> > > > some more info that might help:
> > > >    0|Active     |    0|System Bundle (4.0.2)
> > > >    1|Active     |    1|Apache Felix Gogo Command (0.12.0)
> > > >    2|Active     |    1|Apache Felix Gogo Runtime (0.10.0)
> > > >    3|Active     |    1|Apache Felix Gogo Shell (0.10.0)
> > > >    4|Active     |    1|Apache Felix iPOJO (1.8.0)
> > > >    5|Active     |    1|Apache Felix iPOJO Arch Command (1.6.0)
> > > >    6|Active     |    1|Apache Felix iPOJO Gogo Command (1.0.1)
> > > >    7|Active     |    1|Apache Felix iPOJO Composite (1.8.0)
> > > >    8|Active     |    1|Apache Felix Shell Service (1.4.2)
> > > >
> > > >
> > > > <groupId>org.apache.felix</groupId>
> > > > <artifactId>maven-ipojo-plugin</artifactId>
> > > > <!--version>1.8.0</version-->
> > > > <version>1.6.0</version><!-- examples mention 1.5.0-SNAPSHOT -->
> > > > neither version 'worked'
> > > >
> > > > <groupId>org.apache.felix</groupId>
> > > > <artifactId>maven-bundle-plugin</artifactId>
> > > > <!--version>2.3.6</version-->
> > > > <version>1.4.3</version>
> > > > neither version 'worked'
> > > >
> > > > Apache Maven 3.0.3
> > > > java version "1.6.0_26"
> > > > Ubuntu 11.04 natty 2.6.38-13-generic x86_64
> > > >
> > > > Dev environment Netbeans, though built from command line.
> > > > I also used sym-links to link in the bundles from a local
> repository.
> > > >
> > > > my startFelix.sh:
> > > > ## begin ##
> > > > _HOME_=$( dirname $(readlink -f $0 ))
> > > >
> > > >
> > _OPTS_="-Dfelix.config.properties=file:${_HOME_}/conf/config.properties"
> > > > _OPTS_="${_OPTS_}
> > > > -Dfelix.system.properties=file:${_HOME_}/conf/system.properties"
> > > > _OPTS_="${_OPTS_} -Dfelix.cm.dir=${_HOME_}/conf/"
> > > >
> > > > test -e ${_HOME_}/felix-cache/ && rm -rf ${_HOME_}/felix-cache/
> > > > mkdir -p ${_HOME_}/felix-cache/
> > > >
> > > > java -jar \
> > > >        ${_OPTS_} \
> > > >        ${_HOME_}/felix-framework-current/bin/felix.jar \
> > > >        ${_HOME_}/felix-cache/ \
> > > >        -b ${_HOME_}/auto-deploy/ \
> > > > ## end ##
> > > >
> > > > anything else needed?
> > > >
> > > > thanks
> > > >
> > > > Frank

-- 
Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir
belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Dumb question about iPojo service structure

Posted by Bengt Rodehav <be...@rodehav.com>.
Frank,

It's not the symbolic name that's important, it's the export directive. You
need to make sure that the packages are exported.

/Bengt

2012/1/18 Stephan-Frank Henry <Fr...@gmx.net>

> Hi,
>
> > On 18.01.2012, at 12:27, Bengt Rodehav wrote:
> > I'm not an expert on either iPOJO or OSGi although I use them both. One
> of
> > the mistakes I sometimes do is to forget to export my packages. Since you
> > have renamed the packages from the example you need to make sure that
> > those
> > packages are exported. Might be worth to check?
> >
> > /Bengt
>
> Thanks for the answer, but like in the examples I used the maven project
> environment variable:
> <Bundle-SymbolicName>
>  ${project.artifactId}
> </Bundle-SymbolicName>
>
> Though it is like that in the examples, it could also be wrong or
> something is not picking it up. Really hard to trace any problems.
>
> br
>
> Frank
>
> > 2012/1/18 Stephan-Frank Henry
> >
> > >
> > > On 17.01.2012, at 17:45, Stephan-Frank Henry wrote:
> > > >
> > > > On 17.01.2012, at 16:51, Clement Escoffier wrote:
> > > >
> > > > > Hi,
> > > > >
> > > > > On 17.01.2012, at 15:48, Stephan-Frank Henry wrote:
> > > > >
> > > > > >
> > > > > > On 17.01.2012, at 11:51, Clement Escoffier  wrote:
> > > > > >>
> > > > > >> On 17.01.2012, at 11:42, Stephan-Frank Henry wrote:
> > > > > >>
> > > > > >>> Hi,
> > > > > >>>
> > > > > >>> first off, thanks for the feedback.
> > > > > >>>
> > > > > >>> On 17.01.2012, at 11:25, Clement Escoffier wrote:
> > > > > >>>
> > > > > >>>> Hi,
> > > > > >>>>
> > > > > >>>> On 17.01.2012, at 10:44, Stephan-Frank Henry wrote:
> > > > > >>>>
> > > > > >>>>> Howdy,
> > > > > >>>>>
> > > > > >>>>> I have been following the tutorials on iPojo but have run
> into
> > a
> > > > > snag.
> > > > > >>>>> From most of the tutorials, you always have one service
> > > definition
> > > > > >>>> bundle, N service instances and then the consumers.
> > > > > >>>>>
> > > > > >>>>> Is it not possible to have one service definition and on
> > service
> > > > > >>>> instance in one bundle?
> > > > > >>>>> I'm just wondering.
> > > > > >>>>
> > > > > >>>> Of course :-)
> > > > > >>>> The tutorial just use one of the good practice, but you can
> > have
> > > > > >>>> everything in one bundle. However, to really benefit from the
> > > > > dynamism
> > > > > >> when you
> > > > > >>>> update service provider, it's recommended to package your
> > service
> > > > > >> interfaces
> > > > > >>>> into a separated bundle (evolving more slowly than the
> provider
> > /
> > > > > >> consumer
> > > > > >>>> bundles).
> > > > > >>>
> > > > > >>> I thought so, though that means my code does not work. :(
> > > > > >>> I followed the tutorials, but just kept the one service
> > definition
> > > > and
> > > > > >> on service instance in one bundle.
> > > > > >>>
> > > > > >>> Though when I start felix, it always shows the consumer as
> > invalid.
> > > > > >>> If I remove the @Requires, it starts the consumer, but that is
> > not
> > > > > >> really the goal.
> > > > > >>>
> > > > > >>> ipojo:instances
> > > > > >>> Instance ArchCommand -> valid
> > > > > >>> Instance org.apache.felix.ipojo.arch.gogo.Arch-0 -> valid
> > > > > >>> Instance HelloConsumer-0 -> invalid
> > > > > >>>
> > > > > >>> g! ipojo:factories
> > > > > >>> Factory com.test.hello.HelloImpl (VALID)
> > > > > >>> Factory HelloConsumer (VALID)
> > > > > >>
> > > > > >> It seems that the service provider is missing.
> > > > > >> Could you check with ipojo:instance  HelloConsumer-0
> > > > > >
> > > > > > g! ipojo:instance  HelloConsumer-0
> > > > > > instance name="HelloConsumer-0" component.type="HelloConsumer"
> > > > > state="invalid" bundle="10"
> > > > > >   handler name="org.apache.felix.ipojo:requires" state="invalid"
> > > > > >           requires id="com.test.hello.Hello" aggregate="false"
> > > proxy="true"
> > > > > optional="false" state="unresolved"
> > > specification="com.test.hello.Hello"
> > > > > binding-policy="dynamic"
> > > > > >   handler name="org.apache.felix.ipojo:callback" state="valid"
> > > > > >   handler name="org.apache.felix.ipojo:architecture"
> state="valid"
> > > > > >
> > > > > > Is there any way to see the providers? i.e. anything providing
> > > > > "com.test.hello.Hello"?
> > > > > >
> > > > >
> > > > > It looks like you don't have any service provider providing
> > > > > com.test.hello.Hello.
> > > > > In the tutorial, you have 3 bundles: a plain bundle containing the
> > > > service
> > > > > interface, and 2 iPOJO bundle (one publishing the service and one
> > > > > consuming it).
> > > >
> > > > Yes, as I mentioned I have both the service definition and the
> service
> > > > provider in one bundle.
> > > >
> > > > I had used the iPojo some time before and know that it works if I
> have
> > > the
> > > > 3 independent bundles. Though perhaps I will test it again, just to
> be
> > > > sure an update somewhere did not break the functionality.
> > > >
> > > > > >
> > > > > > Also, since I am packaging both service and service provider into
> > one
> > > > > bundle, how does the pom.xml have to look like?
> > > > > >
> > > > > > <instructions>
> > > > > > <Bundle-SymbolicName>${pom.artifactId}</Bundle-SymbolicName>
> > > > > > <Export-Package>com.test.hello</Export-Package>
> > > > > > </instructions>
> > > > > >
> > > > > > My impl (HelloImpl) is in the same package (com.test.hello).
> > > > >
> > > > > Then, you need to use the maven-ipojo-plugin for this bundle to
> > prepare
> > > > > the bundle to be managed by iPOJO. If you're using annotations,
> just
> > > add
> > > > the
> > > > > following XML snippet to your build section of your pom file:
> > > > >
> > > > > <plugin>
> > > > >       <groupId>org.apache.felix</groupId>
> > > > >       <artifactId>maven-ipojo-plugin</artifactId>
> > > > >       <version>1.8.0</version>
> > > > >       <executions>
> > > > >        <execution>
> > > > >            <goals>
> > > > >                   <goal>ipojo-bundle</goal>
> > > > >            </goals>
> > > > >       </execution>
> > > > >      </executions>
> > > > > </plugin>
> > > >
> > > > I am exactly using that. I have built with package (usually enough)
> > and
> > > > install, with same results.
> > > > So I am kinda confused what I really have to do to get it working.
> > > >
> > > > I have also tried out different combinations of what is in the
> > examples
> > > > and what is on the page, as well as Richard's book.
> > > > Perhaps that is my problem. ;)
> > > >
> > > > I'll do the 3-bundle setup tomorrow and if that fixes everything,
> I'll
> > > > stick with it for now.
> > > >
> > >
> > > Update:
> > > after moving to the 3-bundle setup and creating a near 1:1 copy of the
> > > examples from svn, it (the injection) is still not working.
> > > Only the project and package names and the name of the Consumer/Client
> > is
> > > different.
> > > I even copied the maven settings and all (source 1.5, plugin versions,
> > no
> > > junit). no luck.
> > > Though I do not have the same module-based structure as in the
> examples,
> > I
> > > did not see any module-parent level settings that are needed.
> > >
> > > some more info that might help:
> > >    0|Active     |    0|System Bundle (4.0.2)
> > >    1|Active     |    1|Apache Felix Gogo Command (0.12.0)
> > >    2|Active     |    1|Apache Felix Gogo Runtime (0.10.0)
> > >    3|Active     |    1|Apache Felix Gogo Shell (0.10.0)
> > >    4|Active     |    1|Apache Felix iPOJO (1.8.0)
> > >    5|Active     |    1|Apache Felix iPOJO Arch Command (1.6.0)
> > >    6|Active     |    1|Apache Felix iPOJO Gogo Command (1.0.1)
> > >    7|Active     |    1|Apache Felix iPOJO Composite (1.8.0)
> > >    8|Active     |    1|Apache Felix Shell Service (1.4.2)
> > >
> > >
> > > <groupId>org.apache.felix</groupId>
> > > <artifactId>maven-ipojo-plugin</artifactId>
> > > <!--version>1.8.0</version-->
> > > <version>1.6.0</version><!-- examples mention 1.5.0-SNAPSHOT -->
> > > neither version 'worked'
> > >
> > > <groupId>org.apache.felix</groupId>
> > > <artifactId>maven-bundle-plugin</artifactId>
> > > <!--version>2.3.6</version-->
> > > <version>1.4.3</version>
> > > neither version 'worked'
> > >
> > > Apache Maven 3.0.3
> > > java version "1.6.0_26"
> > > Ubuntu 11.04 natty 2.6.38-13-generic x86_64
> > >
> > > Dev environment Netbeans, though built from command line.
> > > I also used sym-links to link in the bundles from a local repository.
> > >
> > > my startFelix.sh:
> > > ## begin ##
> > > _HOME_=$( dirname $(readlink -f $0 ))
> > >
> > >
> _OPTS_="-Dfelix.config.properties=file:${_HOME_}/conf/config.properties"
> > > _OPTS_="${_OPTS_}
> > > -Dfelix.system.properties=file:${_HOME_}/conf/system.properties"
> > > _OPTS_="${_OPTS_} -Dfelix.cm.dir=${_HOME_}/conf/"
> > >
> > > test -e ${_HOME_}/felix-cache/ && rm -rf ${_HOME_}/felix-cache/
> > > mkdir -p ${_HOME_}/felix-cache/
> > >
> > > java -jar \
> > >        ${_OPTS_} \
> > >        ${_HOME_}/felix-framework-current/bin/felix.jar \
> > >        ${_HOME_}/felix-cache/ \
> > >        -b ${_HOME_}/auto-deploy/ \
> > > ## end ##
> > >
> > > anything else needed?
> > >
> > > thanks
> > >
> > > Frank
>
> --
> Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir
> belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>

Re: Dumb question about iPojo service structure

Posted by Stephan-Frank Henry <Fr...@gmx.net>.
Hi,

> On 18.01.2012, at 12:27, Bengt Rodehav wrote:
> I'm not an expert on either iPOJO or OSGi although I use them both. One of
> the mistakes I sometimes do is to forget to export my packages. Since you
> have renamed the packages from the example you need to make sure that
> those
> packages are exported. Might be worth to check?
> 
> /Bengt

Thanks for the answer, but like in the examples I used the maven project environment variable:
<Bundle-SymbolicName>
  ${project.artifactId}
</Bundle-SymbolicName>

Though it is like that in the examples, it could also be wrong or something is not picking it up. Really hard to trace any problems.

br

Frank
 
> 2012/1/18 Stephan-Frank Henry
> 
> >
> > On 17.01.2012, at 17:45, Stephan-Frank Henry wrote:
> > >
> > > On 17.01.2012, at 16:51, Clement Escoffier wrote:
> > >
> > > > Hi,
> > > >
> > > > On 17.01.2012, at 15:48, Stephan-Frank Henry wrote:
> > > >
> > > > >
> > > > > On 17.01.2012, at 11:51, Clement Escoffier  wrote:
> > > > >>
> > > > >> On 17.01.2012, at 11:42, Stephan-Frank Henry wrote:
> > > > >>
> > > > >>> Hi,
> > > > >>>
> > > > >>> first off, thanks for the feedback.
> > > > >>>
> > > > >>> On 17.01.2012, at 11:25, Clement Escoffier wrote:
> > > > >>>
> > > > >>>> Hi,
> > > > >>>>
> > > > >>>> On 17.01.2012, at 10:44, Stephan-Frank Henry wrote:
> > > > >>>>
> > > > >>>>> Howdy,
> > > > >>>>>
> > > > >>>>> I have been following the tutorials on iPojo but have run into
> a
> > > > snag.
> > > > >>>>> From most of the tutorials, you always have one service
> > definition
> > > > >>>> bundle, N service instances and then the consumers.
> > > > >>>>>
> > > > >>>>> Is it not possible to have one service definition and on
> service
> > > > >>>> instance in one bundle?
> > > > >>>>> I'm just wondering.
> > > > >>>>
> > > > >>>> Of course :-)
> > > > >>>> The tutorial just use one of the good practice, but you can
> have
> > > > >>>> everything in one bundle. However, to really benefit from the
> > > > dynamism
> > > > >> when you
> > > > >>>> update service provider, it's recommended to package your
> service
> > > > >> interfaces
> > > > >>>> into a separated bundle (evolving more slowly than the provider
> /
> > > > >> consumer
> > > > >>>> bundles).
> > > > >>>
> > > > >>> I thought so, though that means my code does not work. :(
> > > > >>> I followed the tutorials, but just kept the one service
> definition
> > > and
> > > > >> on service instance in one bundle.
> > > > >>>
> > > > >>> Though when I start felix, it always shows the consumer as
> invalid.
> > > > >>> If I remove the @Requires, it starts the consumer, but that is
> not
> > > > >> really the goal.
> > > > >>>
> > > > >>> ipojo:instances
> > > > >>> Instance ArchCommand -> valid
> > > > >>> Instance org.apache.felix.ipojo.arch.gogo.Arch-0 -> valid
> > > > >>> Instance HelloConsumer-0 -> invalid
> > > > >>>
> > > > >>> g! ipojo:factories
> > > > >>> Factory com.test.hello.HelloImpl (VALID)
> > > > >>> Factory HelloConsumer (VALID)
> > > > >>
> > > > >> It seems that the service provider is missing.
> > > > >> Could you check with ipojo:instance  HelloConsumer-0
> > > > >
> > > > > g! ipojo:instance  HelloConsumer-0
> > > > > instance name="HelloConsumer-0" component.type="HelloConsumer"
> > > > state="invalid" bundle="10"
> > > > >   handler name="org.apache.felix.ipojo:requires" state="invalid"
> > > > >           requires id="com.test.hello.Hello" aggregate="false"
> > proxy="true"
> > > > optional="false" state="unresolved"
> > specification="com.test.hello.Hello"
> > > > binding-policy="dynamic"
> > > > >   handler name="org.apache.felix.ipojo:callback" state="valid"
> > > > >   handler name="org.apache.felix.ipojo:architecture" state="valid"
> > > > >
> > > > > Is there any way to see the providers? i.e. anything providing
> > > > "com.test.hello.Hello"?
> > > > >
> > > >
> > > > It looks like you don't have any service provider providing
> > > > com.test.hello.Hello.
> > > > In the tutorial, you have 3 bundles: a plain bundle containing the
> > > service
> > > > interface, and 2 iPOJO bundle (one publishing the service and one
> > > > consuming it).
> > >
> > > Yes, as I mentioned I have both the service definition and the service
> > > provider in one bundle.
> > >
> > > I had used the iPojo some time before and know that it works if I have
> > the
> > > 3 independent bundles. Though perhaps I will test it again, just to be
> > > sure an update somewhere did not break the functionality.
> > >
> > > > >
> > > > > Also, since I am packaging both service and service provider into
> one
> > > > bundle, how does the pom.xml have to look like?
> > > > >
> > > > > <instructions>
> > > > > <Bundle-SymbolicName>${pom.artifactId}</Bundle-SymbolicName>
> > > > > <Export-Package>com.test.hello</Export-Package>
> > > > > </instructions>
> > > > >
> > > > > My impl (HelloImpl) is in the same package (com.test.hello).
> > > >
> > > > Then, you need to use the maven-ipojo-plugin for this bundle to
> prepare
> > > > the bundle to be managed by iPOJO. If you're using annotations, just
> > add
> > > the
> > > > following XML snippet to your build section of your pom file:
> > > >
> > > > <plugin>
> > > >       <groupId>org.apache.felix</groupId>
> > > >       <artifactId>maven-ipojo-plugin</artifactId>
> > > >       <version>1.8.0</version>
> > > >       <executions>
> > > >        <execution>
> > > >            <goals>
> > > >                   <goal>ipojo-bundle</goal>
> > > >            </goals>
> > > >       </execution>
> > > >      </executions>
> > > > </plugin>
> > >
> > > I am exactly using that. I have built with package (usually enough)
> and
> > > install, with same results.
> > > So I am kinda confused what I really have to do to get it working.
> > >
> > > I have also tried out different combinations of what is in the
> examples
> > > and what is on the page, as well as Richard's book.
> > > Perhaps that is my problem. ;)
> > >
> > > I'll do the 3-bundle setup tomorrow and if that fixes everything, I'll
> > > stick with it for now.
> > >
> >
> > Update:
> > after moving to the 3-bundle setup and creating a near 1:1 copy of the
> > examples from svn, it (the injection) is still not working.
> > Only the project and package names and the name of the Consumer/Client
> is
> > different.
> > I even copied the maven settings and all (source 1.5, plugin versions,
> no
> > junit). no luck.
> > Though I do not have the same module-based structure as in the examples,
> I
> > did not see any module-parent level settings that are needed.
> >
> > some more info that might help:
> >    0|Active     |    0|System Bundle (4.0.2)
> >    1|Active     |    1|Apache Felix Gogo Command (0.12.0)
> >    2|Active     |    1|Apache Felix Gogo Runtime (0.10.0)
> >    3|Active     |    1|Apache Felix Gogo Shell (0.10.0)
> >    4|Active     |    1|Apache Felix iPOJO (1.8.0)
> >    5|Active     |    1|Apache Felix iPOJO Arch Command (1.6.0)
> >    6|Active     |    1|Apache Felix iPOJO Gogo Command (1.0.1)
> >    7|Active     |    1|Apache Felix iPOJO Composite (1.8.0)
> >    8|Active     |    1|Apache Felix Shell Service (1.4.2)
> >
> >
> > <groupId>org.apache.felix</groupId>
> > <artifactId>maven-ipojo-plugin</artifactId>
> > <!--version>1.8.0</version-->
> > <version>1.6.0</version><!-- examples mention 1.5.0-SNAPSHOT -->
> > neither version 'worked'
> >
> > <groupId>org.apache.felix</groupId>
> > <artifactId>maven-bundle-plugin</artifactId>
> > <!--version>2.3.6</version-->
> > <version>1.4.3</version>
> > neither version 'worked'
> >
> > Apache Maven 3.0.3
> > java version "1.6.0_26"
> > Ubuntu 11.04 natty 2.6.38-13-generic x86_64
> >
> > Dev environment Netbeans, though built from command line.
> > I also used sym-links to link in the bundles from a local repository.
> >
> > my startFelix.sh:
> > ## begin ##
> > _HOME_=$( dirname $(readlink -f $0 ))
> >
> > _OPTS_="-Dfelix.config.properties=file:${_HOME_}/conf/config.properties"
> > _OPTS_="${_OPTS_}
> > -Dfelix.system.properties=file:${_HOME_}/conf/system.properties"
> > _OPTS_="${_OPTS_} -Dfelix.cm.dir=${_HOME_}/conf/"
> >
> > test -e ${_HOME_}/felix-cache/ && rm -rf ${_HOME_}/felix-cache/
> > mkdir -p ${_HOME_}/felix-cache/
> >
> > java -jar \
> >        ${_OPTS_} \
> >        ${_HOME_}/felix-framework-current/bin/felix.jar \
> >        ${_HOME_}/felix-cache/ \
> >        -b ${_HOME_}/auto-deploy/ \
> > ## end ##
> >
> > anything else needed?
> >
> > thanks
> >
> > Frank

-- 
Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir
belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Dumb question about iPojo service structure

Posted by Bengt Rodehav <be...@rodehav.com>.
I'm not an expert on either iPOJO or OSGi although I use them both. One of
the mistakes I sometimes do is to forget to export my packages. Since you
have renamed the packages from the example you need to make sure that those
packages are exported. Might be worth to check?

/Bengt

2012/1/18 Stephan-Frank Henry <Fr...@gmx.net>

>
> On 17.01.2012, at 17:45, Stephan-Frank Henry wrote:
> >
> > On 17.01.2012, at 16:51, Clement Escoffier wrote:
> >
> > > Hi,
> > >
> > > On 17.01.2012, at 15:48, Stephan-Frank Henry wrote:
> > >
> > > >
> > > > On 17.01.2012, at 11:51, Clement Escoffier  wrote:
> > > >>
> > > >> On 17.01.2012, at 11:42, Stephan-Frank Henry wrote:
> > > >>
> > > >>> Hi,
> > > >>>
> > > >>> first off, thanks for the feedback.
> > > >>>
> > > >>> On 17.01.2012, at 11:25, Clement Escoffier wrote:
> > > >>>
> > > >>>> Hi,
> > > >>>>
> > > >>>> On 17.01.2012, at 10:44, Stephan-Frank Henry wrote:
> > > >>>>
> > > >>>>> Howdy,
> > > >>>>>
> > > >>>>> I have been following the tutorials on iPojo but have run into a
> > > snag.
> > > >>>>> From most of the tutorials, you always have one service
> definition
> > > >>>> bundle, N service instances and then the consumers.
> > > >>>>>
> > > >>>>> Is it not possible to have one service definition and on service
> > > >>>> instance in one bundle?
> > > >>>>> I'm just wondering.
> > > >>>>
> > > >>>> Of course :-)
> > > >>>> The tutorial just use one of the good practice, but you can have
> > > >>>> everything in one bundle. However, to really benefit from the
> > > dynamism
> > > >> when you
> > > >>>> update service provider, it's recommended to package your service
> > > >> interfaces
> > > >>>> into a separated bundle (evolving more slowly than the provider /
> > > >> consumer
> > > >>>> bundles).
> > > >>>
> > > >>> I thought so, though that means my code does not work. :(
> > > >>> I followed the tutorials, but just kept the one service definition
> > and
> > > >> on service instance in one bundle.
> > > >>>
> > > >>> Though when I start felix, it always shows the consumer as invalid.
> > > >>> If I remove the @Requires, it starts the consumer, but that is not
> > > >> really the goal.
> > > >>>
> > > >>> ipojo:instances
> > > >>> Instance ArchCommand -> valid
> > > >>> Instance org.apache.felix.ipojo.arch.gogo.Arch-0 -> valid
> > > >>> Instance HelloConsumer-0 -> invalid
> > > >>>
> > > >>> g! ipojo:factories
> > > >>> Factory com.test.hello.HelloImpl (VALID)
> > > >>> Factory HelloConsumer (VALID)
> > > >>
> > > >> It seems that the service provider is missing.
> > > >> Could you check with ipojo:instance  HelloConsumer-0
> > > >
> > > > g! ipojo:instance  HelloConsumer-0
> > > > instance name="HelloConsumer-0" component.type="HelloConsumer"
> > > state="invalid" bundle="10"
> > > >   handler name="org.apache.felix.ipojo:requires" state="invalid"
> > > >           requires id="com.test.hello.Hello" aggregate="false"
> proxy="true"
> > > optional="false" state="unresolved"
> specification="com.test.hello.Hello"
> > > binding-policy="dynamic"
> > > >   handler name="org.apache.felix.ipojo:callback" state="valid"
> > > >   handler name="org.apache.felix.ipojo:architecture" state="valid"
> > > >
> > > > Is there any way to see the providers? i.e. anything providing
> > > "com.test.hello.Hello"?
> > > >
> > >
> > > It looks like you don't have any service provider providing
> > > com.test.hello.Hello.
> > > In the tutorial, you have 3 bundles: a plain bundle containing the
> > service
> > > interface, and 2 iPOJO bundle (one publishing the service and one
> > > consuming it).
> >
> > Yes, as I mentioned I have both the service definition and the service
> > provider in one bundle.
> >
> > I had used the iPojo some time before and know that it works if I have
> the
> > 3 independent bundles. Though perhaps I will test it again, just to be
> > sure an update somewhere did not break the functionality.
> >
> > > >
> > > > Also, since I am packaging both service and service provider into one
> > > bundle, how does the pom.xml have to look like?
> > > >
> > > > <instructions>
> > > > <Bundle-SymbolicName>${pom.artifactId}</Bundle-SymbolicName>
> > > > <Export-Package>com.test.hello</Export-Package>
> > > > </instructions>
> > > >
> > > > My impl (HelloImpl) is in the same package (com.test.hello).
> > >
> > > Then, you need to use the maven-ipojo-plugin for this bundle to prepare
> > > the bundle to be managed by iPOJO. If you're using annotations, just
> add
> > the
> > > following XML snippet to your build section of your pom file:
> > >
> > > <plugin>
> > >       <groupId>org.apache.felix</groupId>
> > >       <artifactId>maven-ipojo-plugin</artifactId>
> > >       <version>1.8.0</version>
> > >       <executions>
> > >        <execution>
> > >            <goals>
> > >                   <goal>ipojo-bundle</goal>
> > >            </goals>
> > >       </execution>
> > >      </executions>
> > > </plugin>
> >
> > I am exactly using that. I have built with package (usually enough) and
> > install, with same results.
> > So I am kinda confused what I really have to do to get it working.
> >
> > I have also tried out different combinations of what is in the examples
> > and what is on the page, as well as Richard's book.
> > Perhaps that is my problem. ;)
> >
> > I'll do the 3-bundle setup tomorrow and if that fixes everything, I'll
> > stick with it for now.
> >
>
> Update:
> after moving to the 3-bundle setup and creating a near 1:1 copy of the
> examples from svn, it (the injection) is still not working.
> Only the project and package names and the name of the Consumer/Client is
> different.
> I even copied the maven settings and all (source 1.5, plugin versions, no
> junit). no luck.
> Though I do not have the same module-based structure as in the examples, I
> did not see any module-parent level settings that are needed.
>
> some more info that might help:
>    0|Active     |    0|System Bundle (4.0.2)
>    1|Active     |    1|Apache Felix Gogo Command (0.12.0)
>    2|Active     |    1|Apache Felix Gogo Runtime (0.10.0)
>    3|Active     |    1|Apache Felix Gogo Shell (0.10.0)
>    4|Active     |    1|Apache Felix iPOJO (1.8.0)
>    5|Active     |    1|Apache Felix iPOJO Arch Command (1.6.0)
>    6|Active     |    1|Apache Felix iPOJO Gogo Command (1.0.1)
>    7|Active     |    1|Apache Felix iPOJO Composite (1.8.0)
>    8|Active     |    1|Apache Felix Shell Service (1.4.2)
>
>
> <groupId>org.apache.felix</groupId>
> <artifactId>maven-ipojo-plugin</artifactId>
> <!--version>1.8.0</version-->
> <version>1.6.0</version><!-- examples mention 1.5.0-SNAPSHOT -->
> neither version 'worked'
>
> <groupId>org.apache.felix</groupId>
> <artifactId>maven-bundle-plugin</artifactId>
> <!--version>2.3.6</version-->
> <version>1.4.3</version>
> neither version 'worked'
>
> Apache Maven 3.0.3
> java version "1.6.0_26"
> Ubuntu 11.04 natty 2.6.38-13-generic x86_64
>
> Dev environment Netbeans, though built from command line.
> I also used sym-links to link in the bundles from a local repository.
>
> my startFelix.sh:
> ## begin ##
> _HOME_=$( dirname $(readlink -f $0 ))
>
> _OPTS_="-Dfelix.config.properties=file:${_HOME_}/conf/config.properties"
> _OPTS_="${_OPTS_}
> -Dfelix.system.properties=file:${_HOME_}/conf/system.properties"
> _OPTS_="${_OPTS_} -Dfelix.cm.dir=${_HOME_}/conf/"
>
> test -e ${_HOME_}/felix-cache/ && rm -rf ${_HOME_}/felix-cache/
> mkdir -p ${_HOME_}/felix-cache/
>
> java -jar \
>        ${_OPTS_} \
>        ${_HOME_}/felix-framework-current/bin/felix.jar \
>        ${_HOME_}/felix-cache/ \
>        -b ${_HOME_}/auto-deploy/ \
> ## end ##
>
> anything else needed?
>
> thanks
>
> Frank
> --
> Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir
> belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>

Re: Dumb question about iPojo service structure

Posted by Stephan-Frank Henry <Fr...@gmx.net>.
On 17.01.2012, at 17:45, Stephan-Frank Henry wrote:
>
> On 17.01.2012, at 16:51, Clement Escoffier wrote:
> 
> > Hi,
> > 
> > On 17.01.2012, at 15:48, Stephan-Frank Henry wrote:
> > 
> > > 
> > > On 17.01.2012, at 11:51, Clement Escoffier  wrote:
> > >> 
> > >> On 17.01.2012, at 11:42, Stephan-Frank Henry wrote:
> > >> 
> > >>> Hi,
> > >>> 
> > >>> first off, thanks for the feedback.
> > >>> 
> > >>> On 17.01.2012, at 11:25, Clement Escoffier wrote:
> > >>> 
> > >>>> Hi,
> > >>>> 
> > >>>> On 17.01.2012, at 10:44, Stephan-Frank Henry wrote:
> > >>>> 
> > >>>>> Howdy,
> > >>>>> 
> > >>>>> I have been following the tutorials on iPojo but have run into a
> > snag.
> > >>>>> From most of the tutorials, you always have one service definition
> > >>>> bundle, N service instances and then the consumers.
> > >>>>> 
> > >>>>> Is it not possible to have one service definition and on service
> > >>>> instance in one bundle?
> > >>>>> I'm just wondering.
> > >>>> 
> > >>>> Of course :-)
> > >>>> The tutorial just use one of the good practice, but you can have
> > >>>> everything in one bundle. However, to really benefit from the
> > dynamism
> > >> when you
> > >>>> update service provider, it's recommended to package your service
> > >> interfaces
> > >>>> into a separated bundle (evolving more slowly than the provider /
> > >> consumer
> > >>>> bundles).
> > >>> 
> > >>> I thought so, though that means my code does not work. :(
> > >>> I followed the tutorials, but just kept the one service definition
> and
> > >> on service instance in one bundle.
> > >>> 
> > >>> Though when I start felix, it always shows the consumer as invalid.
> > >>> If I remove the @Requires, it starts the consumer, but that is not
> > >> really the goal.
> > >>> 
> > >>> ipojo:instances
> > >>> Instance ArchCommand -> valid 
> > >>> Instance org.apache.felix.ipojo.arch.gogo.Arch-0 -> valid 
> > >>> Instance HelloConsumer-0 -> invalid 
> > >>> 
> > >>> g! ipojo:factories
> > >>> Factory com.test.hello.HelloImpl (VALID) 
> > >>> Factory HelloConsumer (VALID) 
> > >> 
> > >> It seems that the service provider is missing.
> > >> Could you check with ipojo:instance  HelloConsumer-0
> > > 
> > > g! ipojo:instance  HelloConsumer-0
> > > instance name="HelloConsumer-0" component.type="HelloConsumer"
> > state="invalid" bundle="10"
> > > 	handler name="org.apache.felix.ipojo:requires" state="invalid"
> > > 		requires id="com.test.hello.Hello" aggregate="false" proxy="true"
> > optional="false" state="unresolved" specification="com.test.hello.Hello"
> > binding-policy="dynamic"
> > > 	handler name="org.apache.felix.ipojo:callback" state="valid"
> > > 	handler name="org.apache.felix.ipojo:architecture" state="valid"
> > > 
> > > Is there any way to see the providers? i.e. anything providing
> > "com.test.hello.Hello"?
> > > 
> > 
> > It looks like you don't have any service provider providing
> > com.test.hello.Hello. 
> > In the tutorial, you have 3 bundles: a plain bundle containing the
> service
> > interface, and 2 iPOJO bundle (one publishing the service and one
> > consuming it).
> 
> Yes, as I mentioned I have both the service definition and the service
> provider in one bundle.
> 
> I had used the iPojo some time before and know that it works if I have the
> 3 independent bundles. Though perhaps I will test it again, just to be
> sure an update somewhere did not break the functionality.
> 
> > > 
> > > Also, since I am packaging both service and service provider into one
> > bundle, how does the pom.xml have to look like?
> > > 
> > > <instructions>
> > > <Bundle-SymbolicName>${pom.artifactId}</Bundle-SymbolicName>
> > > <Export-Package>com.test.hello</Export-Package>
> > > </instructions>
> > > 
> > > My impl (HelloImpl) is in the same package (com.test.hello).
> > 
> > Then, you need to use the maven-ipojo-plugin for this bundle to prepare
> > the bundle to be managed by iPOJO. If you're using annotations, just add
> the
> > following XML snippet to your build section of your pom file:
> > 
> > <plugin>
> >       <groupId>org.apache.felix</groupId>
> >       <artifactId>maven-ipojo-plugin</artifactId>
> >       <version>1.8.0</version>
> >       <executions>
> > 	   <execution>
> > 	       <goals>
> > 	              <goal>ipojo-bundle</goal>
> > 	       </goals>
> > 	  </execution>
> >      </executions>
> > </plugin>
> 
> I am exactly using that. I have built with package (usually enough) and
> install, with same results.
> So I am kinda confused what I really have to do to get it working.
> 
> I have also tried out different combinations of what is in the examples
> and what is on the page, as well as Richard's book.
> Perhaps that is my problem. ;)
> 
> I'll do the 3-bundle setup tomorrow and if that fixes everything, I'll
> stick with it for now.
> 

Update:
after moving to the 3-bundle setup and creating a near 1:1 copy of the examples from svn, it (the injection) is still not working.
Only the project and package names and the name of the Consumer/Client is different.
I even copied the maven settings and all (source 1.5, plugin versions, no junit). no luck.
Though I do not have the same module-based structure as in the examples, I did not see any module-parent level settings that are needed.

some more info that might help:
    0|Active     |    0|System Bundle (4.0.2)
    1|Active     |    1|Apache Felix Gogo Command (0.12.0)
    2|Active     |    1|Apache Felix Gogo Runtime (0.10.0)
    3|Active     |    1|Apache Felix Gogo Shell (0.10.0)
    4|Active     |    1|Apache Felix iPOJO (1.8.0)
    5|Active     |    1|Apache Felix iPOJO Arch Command (1.6.0)
    6|Active     |    1|Apache Felix iPOJO Gogo Command (1.0.1)
    7|Active     |    1|Apache Felix iPOJO Composite (1.8.0)
    8|Active     |    1|Apache Felix Shell Service (1.4.2)


<groupId>org.apache.felix</groupId>
<artifactId>maven-ipojo-plugin</artifactId>
<!--version>1.8.0</version-->
<version>1.6.0</version><!-- examples mention 1.5.0-SNAPSHOT -->
neither version 'worked'

<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<!--version>2.3.6</version-->
<version>1.4.3</version>
neither version 'worked'

Apache Maven 3.0.3
java version "1.6.0_26"
Ubuntu 11.04 natty 2.6.38-13-generic x86_64

Dev environment Netbeans, though built from command line.
I also used sym-links to link in the bundles from a local repository.

my startFelix.sh:
## begin ##
_HOME_=$( dirname $(readlink -f $0 ))

_OPTS_="-Dfelix.config.properties=file:${_HOME_}/conf/config.properties"
_OPTS_="${_OPTS_} -Dfelix.system.properties=file:${_HOME_}/conf/system.properties"
_OPTS_="${_OPTS_} -Dfelix.cm.dir=${_HOME_}/conf/"

test -e ${_HOME_}/felix-cache/ && rm -rf ${_HOME_}/felix-cache/
mkdir -p ${_HOME_}/felix-cache/

java -jar \
	${_OPTS_} \
	${_HOME_}/felix-framework-current/bin/felix.jar \
	${_HOME_}/felix-cache/ \
	-b ${_HOME_}/auto-deploy/ \
## end ##

anything else needed?

thanks

Frank
-- 
Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir
belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Dumb question about iPojo service structure

Posted by Stephan-Frank Henry <Fr...@gmx.net>.
On 17.01.2012, at 16:51, Clement Escoffier wrote:

> Hi,
> 
> On 17.01.2012, at 15:48, Stephan-Frank Henry wrote:
> 
> > 
> > On 17.01.2012, at 11:51, Clement Escoffier  wrote:
> >> 
> >> On 17.01.2012, at 11:42, Stephan-Frank Henry wrote:
> >> 
> >>> Hi,
> >>> 
> >>> first off, thanks for the feedback.
> >>> 
> >>> On 17.01.2012, at 11:25, Clement Escoffier wrote:
> >>> 
> >>>> Hi,
> >>>> 
> >>>> On 17.01.2012, at 10:44, Stephan-Frank Henry wrote:
> >>>> 
> >>>>> Howdy,
> >>>>> 
> >>>>> I have been following the tutorials on iPojo but have run into a
> snag.
> >>>>> From most of the tutorials, you always have one service definition
> >>>> bundle, N service instances and then the consumers.
> >>>>> 
> >>>>> Is it not possible to have one service definition and on service
> >>>> instance in one bundle?
> >>>>> I'm just wondering.
> >>>> 
> >>>> Of course :-)
> >>>> The tutorial just use one of the good practice, but you can have
> >>>> everything in one bundle. However, to really benefit from the
> dynamism
> >> when you
> >>>> update service provider, it's recommended to package your service
> >> interfaces
> >>>> into a separated bundle (evolving more slowly than the provider /
> >> consumer
> >>>> bundles).
> >>> 
> >>> I thought so, though that means my code does not work. :(
> >>> I followed the tutorials, but just kept the one service definition and
> >> on service instance in one bundle.
> >>> 
> >>> Though when I start felix, it always shows the consumer as invalid.
> >>> If I remove the @Requires, it starts the consumer, but that is not
> >> really the goal.
> >>> 
> >>> ipojo:instances
> >>> Instance ArchCommand -> valid 
> >>> Instance org.apache.felix.ipojo.arch.gogo.Arch-0 -> valid 
> >>> Instance HelloConsumer-0 -> invalid 
> >>> 
> >>> g! ipojo:factories
> >>> Factory com.test.hello.HelloImpl (VALID) 
> >>> Factory HelloConsumer (VALID) 
> >> 
> >> It seems that the service provider is missing.
> >> Could you check with ipojo:instance  HelloConsumer-0
> > 
> > g! ipojo:instance  HelloConsumer-0
> > instance name="HelloConsumer-0" component.type="HelloConsumer"
> state="invalid" bundle="10"
> > 	handler name="org.apache.felix.ipojo:requires" state="invalid"
> > 		requires id="com.test.hello.Hello" aggregate="false" proxy="true"
> optional="false" state="unresolved" specification="com.test.hello.Hello"
> binding-policy="dynamic"
> > 	handler name="org.apache.felix.ipojo:callback" state="valid"
> > 	handler name="org.apache.felix.ipojo:architecture" state="valid"
> > 
> > Is there any way to see the providers? i.e. anything providing
> "com.test.hello.Hello"?
> > 
> 
> It looks like you don't have any service provider providing
> com.test.hello.Hello. 
> In the tutorial, you have 3 bundles: a plain bundle containing the service
> interface, and 2 iPOJO bundle (one publishing the service and one
> consuming it).

Yes, as I mentioned I have both the service definition and the service provider in one bundle.

I had used the iPojo some time before and know that it works if I have the 3 independent bundles. Though perhaps I will test it again, just to be sure an update somewhere did not break the functionality.

> > 
> > Also, since I am packaging both service and service provider into one
> bundle, how does the pom.xml have to look like?
> > 
> > <instructions>
> > <Bundle-SymbolicName>${pom.artifactId}</Bundle-SymbolicName>
> > <Export-Package>com.test.hello</Export-Package>
> > </instructions>
> > 
> > My impl (HelloImpl) is in the same package (com.test.hello).
> 
> Then, you need to use the maven-ipojo-plugin for this bundle to prepare
> the bundle to be managed by iPOJO. If you're using annotations, just add the
> following XML snippet to your build section of your pom file:
> 
> <plugin>
>       <groupId>org.apache.felix</groupId>
>       <artifactId>maven-ipojo-plugin</artifactId>
>       <version>1.8.0</version>
>       <executions>
> 	   <execution>
> 	       <goals>
> 	              <goal>ipojo-bundle</goal>
> 	       </goals>
> 	  </execution>
>      </executions>
> </plugin>

I am exactly using that. I have built with package (usually enough) and install, with same results.
So I am kinda confused what I really have to do to get it working.

I have also tried out different combinations of what is in the examples and what is on the page, as well as Richard's book.
Perhaps that is my problem. ;)

I'll do the 3-bundle setup tomorrow and if that fixes everything, I'll stick with it for now.

thanks again

br

Frank
-- 
NEU: FreePhone - 0ct/min Handyspartarif mit Geld-zurück-Garantie!		
Jetzt informieren: http://www.gmx.net/de/go/freephone

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Dumb question about iPojo service structure

Posted by Clement Escoffier <cl...@gmail.com>.
Hi,

On 17.01.2012, at 15:48, Stephan-Frank Henry wrote:

> 
> On 17.01.2012, at 11:51, Clement Escoffier  wrote:
>> 
>> On 17.01.2012, at 11:42, Stephan-Frank Henry wrote:
>> 
>>> Hi,
>>> 
>>> first off, thanks for the feedback.
>>> 
>>> On 17.01.2012, at 11:25, Clement Escoffier wrote:
>>> 
>>>> Hi,
>>>> 
>>>> On 17.01.2012, at 10:44, Stephan-Frank Henry wrote:
>>>> 
>>>>> Howdy,
>>>>> 
>>>>> I have been following the tutorials on iPojo but have run into a snag.
>>>>> From most of the tutorials, you always have one service definition
>>>> bundle, N service instances and then the consumers.
>>>>> 
>>>>> Is it not possible to have one service definition and on service
>>>> instance in one bundle?
>>>>> I'm just wondering.
>>>> 
>>>> Of course :-)
>>>> The tutorial just use one of the good practice, but you can have
>>>> everything in one bundle. However, to really benefit from the dynamism
>> when you
>>>> update service provider, it's recommended to package your service
>> interfaces
>>>> into a separated bundle (evolving more slowly than the provider /
>> consumer
>>>> bundles).
>>> 
>>> I thought so, though that means my code does not work. :(
>>> I followed the tutorials, but just kept the one service definition and
>> on service instance in one bundle.
>>> 
>>> Though when I start felix, it always shows the consumer as invalid.
>>> If I remove the @Requires, it starts the consumer, but that is not
>> really the goal.
>>> 
>>> ipojo:instances
>>> Instance ArchCommand -> valid 
>>> Instance org.apache.felix.ipojo.arch.gogo.Arch-0 -> valid 
>>> Instance HelloConsumer-0 -> invalid 
>>> 
>>> g! ipojo:factories
>>> Factory com.test.hello.HelloImpl (VALID) 
>>> Factory HelloConsumer (VALID) 
>> 
>> It seems that the service provider is missing.
>> Could you check with ipojo:instance  HelloConsumer-0
> 
> g! ipojo:instance  HelloConsumer-0
> instance name="HelloConsumer-0" component.type="HelloConsumer" state="invalid" bundle="10"
> 	handler name="org.apache.felix.ipojo:requires" state="invalid"
> 		requires id="com.test.hello.Hello" aggregate="false" proxy="true" optional="false" state="unresolved" specification="com.test.hello.Hello" binding-policy="dynamic"
> 	handler name="org.apache.felix.ipojo:callback" state="valid"
> 	handler name="org.apache.felix.ipojo:architecture" state="valid"
> 
> Is there any way to see the providers? i.e. anything providing "com.test.hello.Hello"?
> 

It looks like you don't have any service provider providing com.test.hello.Hello. 
In the tutorial, you have 3 bundles: a plain bundle containing the service interface, and 2 iPOJO bundle (one publishing the service and one consuming it).

> 
> Also, since I am packaging both service and service provider into one bundle, how does the pom.xml have to look like?
> 
> <instructions>
> <Bundle-SymbolicName>${pom.artifactId}</Bundle-SymbolicName>
> <Export-Package>com.test.hello</Export-Package>
> </instructions>
> 
> My impl (HelloImpl) is in the same package (com.test.hello).

Then, you need to use the maven-ipojo-plugin for this bundle to prepare the bundle to be managed by iPOJO. If you're using annotations, just add the following XML snippet to your build section of your pom file:

<plugin>
      <groupId>org.apache.felix</groupId>
      <artifactId>maven-ipojo-plugin</artifactId>
      <version>1.8.0</version>
      <executions>
	   <execution>
	       <goals>
	              <goal>ipojo-bundle</goal>
	       </goals>
	  </execution>
     </executions>
</plugin>

Regards,

Clement

> 
> thanks!
> -- 
> NEU: FreePhone - 0ct/min Handyspartarif mit Geld-zurück-Garantie!		
> Jetzt informieren: http://www.gmx.net/de/go/freephone
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Dumb question about iPojo service structure

Posted by Stephan-Frank Henry <Fr...@gmx.net>.
On 17.01.2012, at 11:51, Clement Escoffier  wrote:
> 
> On 17.01.2012, at 11:42, Stephan-Frank Henry wrote:
> 
> > Hi,
> > 
> > first off, thanks for the feedback.
> > 
> > On 17.01.2012, at 11:25, Clement Escoffier wrote:
> > 
> >> Hi,
> >> 
> >> On 17.01.2012, at 10:44, Stephan-Frank Henry wrote:
> >> 
> >>> Howdy,
> >>> 
> >>> I have been following the tutorials on iPojo but have run into a snag.
> >>> From most of the tutorials, you always have one service definition
> >> bundle, N service instances and then the consumers.
> >>> 
> >>> Is it not possible to have one service definition and on service
> >> instance in one bundle?
> >>> I'm just wondering.
> >> 
> >> Of course :-)
> >> The tutorial just use one of the good practice, but you can have
> >> everything in one bundle. However, to really benefit from the dynamism
> when you
> >> update service provider, it's recommended to package your service
> interfaces
> >> into a separated bundle (evolving more slowly than the provider /
> consumer
> >> bundles).
> > 
> > I thought so, though that means my code does not work. :(
> > I followed the tutorials, but just kept the one service definition and
> on service instance in one bundle.
> > 
> > Though when I start felix, it always shows the consumer as invalid.
> > If I remove the @Requires, it starts the consumer, but that is not
> really the goal.
> > 
> > ipojo:instances
> > Instance ArchCommand -> valid 
> > Instance org.apache.felix.ipojo.arch.gogo.Arch-0 -> valid 
> > Instance HelloConsumer-0 -> invalid 
> > 
> > g! ipojo:factories
> > Factory com.test.hello.HelloImpl (VALID) 
> > Factory HelloConsumer (VALID) 
> 
> It seems that the service provider is missing.
> Could you check with ipojo:instance  HelloConsumer-0

g! ipojo:instance  HelloConsumer-0
instance name="HelloConsumer-0" component.type="HelloConsumer" state="invalid" bundle="10"
	handler name="org.apache.felix.ipojo:requires" state="invalid"
		requires id="com.test.hello.Hello" aggregate="false" proxy="true" optional="false" state="unresolved" specification="com.test.hello.Hello" binding-policy="dynamic"
	handler name="org.apache.felix.ipojo:callback" state="valid"
	handler name="org.apache.felix.ipojo:architecture" state="valid"

Is there any way to see the providers? i.e. anything providing "com.test.hello.Hello"?


Also, since I am packaging both service and service provider into one bundle, how does the pom.xml have to look like?

<instructions>
 <Bundle-SymbolicName>${pom.artifactId}</Bundle-SymbolicName>
 <Export-Package>com.test.hello</Export-Package>
</instructions>

My impl (HelloImpl) is in the same package (com.test.hello).

thanks!
-- 
NEU: FreePhone - 0ct/min Handyspartarif mit Geld-zurück-Garantie!		
Jetzt informieren: http://www.gmx.net/de/go/freephone

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Dumb question about iPojo service structure

Posted by Clement Escoffier <cl...@gmail.com>.
On 17.01.2012, at 11:42, Stephan-Frank Henry wrote:

> Hi,
> 
> first off, thanks for the feedback.
> 
> On 17.01.2012, at 11:25, Clement Escoffier wrote:
> 
>> Hi,
>> 
>> On 17.01.2012, at 10:44, Stephan-Frank Henry wrote:
>> 
>>> Howdy,
>>> 
>>> I have been following the tutorials on iPojo but have run into a snag.
>>> From most of the tutorials, you always have one service definition
>> bundle, N service instances and then the consumers.
>>> 
>>> Is it not possible to have one service definition and on service
>> instance in one bundle?
>>> I'm just wondering.
>> 
>> Of course :-)
>> The tutorial just use one of the good practice, but you can have
>> everything in one bundle. However, to really benefit from the dynamism when you
>> update service provider, it's recommended to package your service interfaces
>> into a separated bundle (evolving more slowly than the provider / consumer
>> bundles).
> 
> I thought so, though that means my code does not work. :(
> I followed the tutorials, but just kept the one service definition and on service instance in one bundle.
> 
> Though when I start felix, it always shows the consumer as invalid.
> If I remove the @Requires, it starts the consumer, but that is not really the goal.
> 
> ipojo:instances
> Instance ArchCommand -> valid 
> Instance org.apache.felix.ipojo.arch.gogo.Arch-0 -> valid 
> Instance HelloConsumer-0 -> invalid 
> 
> g! ipojo:factories
> Factory com.test.hello.HelloImpl (VALID) 
> Factory HelloConsumer (VALID) 

It seems that the service provider is missing.
Could you check with ipojo:instance  HelloConsumer-0


Regards,

Clement


> 
> Been trying anything I could think of for a few days now, sadly without any positive results.
> 
> any ideas?
> 
> thanks
> 
>>> 
>>> btw: is there a guide to troubleshooting for iPojo anywhere? We are
>> looking into Felix & iPojo as an alternative to JBoss and troubleshooting for
>> JBoss was often a nightmare. So any effort towards improvement in that
>> direction would be worth gold.
>> 
>> One of the main tools for troubleshooting iPOJO application is 'arch'.
>> Each iPOJO instance exposes an Architecture service to introspect its state
>> and the connections with other instances. 
>> 'Arch' is available from command line
>> (http://felix.apache.org/site/ipojo-arch-command.html) and from the web console
>> (http://felix.apache.org/site/ipojo-webconsole-plugin.html).
> 
> great, thanks!
> 
> -- 
> NEU: FreePhone - 0ct/min Handyspartarif mit Geld-zurück-Garantie!		
> Jetzt informieren: http://www.gmx.net/de/go/freephone
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Dumb question about iPojo service structure

Posted by Stephan-Frank Henry <Fr...@gmx.net>.
Hello,

> On 19.01.2012, at 10:43, Clement Escoffier wrote:

<snip>
> Also check that the provider instance is also created. (either declared
> using XML or using @Instantiate)

Doh! Bingo!
I had missed it because in contrast to the client, who has the metadata.xml in the root dir of the project, the impl has it in the src/main/resources.
The hello.impl (non annotated version) also has it in the root.

Thanks a lot Clement! Now Felix survives this step of the evaluation phase to fight more battles. ;)

br

Frank
-- 
Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir
belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Dumb question about iPojo service structure

Posted by Clement Escoffier <cl...@gmail.com>.
Hi,

On 19.01.2012, at 09:56, Stephan-Frank Henry wrote:

> Hi,
> 
>> On 18.01.2012, at 20:18, Stephan-Frank Henry wrote:
>> 
>> Hi,
>> 
>> On 18.01.2012, at 16:59, Stephan-Frank Henry wrote:
>> 
>>> On 17.01.2012, at 13:10, Guillaume Sauthier wrote:
>>> 
>>>> Looks like you have no instance of the HelloImpl component
>>>> Can you check that this component also provides a service (using
>> @Provides
>>>> for example) ?
>>> 
>>> Yes, I have virtually the same as in the examples located under
>>> 
>> https://svn.apache.org/repos/asf/felix/trunk/ipojo/examples/tutorial-maven
>>> 
>>> I actually did diffs with meld to see that they are the same. ;)
>>> Perhaps there have been some changes in iPojo since the examples have
>> last been updated and thus some default behaviour or another no longer
>> happens.
>> 
>> The examples work perfectly with the latest iPOJO version (just tried
>> myself):
>> g! bundles
>>    0|Active     |    0|org.apache.felix.framework (4.0.2)
>>    1|Active     |    1|org.apache.felix.bundlerepository (1.6.6)
>>    2|Active     |    1|org.apache.felix.gogo.command (0.12.0)
>>    3|Active     |    1|org.apache.felix.gogo.runtime (0.10.0)
>>    4|Active     |    1|org.apache.felix.gogo.shell (0.10.0)
>>    5|Active     |    1|org.apache.felix.ipojo (1.8.0)
>>    6|Active     |    1|org.apache.felix.ipojo.arch.gogo (1.0.1)
>> 
>> g! 
>> g! 
>> g! 
>> g! install
>> file:///Users/clement/tmp/ipojo-tutorial/hello.service/target/hello.service-1.5.0-SNAPSHOT.jar
>> Bundle ID: 8
>> g! 
>> g! start 8
>> g! 
>> g! start
>> file:///Users/clement/tmp/ipojo-tutorial/hello.impl/target/hello.impl-1.5.0-SNAPSHOT.jar 
>> g! start
>> file:///Users/clement/tmp/ipojo-tutorial/hello.client/target/hello.client-1.5.0-SNAPSHOT.jar
>> g! [WARNING] ipojo.example.hello.client.HelloClient : The 'name' (clement)
>> attribute, used as the instance name, is deprecated, please use the
>> 'instance.name' attribute
>> hello clement
>> 
>> 
>> ----
>> 
>> The annotation version is also working:
>> g! lb
>> START LEVEL 1
>>   ID|State      |Level|Name
>>    0|Active     |    0|System Bundle (4.0.2)
>>    1|Active     |    1|Hello Service Client using Annotations
>> (1.5.0.SNAPSHOT)
>>    2|Active     |    1|Hello Service Provider using Annotations
>> (1.5.0.SNAPSHOT)
>>    3|Active     |    1|Apache Felix Bundle Repository (1.6.6)
>>    4|Active     |    1|Apache Felix Gogo Command (0.12.0)
>>    5|Active     |    1|Apache Felix Gogo Runtime (0.10.0)
>>    6|Active     |    1|Apache Felix Gogo Shell (0.10.0)
>>    7|Active     |    1|Apache Felix iPOJO (1.8.0)
>>    8|Active     |    1|Apache Felix iPOJO Gogo Command (1.0.1)
>>    9|Active     |    1|Hello Service (1.5.0.SNAPSHOT)
>> g! ipojo.example.hello.Hello$$Proxy@2eb1074a
>> hello Clement  @ipojo.example.hello.Hello$$Proxy@2eb1074a
>> 
>> Could you tell me if you're using the annotation version or the xml
>> version. From your architecture output, it seems that the provider is missing.
>> So, either you moves the service provider call but didn't update the
>> metadata.xml, or your bundle does not contain the provider classes. You can check
>> that by looking at the content of your bundle (check that the provider class
>> is here) and the content of the metadata.xml.
> 
> I am using the annotated version, but with a metadata.xml for the consumer to create an instance.
> 
> Currently I am fighting with maven and nexus so I can build the examples. Then I will test them with my installed version. I'll report back on my results.

Also check that the provider instance is also created. (either declared using XML or using @Instantiate)

Regards,

Clement

> 
> thanks & br
> 
> Frank
> -- 
> Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir
> belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Dumb question about iPojo service structure

Posted by Stephan-Frank Henry <Fr...@gmx.net>.
Hi,

> On 18.01.2012, at 20:18, Stephan-Frank Henry wrote:
>
> Hi,
> 
> On 18.01.2012, at 16:59, Stephan-Frank Henry wrote:
> 
> > On 17.01.2012, at 13:10, Guillaume Sauthier wrote:
> > 
> >> Looks like you have no instance of the HelloImpl component
> >> Can you check that this component also provides a service (using
> @Provides
> >> for example) ?
> > 
> > Yes, I have virtually the same as in the examples located under
> >
> https://svn.apache.org/repos/asf/felix/trunk/ipojo/examples/tutorial-maven
> > 
> > I actually did diffs with meld to see that they are the same. ;)
> > Perhaps there have been some changes in iPojo since the examples have
> last been updated and thus some default behaviour or another no longer
> happens.
> 
> The examples work perfectly with the latest iPOJO version (just tried
> myself):
> g! bundles
>     0|Active     |    0|org.apache.felix.framework (4.0.2)
>     1|Active     |    1|org.apache.felix.bundlerepository (1.6.6)
>     2|Active     |    1|org.apache.felix.gogo.command (0.12.0)
>     3|Active     |    1|org.apache.felix.gogo.runtime (0.10.0)
>     4|Active     |    1|org.apache.felix.gogo.shell (0.10.0)
>     5|Active     |    1|org.apache.felix.ipojo (1.8.0)
>     6|Active     |    1|org.apache.felix.ipojo.arch.gogo (1.0.1)
> 
> g! 
> g! 
> g! 
> g! install
> file:///Users/clement/tmp/ipojo-tutorial/hello.service/target/hello.service-1.5.0-SNAPSHOT.jar
> Bundle ID: 8
> g! 
> g! start 8
> g! 
> g! start
> file:///Users/clement/tmp/ipojo-tutorial/hello.impl/target/hello.impl-1.5.0-SNAPSHOT.jar 
> g! start
> file:///Users/clement/tmp/ipojo-tutorial/hello.client/target/hello.client-1.5.0-SNAPSHOT.jar
> g! [WARNING] ipojo.example.hello.client.HelloClient : The 'name' (clement)
> attribute, used as the instance name, is deprecated, please use the
> 'instance.name' attribute
> hello clement
> 
> 
> ----
> 
> The annotation version is also working:
> g! lb
> START LEVEL 1
>    ID|State      |Level|Name
>     0|Active     |    0|System Bundle (4.0.2)
>     1|Active     |    1|Hello Service Client using Annotations
> (1.5.0.SNAPSHOT)
>     2|Active     |    1|Hello Service Provider using Annotations
> (1.5.0.SNAPSHOT)
>     3|Active     |    1|Apache Felix Bundle Repository (1.6.6)
>     4|Active     |    1|Apache Felix Gogo Command (0.12.0)
>     5|Active     |    1|Apache Felix Gogo Runtime (0.10.0)
>     6|Active     |    1|Apache Felix Gogo Shell (0.10.0)
>     7|Active     |    1|Apache Felix iPOJO (1.8.0)
>     8|Active     |    1|Apache Felix iPOJO Gogo Command (1.0.1)
>     9|Active     |    1|Hello Service (1.5.0.SNAPSHOT)
> g! ipojo.example.hello.Hello$$Proxy@2eb1074a
> hello Clement  @ipojo.example.hello.Hello$$Proxy@2eb1074a
> 
> Could you tell me if you're using the annotation version or the xml
> version. From your architecture output, it seems that the provider is missing.
> So, either you moves the service provider call but didn't update the
> metadata.xml, or your bundle does not contain the provider classes. You can check
> that by looking at the content of your bundle (check that the provider class
> is here) and the content of the metadata.xml.

I am using the annotated version, but with a metadata.xml for the consumer to create an instance.

Currently I am fighting with maven and nexus so I can build the examples. Then I will test them with my installed version. I'll report back on my results.

thanks & br

Frank
-- 
Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir
belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Dumb question about iPojo service structure

Posted by Clement Escoffier <cl...@gmail.com>.
Hi,

On 18.01.2012, at 16:59, Stephan-Frank Henry wrote:

> On 17.01.2012, at 13:10, Guillaume Sauthier wrote:
> 
>> Looks like you have no instance of the HelloImpl component
>> Can you check that this component also provides a service (using @Provides
>> for example) ?
> 
> Yes, I have virtually the same as in the examples located under
> https://svn.apache.org/repos/asf/felix/trunk/ipojo/examples/tutorial-maven
> 
> I actually did diffs with meld to see that they are the same. ;)
> Perhaps there have been some changes in iPojo since the examples have last been updated and thus some default behaviour or another no longer happens.

The examples work perfectly with the latest iPOJO version (just tried myself):
g! bundles
    0|Active     |    0|org.apache.felix.framework (4.0.2)
    1|Active     |    1|org.apache.felix.bundlerepository (1.6.6)
    2|Active     |    1|org.apache.felix.gogo.command (0.12.0)
    3|Active     |    1|org.apache.felix.gogo.runtime (0.10.0)
    4|Active     |    1|org.apache.felix.gogo.shell (0.10.0)
    5|Active     |    1|org.apache.felix.ipojo (1.8.0)
    6|Active     |    1|org.apache.felix.ipojo.arch.gogo (1.0.1)

g! 
g! 
g! 
g! install file:///Users/clement/tmp/ipojo-tutorial/hello.service/target/hello.service-1.5.0-SNAPSHOT.jar
Bundle ID: 8
g! 
g! start 8
g! 
g! start file:///Users/clement/tmp/ipojo-tutorial/hello.impl/target/hello.impl-1.5.0-SNAPSHOT.jar 
g! start file:///Users/clement/tmp/ipojo-tutorial/hello.client/target/hello.client-1.5.0-SNAPSHOT.jar
g! [WARNING] ipojo.example.hello.client.HelloClient : The 'name' (clement) attribute, used as the instance name, is deprecated, please use the 'instance.name' attribute
hello clement


----

The annotation version is also working:
g! lb
START LEVEL 1
   ID|State      |Level|Name
    0|Active     |    0|System Bundle (4.0.2)
    1|Active     |    1|Hello Service Client using Annotations (1.5.0.SNAPSHOT)
    2|Active     |    1|Hello Service Provider using Annotations (1.5.0.SNAPSHOT)
    3|Active     |    1|Apache Felix Bundle Repository (1.6.6)
    4|Active     |    1|Apache Felix Gogo Command (0.12.0)
    5|Active     |    1|Apache Felix Gogo Runtime (0.10.0)
    6|Active     |    1|Apache Felix Gogo Shell (0.10.0)
    7|Active     |    1|Apache Felix iPOJO (1.8.0)
    8|Active     |    1|Apache Felix iPOJO Gogo Command (1.0.1)
    9|Active     |    1|Hello Service (1.5.0.SNAPSHOT)
g! ipojo.example.hello.Hello$$Proxy@2eb1074a
hello Clement  @ipojo.example.hello.Hello$$Proxy@2eb1074a

Could you tell me if you're using the annotation version or the xml version. From your architecture output, it seems that the provider is missing. So, either you moves the service provider call but didn't update the metadata.xml, or your bundle does not contain the provider classes. You can check that by looking at the content of your bundle (check that the provider class is here) and the content of the metadata.xml.

Regards,

Clement




> 
> But thanks for the tips.
> 
> Perhaps you or others could create a working sample (plus details on what versions are being used)?
> 
> thanks & br
> 
> Frank
> 
>> 
>> 2012/1/17 Stephan-Frank Henry
>> 
>>> Hi,
>>> 
>>> first off, thanks for the feedback.
>>> 
>>> On 17.01.2012, at 11:25, Clement Escoffier wrote:
>>> 
>>>> Hi,
>>>> 
>>>> On 17.01.2012, at 10:44, Stephan-Frank Henry wrote:
>>>> 
>>>>> Howdy,
>>>>> 
>>>>> I have been following the tutorials on iPojo but have run into a
>> snag.
>>>>> From most of the tutorials, you always have one service definition
>>>> bundle, N service instances and then the consumers.
>>>>> 
>>>>> Is it not possible to have one service definition and on service
>>>> instance in one bundle?
>>>>> I'm just wondering.
>>>> 
>>>> Of course :-)
>>>> The tutorial just use one of the good practice, but you can have
>>>> everything in one bundle. However, to really benefit from the dynamism
>>> when you
>>>> update service provider, it's recommended to package your service
>>> interfaces
>>>> into a separated bundle (evolving more slowly than the provider /
>>> consumer
>>>> bundles).
>>> 
>>> I thought so, though that means my code does not work. :(
>>> I followed the tutorials, but just kept the one service definition and
>> on
>>> service instance in one bundle.
>>> 
>>> Though when I start felix, it always shows the consumer as invalid.
>>> If I remove the @Requires, it starts the consumer, but that is not
>> really
>>> the goal.
>>> 
>>> ipojo:instances
>>> Instance ArchCommand -> valid
>>> Instance org.apache.felix.ipojo.arch.gogo.Arch-0 -> valid
>>> Instance HelloConsumer-0 -> invalid
>>> 
>>> g! ipojo:factories
>>> Factory com.test.hello.HelloImpl (VALID)
>>> Factory HelloConsumer (VALID)
>>> 
>>> Been trying anything I could think of for a few days now, sadly without
>>> any positive results.
>>> 
>>> any ideas?
>>> 
>>> thanks
>>> 
>>>>> 
>>>>> btw: is there a guide to troubleshooting for iPojo anywhere? We are
>>>> looking into Felix & iPojo as an alternative to JBoss and
>>> troubleshooting for
>>>> JBoss was often a nightmare. So any effort towards improvement in that
>>>> direction would be worth gold.
>>>> 
>>>> One of the main tools for troubleshooting iPOJO application is 'arch'.
>>>> Each iPOJO instance exposes an Architecture service to introspect its
>>> state
>>>> and the connections with other instances.
>>>> 'Arch' is available from command line
>>>> (http://felix.apache.org/site/ipojo-arch-command.html) and from the
>> web
>>> console
>>>> (http://felix.apache.org/site/ipojo-webconsole-plugin.html).
>>> 
>>> great, thanks!
> 
> -- 
> Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir
> belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Dumb question about iPojo service structure

Posted by Stephan-Frank Henry <Fr...@gmx.net>.
On 17.01.2012, at 13:10, Guillaume Sauthier wrote:

> Looks like you have no instance of the HelloImpl component
> Can you check that this component also provides a service (using @Provides
> for example) ?

Yes, I have virtually the same as in the examples located under
https://svn.apache.org/repos/asf/felix/trunk/ipojo/examples/tutorial-maven

I actually did diffs with meld to see that they are the same. ;)
Perhaps there have been some changes in iPojo since the examples have last been updated and thus some default behaviour or another no longer happens.

But thanks for the tips.

Perhaps you or others could create a working sample (plus details on what versions are being used)?

thanks & br

Frank

> 
> 2012/1/17 Stephan-Frank Henry
> 
> > Hi,
> >
> > first off, thanks for the feedback.
> >
> > On 17.01.2012, at 11:25, Clement Escoffier wrote:
> >
> > > Hi,
> > >
> > > On 17.01.2012, at 10:44, Stephan-Frank Henry wrote:
> > >
> > > > Howdy,
> > > >
> > > > I have been following the tutorials on iPojo but have run into a
> snag.
> > > > From most of the tutorials, you always have one service definition
> > > bundle, N service instances and then the consumers.
> > > >
> > > > Is it not possible to have one service definition and on service
> > > instance in one bundle?
> > > > I'm just wondering.
> > >
> > > Of course :-)
> > > The tutorial just use one of the good practice, but you can have
> > > everything in one bundle. However, to really benefit from the dynamism
> > when you
> > > update service provider, it's recommended to package your service
> > interfaces
> > > into a separated bundle (evolving more slowly than the provider /
> > consumer
> > > bundles).
> >
> > I thought so, though that means my code does not work. :(
> > I followed the tutorials, but just kept the one service definition and
> on
> > service instance in one bundle.
> >
> > Though when I start felix, it always shows the consumer as invalid.
> > If I remove the @Requires, it starts the consumer, but that is not
> really
> > the goal.
> >
> > ipojo:instances
> > Instance ArchCommand -> valid
> > Instance org.apache.felix.ipojo.arch.gogo.Arch-0 -> valid
> > Instance HelloConsumer-0 -> invalid
> >
> > g! ipojo:factories
> > Factory com.test.hello.HelloImpl (VALID)
> > Factory HelloConsumer (VALID)
> >
> > Been trying anything I could think of for a few days now, sadly without
> > any positive results.
> >
> > any ideas?
> >
> > thanks
> >
> > > >
> > > > btw: is there a guide to troubleshooting for iPojo anywhere? We are
> > > looking into Felix & iPojo as an alternative to JBoss and
> > troubleshooting for
> > > JBoss was often a nightmare. So any effort towards improvement in that
> > > direction would be worth gold.
> > >
> > > One of the main tools for troubleshooting iPOJO application is 'arch'.
> > > Each iPOJO instance exposes an Architecture service to introspect its
> > state
> > > and the connections with other instances.
> > > 'Arch' is available from command line
> > > (http://felix.apache.org/site/ipojo-arch-command.html) and from the
> web
> > console
> > > (http://felix.apache.org/site/ipojo-webconsole-plugin.html).
> >
> > great, thanks!

-- 
Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir
belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Dumb question about iPojo service structure

Posted by "Guillaume Sauthier (Objectweb)" <gu...@objectweb.org>.
Looks like you have no instance of the HelloImpl component
Can you check that this component also provides a service (using @Provides
for example) ?

--G

2012/1/17 Stephan-Frank Henry <Fr...@gmx.net>

> Hi,
>
> first off, thanks for the feedback.
>
> On 17.01.2012, at 11:25, Clement Escoffier wrote:
>
> > Hi,
> >
> > On 17.01.2012, at 10:44, Stephan-Frank Henry wrote:
> >
> > > Howdy,
> > >
> > > I have been following the tutorials on iPojo but have run into a snag.
> > > From most of the tutorials, you always have one service definition
> > bundle, N service instances and then the consumers.
> > >
> > > Is it not possible to have one service definition and on service
> > instance in one bundle?
> > > I'm just wondering.
> >
> > Of course :-)
> > The tutorial just use one of the good practice, but you can have
> > everything in one bundle. However, to really benefit from the dynamism
> when you
> > update service provider, it's recommended to package your service
> interfaces
> > into a separated bundle (evolving more slowly than the provider /
> consumer
> > bundles).
>
> I thought so, though that means my code does not work. :(
> I followed the tutorials, but just kept the one service definition and on
> service instance in one bundle.
>
> Though when I start felix, it always shows the consumer as invalid.
> If I remove the @Requires, it starts the consumer, but that is not really
> the goal.
>
> ipojo:instances
> Instance ArchCommand -> valid
> Instance org.apache.felix.ipojo.arch.gogo.Arch-0 -> valid
> Instance HelloConsumer-0 -> invalid
>
> g! ipojo:factories
> Factory com.test.hello.HelloImpl (VALID)
> Factory HelloConsumer (VALID)
>
> Been trying anything I could think of for a few days now, sadly without
> any positive results.
>
> any ideas?
>
> thanks
>
> > >
> > > btw: is there a guide to troubleshooting for iPojo anywhere? We are
> > looking into Felix & iPojo as an alternative to JBoss and
> troubleshooting for
> > JBoss was often a nightmare. So any effort towards improvement in that
> > direction would be worth gold.
> >
> > One of the main tools for troubleshooting iPOJO application is 'arch'.
> > Each iPOJO instance exposes an Architecture service to introspect its
> state
> > and the connections with other instances.
> > 'Arch' is available from command line
> > (http://felix.apache.org/site/ipojo-arch-command.html) and from the web
> console
> > (http://felix.apache.org/site/ipojo-webconsole-plugin.html).
>
> great, thanks!
>
> --
> NEU: FreePhone - 0ct/min Handyspartarif mit Geld-zurück-Garantie!
> Jetzt informieren: http://www.gmx.net/de/go/freephone
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>

Re: Dumb question about iPojo service structure

Posted by Stephan-Frank Henry <Fr...@gmx.net>.
Hi,

first off, thanks for the feedback.

On 17.01.2012, at 11:25, Clement Escoffier wrote:

> Hi,
> 
> On 17.01.2012, at 10:44, Stephan-Frank Henry wrote:
> 
> > Howdy,
> > 
> > I have been following the tutorials on iPojo but have run into a snag.
> > From most of the tutorials, you always have one service definition
> bundle, N service instances and then the consumers.
> > 
> > Is it not possible to have one service definition and on service
> instance in one bundle?
> > I'm just wondering.
> 
> Of course :-)
> The tutorial just use one of the good practice, but you can have
> everything in one bundle. However, to really benefit from the dynamism when you
> update service provider, it's recommended to package your service interfaces
> into a separated bundle (evolving more slowly than the provider / consumer
> bundles).

I thought so, though that means my code does not work. :(
I followed the tutorials, but just kept the one service definition and on service instance in one bundle.

Though when I start felix, it always shows the consumer as invalid.
If I remove the @Requires, it starts the consumer, but that is not really the goal.

ipojo:instances
Instance ArchCommand -> valid 
Instance org.apache.felix.ipojo.arch.gogo.Arch-0 -> valid 
Instance HelloConsumer-0 -> invalid 

g! ipojo:factories
Factory com.test.hello.HelloImpl (VALID) 
Factory HelloConsumer (VALID) 

Been trying anything I could think of for a few days now, sadly without any positive results.

any ideas?

thanks

> > 
> > btw: is there a guide to troubleshooting for iPojo anywhere? We are
> looking into Felix & iPojo as an alternative to JBoss and troubleshooting for
> JBoss was often a nightmare. So any effort towards improvement in that
> direction would be worth gold.
> 
> One of the main tools for troubleshooting iPOJO application is 'arch'.
> Each iPOJO instance exposes an Architecture service to introspect its state
> and the connections with other instances. 
> 'Arch' is available from command line
> (http://felix.apache.org/site/ipojo-arch-command.html) and from the web console
> (http://felix.apache.org/site/ipojo-webconsole-plugin.html).

great, thanks!

-- 
NEU: FreePhone - 0ct/min Handyspartarif mit Geld-zurück-Garantie!		
Jetzt informieren: http://www.gmx.net/de/go/freephone

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Dumb question about iPojo service structure

Posted by Clement Escoffier <cl...@gmail.com>.
Hi,

On 17.01.2012, at 10:44, Stephan-Frank Henry wrote:

> Howdy,
> 
> I have been following the tutorials on iPojo but have run into a snag.
> From most of the tutorials, you always have one service definition bundle, N service instances and then the consumers.
> 
> Is it not possible to have one service definition and on service instance in one bundle?
> I'm just wondering.

Of course :-)
The tutorial just use one of the good practice, but you can have everything in one bundle. However, to really benefit from the dynamism when you update service provider, it's recommended to package your service interfaces into a separated bundle (evolving more slowly than the provider / consumer bundles).

> 
> btw: is there a guide to troubleshooting for iPojo anywhere? We are looking into Felix & iPojo as an alternative to JBoss and troubleshooting for JBoss was often a nightmare. So any effort towards improvement in that direction would be worth gold.

One of the main tools for troubleshooting iPOJO application is 'arch'. Each iPOJO instance exposes an Architecture service to introspect its state and the connections with other instances. 
'Arch' is available from command line (http://felix.apache.org/site/ipojo-arch-command.html) and from the web console (http://felix.apache.org/site/ipojo-webconsole-plugin.html).

Regards,

Clement

> 
> thanks
> 
> Frank
> -- 
> NEU: FreePhone - 0ct/min Handyspartarif mit Geld-zurück-Garantie!		
> Jetzt informieren: http://www.gmx.net/de/go/freephone
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>