felix-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexey Romanov <alexey.v.roma...@gmail.com>
Subject Re: iPOJO BND Plugin
Date Wed, 11 Apr 2012 06:08:39 GMT
This gave me a suspicion, which turned out to be correct: after adding
<component className="org.example.ExampleComponent"/> to metadata.xml
I get "I'm constructed" in output and

IPOJO-Components = instance {
$component="org.example.ExampleComponent" }component {
$classname="org.example.ExampleComponent" manipulation { method {
$name="$init" }method { $arguments="{java.lang.String}"
$name="sayHello" $return="java.lang.String" }method { $name="start"
}method { $name="stop" }interface { $name="org.example.api.Greeting"
}}}

in header. But still no result from @Validate @Invalidate annotations,
and I _really_ don't want to have to do everything in XML :(

Yours, Alexey Romanov



On Tue, Apr 10, 2012 at 18:34, Guillaume Sauthier (Objectweb)
<guillaume.sauthier@objectweb.org> wrote:
> Looks like the IPOJO-Components manifest's heasder is missing the component
> type description (something like component {class="some java class name",
> ....})
>
> Are you using annotations or XML file for declaring your components ?
> Can you show me your metadata.xml ?
>
> --G
>
> 2012/4/10 Alexey Romanov <alexey.v.romanov@gmail.com>
>
>> Yes, just built it. Still no success:
>>
>> -> ps
>> START LEVEL 1
>>   ID   State         Level  Name
>> [   0] [Active     ] [    0] System Bundle (4.0.1)
>> [   1] [Active     ] [    1] Apache Felix Shell Service (1.4.2)
>> [   2] [Active     ] [    1] BndToolsTest (0)
>> [   3] [Active     ] [    1] Apache Felix iPOJO Arch Command (1.6.0)
>> [   4] [Active     ] [    1] Apache Felix iPOJO URL Handler (1.6.0)
>> [   5] [Active     ] [    1] Apache Felix Shell TUI (1.4.1)
>> [   6] [Active     ] [    1] Apache Felix iPOJO (1.8.2)
>> [   7] [Active     ] [    1] Apache Felix Declarative Services (1.6.0)
>> [   8] [Active     ] [    1] osgi.cmpn (4.2.1.201001051203)
>> [   9] [Active     ] [    1] BndToolsTestIPojo (0.0.1)
>> -> headers 9
>>
>> BndToolsTestIPojo (9)
>> ---------------------
>> Bnd-LastModified = 1334063371339
>> Bundle-ManifestVersion = 2
>> Bundle-Name = BndToolsTestIPojo
>> Bundle-SymbolicName = BndToolsTestIPojo
>> Bundle-Version = 0.0.1
>> Created-By = 1.6.0_31 (Sun Microsystems Inc.)
>> Import-Package =
>>
>> org.apache.felix.ipojo;version="1.8.0",org.apache.felix.ipojo.architecture;version="1.8.0",org.example.api;version="[1.0,2)",
>> org.osgi.service.cm;version="1.2",org.osgi.service.log;version="1.3"
>> Include-Resource = META-INF/metadata.xml=META-INF/metadata.xml
>> IPOJO-Components = instance { $component="org.example.ExampleComponent" }
>> Manifest-Version = 1.0
>> Private-Package = org.example
>> Tool = Bnd-1.51.0
>>
>> This is with bnd plugin version 1.8.2, manipulator 1.8.4 and core
>> built by Maven from source (changed version number to 1.8.2 to avoid a
>> problem with Bndtools). Tried 1.9.0-SNAPSHOT of bnd-plugin and
>> manipulator as well. (Don't know why BND is still calculating
>> Import-Package versions to be 1.8.0.)
>>
>>
>> Yours, Alexey Romanov
>>
>>
>>
>> On Tue, Apr 10, 2012 at 17:50, Guillaume Sauthier (Objectweb)
>> <guillaume.sauthier@objectweb.org> wrote:
>> > Uh, looks like 1.8.2 is still not released
>> >
>> > Can you try with the iPOJO core ? (Should be 1.9.0-SNAPSHOT)
>> >
>> > --G
>> >
>> > 2012/4/10 Guillaume Sauthier (Objectweb) <
>> guillaume.sauthier@objectweb.org>
>> >
>> >> Another thing, Bnd requires the Manifest headers to start with an
>> >> uppercase character.
>> >> https://issues.apache.org/jira/browse/FELIX-3036
>> >>
>> >> Looks like it's is iPOJO 1.8.2
>> >>
>> >> --G
>> >>
>> >> 2012/4/10 Alexey Romanov <alexey.v.romanov@gmail.com>
>> >>
>> >>> Found this bug on JIRA:
>> >>> https://issues.apache.org/jira/browse/FELIX-3389 However, after
>> >>> updating to org.apache.felix.ipojo.manipulator-1.8.4.jar, there is no
>> >>> change.
>> >>>
>> >>> Yours, Alexey Romanov
>> >>>
>> >>>
>> >>>
>> >>> On Tue, Apr 10, 2012 at 14:29, Alexey Romanov
>> >>> <alexey.v.romanov@gmail.com> wrote:
>> >>> > So, after adding the plugin,
>> >>> >
>> >>> > -plugin:
>> >>>
>> org.apache.felix.ipojo.bnd.PojoizationPlugin;metadata=${basedir}/META-INF/metadata.xml;use-local-schemas=true
>> >>> >
>> >>> > it builds fine. I checked that META-INF/metadata.xml is included
in
>> >>> > the JAR, and the plugin adds header "IPOJO-Components: instance
{
>> >>> > $component="org.example.ExampleComponent" }". But when it's installed
>> >>> > and started, the component isn't created. Using online manipulator
>> >>> > works fine. Any idea what could be a reason? E.g. am I missing
some
>> >>> > necessary bundle? Here is a log:
>> >>> >
>> >>> > -> ps
>> >>> > START LEVEL 1
>> >>> >   ID   State         Level  Name
>> >>> > [   0] [Active     ] [    0] System Bundle (4.0.1)
>> >>> > [   1] [Active     ] [    1] Apache Felix iPOJO (1.8.0)
>> >>> > [   2] [Active     ] [    1] Apache Felix Shell Service (1.4.2)
>> >>> > [   3] [Active     ] [    1] BndToolsTest (0)
>> >>> > [   4] [Active     ] [    1] Apache Felix iPOJO URL Handler
(1.6.0)
>> >>> > [   5] [Active     ] [    1] Apache Felix Shell TUI (1.4.1)
>> >>> > [   6] [Active     ] [    1] Apache Felix Declarative Services
>> (1.6.0)
>> >>> > [   7] [Active     ] [    1] osgi.cmpn (4.2.1.201001051203)
>> >>> > [   8] [Active     ] [    1] BndToolsTestIPojo (0.0.1)
>> >>> > -> uninstall 8
>> >>> > -> install
>> >>>
>> file:/home/aromanov/workspaces/odp-server/BndToolsTestIPojo/generated/BndToolsTestIPojo.jar
>> >>> > Bundle ID: 9
>> >>> > -> start 9
>> >>> > -> headers 9
>> >>> >
>> >>> > BndToolsTestIPojo (9)
>> >>> > ----------------------
>> >>> > Bnd-LastModified = 1334052977766
>> >>> > Bundle-ManifestVersion = 2
>> >>> > Bundle-Name = BndToolsTestIPojo
>> >>> > Bundle-SymbolicName = BndToolsTestIPojo
>> >>> > Bundle-Version = 0.0.1
>> >>> > Created-By = 1.6.0_31 (Sun Microsystems Inc.)
>> >>> > Import-Package =
>> >>> >
>> >>>
>> org.apache.felix.ipojo;version="1.8.0",org.apache.felix.ipojo.architecture;version="1.8.0",org.example.api;version="[1.0,2)",
>> >>> org.osgi.service.cm;version="1.2",org.osgi.service.log;version="1.3"
>> >>> > Include-Resource = META-INF/metadata.xml=META-INF/metadata.xml
>> >>> > IPOJO-Components = instance {
>> $component="org.example.ExampleComponent"
>> >>> }
>> >>> > Manifest-Version = 1.0
>> >>> > Private-Package = org.example
>> >>> > Tool = Bnd-1.51.0
>> >>> > -> uninstall 9
>> >>> > -> install
>> >>>
>> ipojo:file:/home/aromanov/workspaces/odp-server/BndToolsTestIPojo/generated/BndToolsTestIPojo.jar
>> >>> > Processing URL :
>> >>> >
>> >>>
>> ipojo:file:/home/aromanov/workspaces/odp-server/BndToolsTestIPojo/generated/BndToolsTestIPojo.jar
>> >>> > Extracted URL :
>> >>> >
>> >>>
>> file:/home/aromanov/workspaces/odp-server/BndToolsTestIPojo/generated/BndToolsTestIPojo.jar
>> >>> > 3092 bytes copied
>> >>> > Metadata file found: META-INF/metadata.xml
>> >>> > 73 bytes copied
>> >>> > Metadata file saved to
>> >>> >
>> >>>
>> /home/aromanov/workspaces/odp-server/BndToolsTestIPojo/generated/fw/bundle4/data/temp/ipojo_4326206654856524444.xml
>> >>> > Pojoization true - true
>> >>> > Manipulation done : true
>> >>> > Bundle ID: 10
>> >>> > -> start 10
>> >>> > -> I'm constructed...
>> >>> > I'm starting...
>> >>> >
>> >>> > Yours, Alexey Romanov
>> >>> >
>> >>> >
>> >>> >
>> >>> > On Tue, Apr 10, 2012 at 13:13, Alexey Romanov
>> >>> > <alexey.v.romanov@gmail.com> wrote:
>> >>> >> Thank you! Yes, that does help. Though I wonder why
>> >>> >> org.apache.felix.ipojo.manipulator-1.8.2.jar is not available
from
>> >>> >> iPOJO downloads page: BND plugin appears to depend on it (according
>> to
>> >>> >>
>> >>>
>> http://mvnrepository.com/artifact/org.apache.felix/bnd-ipojo-plugin/1.8.2
>> >>> ),
>> >>> >> and I was
>> >>> >> getting NoClassDefFoundError until adding it to the plugin
class
>> path.
>> >>> >>
>> >>> >> Yours, Alexey Romanov
>> >>> >>
>> >>> >>
>> >>> >>
>> >>> >> On Tue, Apr 10, 2012 at 12:42, Guillaume Sauthier (Objectweb)
>> >>> >> <guillaume.sauthier@objectweb.org> wrote:
>> >>> >>> Nop, the Bnd "-plugin" instruction must contains the plugin
>> classname.
>> >>> >>> Ex:
>> >>> >>> -plugin
>> >>> >>>
>> >>>
>> org.apache.felix.ipojo.bnd.PojoizationPlugin;metadata=${basedir}/src/main/resources/META-INF/metadata.xml;use-local-schemas=true
>> >>> >>>
>> >>> >>> The (optional) 'metadata' option instructs the plugin where
to fin
>> the
>> >>> >>> metadata.xml file
>> >>> >>> By default, it looks in the archive for a META-INF/metadata.xml
>> file
>> >>> >>>
>> >>> >>> The (optional) 'use-local-schemas' property simply tells
iPOJO to
>> not
>> >>> >>> verify XML validity against external resources but with
the latest
>> XML
>> >>> >>> schemas included in the current version of the iPOJO manipulator
>> >>> >>>
>> >>> >>> Hope that helps
>> >>> >>> --G
>> >>> >>>
>> >>> >>> PS here is an example:
>> >>> >>>
>> >>>
>> http://gitorious.ow2.org/ow2-shelbie/parent/blobs/master/pom.xml#line303
>> >>> >>>
>> >>> >>>
>> >>> >>> 2012/4/9 Alexey Romanov <alexey.v.romanov@gmail.com>
>> >>> >>>
>> >>> >>>> How can I use iPOJO BND plugin? What instructions does
it
>> provide? Or
>> >>> >>>> is it enough to include
>> >>> >>>>
>> >>> >>>> -plugin: path_to_plugin/bnd-ipojo-plugin-1.8.2.jar
>> >>> >>>>
>> >>> >>>> in my .bnd file?
>> >>> >>>>
>> >>> >>>> Yours, Alexey Romanov
>> >>> >>>>
>> >>> >>>>
>> ---------------------------------------------------------------------
>> >>> >>>> 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
>> >>>
>> >>>
>> >>
>>
>> ---------------------------------------------------------------------
>> 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


Mime
View raw message