Hope you'll all excuse my ignorance - this is my first day with OSGi and
Felix.
How are you supposed to work out the correct version numbers to include in
configuration properties for bundles?
The wiki sample code referred to earlier in this thread now builds, but
still doesn't run for me. The exception messages gave me some clues, and it
turned out that the version numbers in the system package and bundle map
were (I think) incorrect. The version numbers in the lines below work for
me, when I run against Felix v1.2.1:
configMap.put(Constants.FRAMEWORK_SYSTEMPACKAGES,
"org.osgi.framework; version=1.4.0," +
"org.osgi.service.packageadmin; version=1.2.0," +
"org.osgi.service.startlevel; version=1.1.0," +
"org.osgi.service.url; version=1.0.0");
configMap.put(AutoActivator.AUTO_START_PROP +
".1", // Run level 1
"file:bundle/org.apache.felix.shell-1.0.2.jar " +
"file:bundle/org.apache.felix.shell.tui-1.0.2.jar");
The exceptions I had been getting with the original code shown on the wiki
page were (e.g.) "ERROR: Error starting
file:bundle/org.apache.felix.shell-1.0.2.jar
(org.osgi.framework.BundleException: Unresolved constraint in bundle 37:
package...".
Clearly something to do with versions and dependencies. So I decided to
look in the Felix config.properties file, and use the numbers I found
there. Using those, the code worked. (So I think the sample needs editing,
for it to work with the current Felix release).
My question is: if you give me a new release of Felix in a jar, how do I
discover the version numbers of the framework packages it exports? I tried
hunting through the manifest files in the jars, but it didn't help. Where
should I be looking? Is it always the case that the f/work jar must be
accompanied by the config.properties file or some documentation/readme to
provide the numbers?
OK, now you can tell me which page(s) I should have read.
Cheers,
Roger Searjeant.
On Tue, Sep 16, 2008 at 7:22 PM, Stuart McCulloch <[EMAIL PROTECTED]> wrote:
> 2008/9/17 Stuart McCulloch <[EMAIL PROTECTED]>
>
> > 2008/9/17 Roger Searjeant <[EMAIL PROTECTED]>
> >
> >> I think there is a small mistake in the bare-bones custom Felix launcher
> >> described on this page:
> >>
> >>
> http://cwiki.apache.org/confluence/display/FELIX/Launching+and+Embedding+Apache+Felix
> >>
> >
> > I think you're right - looks like a simple copy/paste error from an
> earlier
> > example... I'll fix it, thanks for reporting this
> >
>
> done, I also fixed a couple of other minor typos - should be mirrored to
> the
> main site in a few hours
>
>
> > The variable configMap is re-declared in the try block, when there should
> >> be
> >> a second Map (configProps) created from the first. The changed lines:
> >>
> >> Map configProps = new StringMap(configMap, false);
> >> m_felix = new Felix(configProps, list);
> >>
> >> Now the code will compile and run.
> >>
> >> -- Roger Searjeant.
> >>
> >
> > --
> > Cheers, Stuart
> >
>
>
>
> --
> Cheers, Stuart
>