David,

Thanks a million, this looks VERY useful.

I've added a link to your mail at the bottom of this page:

"OSGi integration"
http://wiki.restlet.org/developers/172-restlet/124-restlet.html

Would you mind if we directly copy the content of your mail on this page? If
you have a wiki account you could even do it yourself if you prefer. Let me
know!
 
Best regards,
Jerome Louvel
--
Restlet ~ Founder and Lead developer ~ http://www.restlet.org
Noelios Technologies ~ Co-founder ~ http://www.noelios.com

 

-----Message d'origine-----
De : David Fogel [mailto:[email protected]] 
Envoyé : mercredi 18 mars 2009 02:37
À : [email protected]
Objet : RE: Restlet and OSGi Issues

Hi Jerome-

> I've fix the javax.xml.xpath import and a couple of others missing. 
> But I haven't tested it outside Eclipse due to lack of time. Do you 
> have some usage instructions for this, like which JARs should be in 
> the classpath and which class to launch with parameters to get a clean 
> Equinox environment outside Eclipse?

Here is what I consider to be a straightforward, light-weight way of setting
up an equinox osgi container:

1) You will need the eclipse equinox osgi jar file (from some recent version
of eclipse, in the plugins folder, in this case 3.5M5):

    org.eclipse.osgi_3.5.0.v20090127-1630.jar

2) Download the FileInstall bundle by Peter Kriens, which will monitor a
directory and automatically install bundles it finds there.  (for a longer
description you can see http://www.aqute.biz/Code/FileInstall )

http://www.aqute.biz/repo/biz/aQute/fileinstall/1.3.4/fileinstall-1.3.4.jar

3) you then create the following directory structure (Note substitute your
actual equinox bundle version for "3.X.X"):

    my_equinox/
       org.eclipse.osgi_3.X.X.jar
       fileinstall-1.3.4.jar
       load/
       configuration/
           config.ini

"load/" is an empty dir, where you will later put the bundles you wish to
test.

"config.ini" should be a text file with the following lines in it (but not
indented):

    osgi.bundles=fileinstall-1.3.4....@start
    eclipse.ignoreApp=true

3) run equinox from the command line (make sure to "cd" to the "my_equinox"
directory first):

    java -jar org.eclipse.osgi_3.X.X.jar -console
    
    (or)

    java -jar org.eclipse.osgi_3.X.X.jar -console 7777 &
    
This will start up equinox with a command-line console.  if you run the
first version above, you will enter the console directly.  This can be
inconvenient if you have other things to do on the command line.  Using the
2nd version will launch equinox in a new process and tell it to listen on
port 7777 for telnet connections.  To connect to the running osgi console,
you then type:

    telnet locahost 7777
    
4) type "help" in the osgi console for a list of commands.  To quickly check
the status of all installed bundles, type (where "osgi>" is the osgi command
prompt):

    osgi> ss
    
"ss" stands for "short status", and in this case you should see something
like:

    id  State       Bundle
    0   ACTIVE      org.eclipse.osgi_3.X.X
    1   ACTIVE      biz.aQute.fileinstall_1.3.4

5) copy any bundles you want to install to the "load/" directory.  The
FileInstall bundle will automatically attempt to load and start these
bundles. 
If you add in the bundles in random order, you may see some temporary error
messages complaining about missing dependencies, but these should resolve
themselves as the rest of your bundles load.  you may again type "ss" in the
osgi console to see the status of the bundles.

In general, you can use the Run Configurations dialog in eclipse to make
sure you have a compatible set of bundles satisfying all their mandatory
dependencies, and then copy that set into the /load directory.

Let me know if you have any problems with this setup.

-Dave Fogel

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=13445
44

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=1416079

Reply via email to