Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » Equinox console error(Exception in org.eclipse.equinox.console.command.adapter.Activator.start() )
Equinox console error [message #1036264] Mon, 08 April 2013 06:41 Go to next message
John Connor is currently offline John ConnorFriend
Messages: 2
Registered: April 2013
Junior Member
Hi there.

I'm trying to run a set of bundles with Equinox, so I can run my bundles inside Eclipse, but I've found several problems.

What I've done to run my bundles is:
- Set the Eclipse Scope with the secondary bundles I'm using like felix.gogo.runtime, shell and command; the equinox console; osgi core and enterprise 5, and whatever bundles I need to fullfil the "java dependencies" I'm using in my project.
- Following this I've set a config.ini file to set the bundles configuration.
- Everything is set over Maven, althougth I don't think this is relevant.

So, I select run > OSGi framework within Eclipse and when it gets started I get the following:

org.osgi.framework.BundleException: Exception in org.eclipse.equinox.console.command.adapter.Activator.start() of bundle org.eclipse.equinox.console.
	at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:806)
	at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:755)
	at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:370)
	at org.eclipse.osgi.framework.internal.core.AbstractBundle.resume(AbstractBundle.java:374)
	at org.eclipse.osgi.framework.internal.core.Framework.resumeBundle(Framework.java:1067)
	at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:561)
	at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:546)
	at org.eclipse.osgi.framework.internal.core.StartLevelManager.incFWSL(StartLevelManager.java:459)
	at org.eclipse.osgi.framework.internal.core.StartLevelManager.doSetStartLevel(StartLevelManager.java:243)
	at org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:440)
	at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:227)
	at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:337)
Caused by: java.lang.NoSuchMethodError: org.osgi.framework.BundleContext.registerService(Ljava/lang/Class;Ljava/lang/Object;Ljava/util/Dictionary;)Lorg/osgi/framework/ServiceRegistration;
	at org.eclipse.equinox.console.command.adapter.Activator$CommandCustomizer.addingService(Activator.java:178)
	at org.eclipse.equinox.console.command.adapter.Activator$CommandCustomizer.addingService(Activator.java:1)
	at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:896)
	at org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:261)
	at org.osgi.util.tracker.AbstractTracked.trackInitial(AbstractTracked.java:184)
	at org.osgi.util.tracker.ServiceTracker.open(ServiceTracker.java:339)
	at org.osgi.util.tracker.ServiceTracker.open(ServiceTracker.java:273)
	at org.eclipse.equinox.console.command.adapter.Activator.start(Activator.java:205)
	at org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:783)
	at java.security.AccessController.doPrivileged(Native Method)
	at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:774)
	... 11 more
Root exception:
java.lang.NoSuchMethodError: org.osgi.framework.BundleContext.registerService(Ljava/lang/Class;Ljava/lang/Object;Ljava/util/Dictionary;)Lorg/osgi/framework/ServiceRegistration;
	at org.eclipse.equinox.console.command.adapter.Activator$CommandCustomizer.addingService(Activator.java:178)
	at org.eclipse.equinox.console.command.adapter.Activator$CommandCustomizer.addingService(Activator.java:1)
	at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:896)
	at org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:261)
	at org.osgi.util.tracker.AbstractTracked.trackInitial(AbstractTracked.java:184)
	at org.osgi.util.tracker.ServiceTracker.open(ServiceTracker.java:339)
	at org.osgi.util.tracker.ServiceTracker.open(ServiceTracker.java:273)
	at org.eclipse.equinox.console.command.adapter.Activator.start(Activator.java:205)
	at org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:783)
	at java.security.AccessController.doPrivileged(Native Method)
	at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:774)
	at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:755)
	at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:370)
	at org.eclipse.osgi.framework.internal.core.AbstractBundle.resume(AbstractBundle.java:374)
	at org.eclipse.osgi.framework.internal.core.Framework.resumeBundle(Framework.java:1067)
	at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:561)
	at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:546)
	at org.eclipse.osgi.framework.internal.core.StartLevelManager.incFWSL(StartLevelManager.java:459)
	at org.eclipse.osgi.framework.internal.core.StartLevelManager.doSetStartLevel(StartLevelManager.java:243)
	at org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:440)
	at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:227)
	at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:337)


