Well, I just use the svn trunk version of this tool.
I'm not sure if this has changed at some point, but the ResourceImpl class
clearly does not use an integer for the ID.
Look at
http://www2.osgi.org/svn/public/trunk/org.osgi.impl.bundle.bindex/src/org/osgi/impl/bundle/obr/resource/ResourceImpl.javaand
search for the getId() method. It is implemented that way:
public synchronized String getId() {
if ( id == null )
id = symbolicName + "/" + version;
return id;
}
So my repository.xml looks like:
<resource id='org.springframework.bundle.spring.core/2.5.0'
presentationname='spring-core' symbolicname='
org.springframework.bundle.spring.core' ...
Which then throws the mentioned exception.
On Dec 3, 2007 5:27 PM, Bart Elen <[EMAIL PROTECTED]> wrote:
> Hello Guillaume,
>
> could you give a little more information about how we can reproduce this
> error?
>
> When I use the bindex tool on the org.ops4j.pax.web.extender bundle, I get
> an int as resource ID in
> the repository xml-file:
>
> <resource id='4' presentationname='OPS4J Pax Web Extender Service'
> symbolicname='org.ops4j.pax.web.extender' uri='pax-web-extender-0.1.0.jar'
> version='0.1.0'>
>
>
> Could you copy this part of your repository xml-file?
> Did you adapt the repository xml-file manually?
>
>
> Greetings,
>
> Bart
>
> Guillaume Nodet wrote:
> > It seems there is an incompatibility between felix obr implementation
> and
> > the indexer tool provided by the OSGi Alliance (see
> >
> http://www.osgi.org/blog/2007/07/osgi-bundle-repository-indexer-open.html
> ).
> >
> > The reason is that I have the following exception:
> >
> > [WARNING] Exception while updating OBR: For input string: "
> > org.ops4j.pax.web.extender/0.1.0"
> > java.lang.NumberFormatException: For input string: "
> > org.ops4j.pax.web.extender/0.1.0"
> > at java.lang.NumberFormatException.forInputString(
> > NumberFormatException.java:48)
> > at java.lang.Integer.parseInt(Integer.java:447)
> > at java.lang.Integer.parseInt(Integer.java:497)
> > at org.apache.felix.sandbox.obr.plugin.ObrUpdate.resource(
> > ObrUpdate.java:492)
> > at org.apache.felix.sandbox.obr.plugin.ObrUpdate.walkOnTree(
> > ObrUpdate.java:443)
> > at org.apache.felix.sandbox.obr.plugin.ObrUpdate.walkOnTree(
> > ObrUpdate.java:455)
> > at
> org.apache.felix.sandbox.obr.plugin.ObrUpdate.updateRepository(
> > ObrUpdate.java:217)
> > at org.apache.felix.bundleplugin.OBRInstall.execute(
> OBRInstall.java
> > :98)
> > at org.apache.maven.plugin.DefaultPluginManager.executeMojo(
> > DefaultPluginManager.java:443)
> > at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(
> > DefaultLifecycleExecutor.java:539)
> > at
> >
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle
> > (DefaultLifecycleExecutor.java:480)
> > at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(
> > DefaultLifecycleExecutor.java:459)
> > at
> >
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures
> > (DefaultLifecycleExecutor.java:311)
> > at
> > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(
> > DefaultLifecycleExecutor.java:278)
> > at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(
> > DefaultLifecycleExecutor.java:143)
> > at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java
> :334)
> > at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:125)
> > at org.apache.maven.cli.MavenCli.main(MavenCli.java:280)
> > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> > at sun.reflect.NativeMethodAccessorImpl.invoke(
> > NativeMethodAccessorImpl.java:39)
> > at sun.reflect.DelegatingMethodAccessorImpl.invoke(
> > DelegatingMethodAccessorImpl.java:25)
> > at java.lang.reflect.Method.invoke(Method.java:585)
> > at org.codehaus.classworlds.Launcher.launchEnhanced(
> Launcher.java
> > :315)
> > at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
> > at org.codehaus.classworlds.Launcher.mainWithExitCode(
> Launcher.java
> > :430)
> > at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
> >
> > I'm not sure which project is wrong, as the spec does not say much about
> the
> > id: well, it does not say that it does to be an integer, so I'm leaning
> > towards patching felix obr.
> >
> > Thoughts ?
> >
> >
>
>
--
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/