Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Standalone OSGi (Equinox) server on Eclipse Juno

I'm trying to get the osgi server from the Eclipse Juno Release and run it standalone. Some old tutorials say that just grabbing the org.eclipse.osgi_VERSION.jar is enough to start it from the command line as

java -jar  org.eclipse.osgi_VERSION.jar -console

When I try that, it doesn't show the prompt as expected, but instead sits quietly as if waiting for something to happen.

However, I can comfortably start and install bundles by doing a ./eclipse -console, which obviously isn't an option when running on the server, where I want to deploy bundles at runtime.

Some googling revealed I need to gather up jars (even Apache Felix's gogo) from here and there, but couldn't find anything concrete that would allow me to run this thing in a "headless" fashion.

Is there a way to do this in a clean and simple way, or would you suggest shifting to Apache Felix?

like image 490
Tathagata Avatar asked Aug 05 '12 16:08

Tathagata


People also ask

What is OSGi in Eclipse?

The OSGi (Open Service Gateway Initiative) specification is a Java framework for developing and deploying modular software programs and libraries. The framework was originally managed by the OSGi Alliance, an open standards organization.

What is org Eclipse Equinox?

In computing, Equinox is a sub-project of the Eclipse project that provides a certified implementation of the OSGi R4. x core framework specification. It is a module runtime that allows developers to implement an application as a set of "bundles" using the common services infrastructure.

What is bundle in Eclipse?

Bundle Pooling is, simply put, a mechanism that allows multiple Eclipse applications to share a common set of plug-ins (bundles).


2 Answers

Equinox in Juno does no longer contain the console out of the box. It's now contained in a separate bundle which implements the Equinox console on top of the Apache GoGo shell.

Thus, the minimum setup of bundles for running Equinox including the console is:

  • org.eclipse.osgi
  • org.eclipse.equinox.console
  • org.apache.felifx.gogo.command
  • org.apache.felifx.gogo.runtime
  • org.apache.felifx.gogo.shell

For running the SSH console one also needs:

  • org.eclipse.equinox.console.ssh
  • org.apache.mina.core
  • org.apache.sshd.core

Additionally, you need to use a different configuration area. Equinox reads settings (like what bundles to use, their start levels, what application to start, etc.) from the config.ini. Thus, as along as you use the same configuration area as Juno you'll always end up in your Juno environment. You may corrupt your Juno installation when modifying the config.ini directly.

A better start is to download the Equinox Juno OSGi starter kit:

  • http://download.eclipse.org/equinox/drops/R-3.8-201206081400/index.php

You can also try one of the OSGi Equinox server distributions:

  • http://www.eclipse.org/virgo/
  • http://www.eclipse.org/gyrex/
like image 152
Gunnar Avatar answered Sep 19 '22 16:09

Gunnar


You should try Apache karaf. It can run with Felix or Equinox and contains everything you need for a decent OSGi server. See http://karaf.apache.org/

like image 38
Christian Schneider Avatar answered Sep 21 '22 16:09

Christian Schneider