This is my config.ini, created in a configuration subfolder in my Target folder.

osgi.bundles=./org.apache.felix.gogo.runtime_0.8.0v<version>.jar@start,\
    ./org.apache.felix.gogo.command_0.8.0v<version>.jar@start,\
    ./org.apache.felix.gogo.shell_0.8.0v<version>.jar@start,\
    ./org.eclipse.equinox.console.jar@start,\
osgi.console.enable.builtin=false
osgi.console=<port>


I must say that I've already runned my bundles outside eclipse, but I wanted to start working the whole time inside Eclipse, without having to exit the eclipse environment to run my bundles by using the equinox console.

I feel that I'm missing smth that no one else is, because there's no other thread with this error in the entire Internet. Sad

Thank you all for any advice you can give me.
Re: Equinox console error [message #1036593 is a reply to message #1036264] Mon, 08 April 2013 15:26 Go to previous messageGo to next message
Lazar Kirchev is currently offline Lazar KirchevFriend
Messages: 30
Registered: July 2009
Location: Sofia, Bulgaria
Member
Hi John,

What version of Eclipse are you using? The error looks like if you are using an older version of Eclipse, where BundleContext.registerService() does not accept java.lang.Class as an argument, but this is only a guess.

The new console is available in Eclipse since Eclipse 4.2, so if you are using Eclipse 4.2 you do not to provide the console bundles - the are already in Eclipse, just chose them in your OSGi configuration.

Regards,
Lazar
Re: Equinox console error [message #1037880 is a reply to message #1036593] Wed, 10 April 2013 05:48 Go to previous message
John Connor is currently offline John ConnorFriend
Messages: 2
Registered: April 2013
Junior Member
Thanks for your answer.

I've already found the solution.

The problem was that you need to load a few more org.eclipse.osgi bundles so it can work.

Here is the list of bundles you need to charge(it's the Dependencies list on the top of the page): docs. codehaus. org/ display/ GUMTREE/ Running+Equinox+OSGi

The problem I've found now is that when I run my OSGi bundles in Eclipse I get two consoles running at one time.

When I start running on the bundles, at first I get the osgi prompt "osgi>" (along with a huge amount of data from the bundle debugging) and when I write "ss" to get the bundle list, the gogo console starts, and I use lb to get the bundle list.

The gogo console manages to show me the bundle list, but when a try to start or stop a bundle, nothing happens. I've tried "start ID" and "felix:start ID" but without any result.

I can't really paste here my debugging code because I'm at work.

My best theory is that I'm loading two bundles that shouldn't be running together.

I figured out that excluding the org.eclipse.equinox.console and console.ssh I just get the OSGi prompt, but I still can't start/stop my bundles.

Here is a common bundle list that I've been using so far, I've already try a number of combinations, but I haven't really get any results, maybe you guys can help me, any suggestion or hint would be really appreciated.

org .eclipse .osgi .services
org .eclipse .osgi (I used to add directly the osgi.core, now I'm trying this one)
org .eclipse .equinox .registry
org .eclipse .equinox .preferences
org .eclipse .equinox .log
org .eclipse .equinox .launcher .win32 .win32 .x86 (wich doesn't get started I do not know why, It's just the one that matches my OS)
org .eclipse .equinox .launcher
org .eclipse .equinox .console .ssh
org .eclipse .equinox .console
org .eclipse .equinox .common
org .eclipse .equinox .app
org .eclipse .core .runtime .compatibility .auth
org .eclipse .core .jobs
org .eclipse .core .contenttype
org .apache .felix .gogo .shell
org .apache .felix .gogo .runtime
org .apache .felix .gogo .command
org .apache .felix .eventadmin
org .apache .felix .configadmin


Edit: spelling

[Updated on: Wed, 10 April 2013 05:56]

Report message to a moderator

Previous Topic:GNU/GPL V3 license in bundles and Equinox
Next Topic:ServiceLoader and OSGi
Goto Forum:
  


Current Time: Thu Apr 25 13:21:56 GMT 2024

Powered by FUDForum. Page generated in 0.02608 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top