0

I am new to OSGi, I am not able to run the "Hello OSGi Bundle" Template on Eclipse Mars(4.5.1), I am getting the below mentioned console messages.

My questions is - Do we need to install anything else except Eclipse Mars(4.5.1) to run the Hello OSGi Template? JDK I have is 1.7.0_80.

What I tried-

  1. Search on internet for this problem - could not resolve in 2 days :(

  2. In Run Configurations- click "Deselect All" Button then select my bundle then Click "Add Required bundles"(this action adds 2 more bundles)

  3. Click - "Validate Bundles"- gave "No problems were detected" alert.

  4. Click "Apply" button

  5. Click "Run" button.

  6. Resources that are added default by Eclipse Mars- enter image description here

Console messages -

Hello World!!
!SESSION 2016-02-05 15:27:02.454 -----------------------------------------------
eclipse.buildId=unknown
java.version=1.7.0_80
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_IN
Command-line arguments:  -dev file:C:/Users/212553222/workspace/.metadata/.plugins/org.eclipse.pde.core/New_configuration/dev.properties -os win32 -ws win32 -arch x86_64 -consoleLog -console

!ENTRY org.eclipse.osgi 4 0 2016-02-05 15:27:02.991
!MESSAGE Could not find bundle: org.eclipse.equinox.console
!STACK 0
org.osgi.framework.BundleException: Could not find bundle: org.eclipse.equinox.console
    at org.eclipse.core.runtime.internal.adaptor.ConsoleManager.checkForConsoleBundle(ConsoleManager.java:58)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.startup(EclipseStarter.java:331)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:231)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:669)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:608)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1515)
    at org.eclipse.equinox.launcher.Main.main(Main.java:1488)

UPDATE-

Perhaps, the below worked for me in Eclipse Mars(reached there out of reading console error messages and luck) - enter image description here

OSGi Console Output- enter image description here

But still can not see the osgi> prompt in the command shell window(Windows 7), the shell just keeps on waiting. Why? -enter image description here

Ishank
  • 2,860
  • 32
  • 43
  • All the necessary plugins are there, but the 'add required plugins' doesn't seem to do a very good job. – greg-449 Feb 05 '16 at 10:34
  • Thanks for the response! How do I proceed then? One more point is when I run on command shell(Windows 7) like- `C:\Desktop\eclipse\plugins>java -jar org.eclipse.osgi_3.10.101.v 20150820-1432.jar -console` , the `>OSGi` prompt is not coming rather the Command prompt keeps waiting...Also the console says that it can not find bundle - `org.eclipse.equinox.console` but the Equinox document says that it comes installed as a part of Eclipse Mars. – Ishank Feb 05 '16 at 10:54
  • 1
    The best way to proceed would be to learn OSGi using [Bndtools](http://bndtools.org/). – Neil Bartlett Feb 05 '16 at 11:00
  • Thanks! Will try that out, just curious why is the shell command `C:\Desktop\eclipse\plugins>java -jar org.eclipse.osgi_3.10.101.v 20150820-1432.jar -console` not giving the `>OSGi` prompt? That makes me think if I am missing something in the jars required.. – Ishank Feb 05 '16 at 11:14
  • Also right now I want only the Hello OSGi template to work and Bndtools seems a bit of an overhead just check Hello World on the OSGi console. – Ishank Feb 05 '16 at 11:21
  • 1
    You might want to get started wth OSGi enRoute because it has a number of tutorials and is very nicely setup with bndtools. http://enroute.osgi.org – Peter Kriens Feb 11 '16 at 17:59

0 Answers0