Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » Event Admin service reference is null when debugging in eclipse, not in command line(potential problem)
Event Admin service reference is null when debugging in eclipse, not in command line [message #544896] Mon, 05 July 2010 22:41 Go to next message
George Valkanas is currently offline George ValkanasFriend
Messages: 3
Registered: July 2010
Junior Member
Hello everybody,

After noticing some strange behavior with the Event Admin service, while running some "applications" that use it in Eclipse, I created this thread here. I was then redirected to this sub-forum, to discuss the issue (since I was in the wrong sub-category of the problem.. sorry about that).

I am rewriting the text for simplicity:


I did a little research, both on google and in this forum to find a similar strange-looking behavior, but with no success (google keywords: "event admin null debugging in eclipse", "event admin problem eclipse" and some more). This is why I began a new thread. In case someone is familiar with the problem (and / or a previous discussion), let me know.

************ Let me state here that I also did a search on the bugzilla, without again any success **********


The observed problem is as follows:

We are developping a set of services / middleware for a project we currently have (IPAC - ipac.di.uoa.gr for anyone interested). Part of the communication is performed with service references and method calls, whereas the other part is via the Event Admin service.

Dependencies are correctly resolved and all the required bundles are in place (at least we do not get any such errors).

When starting our services, some of them require a reference to the Event Admin service. The strange thing is that, when debugging the services through the Eclipse platform (or even running it), the reference to the Event Admin is *null*, 99% of the times (I've seen it work, but only in one occasion)! Even if we stop and restart the service (with OSGi commands "stop X", "start X") after some time (in case event admin was not started - which is never the case as we observe), the reference is again *null*!

On the contrary, if we run the exact same services without modification on the command line, the Event Admin reference is correctly retrieved *all of the times*.
The command line execution is performed as:

java -jar org.eclipse.osgi.jar -console

where org.eclipse.osgi.jar is simply the file org.eclipse.osgi_3.4.3.R34x_v20081215-1030.jar renamed.


The eclipse bundles that we use include, apart from the file above, the following:

org.eclipse.equinox.event_1.1.0.v20080225.jar
org.eclipse.osgi.services.jar_3.1.200.v20071203.jar
org.eclipse.osgi.util_3.1.300.v20080303.jar

The Eclipse Platform used is Ganymede v3.4.2, Milestone 20090211-170, tested on an Ubuntu Linux 8.10 laptop, with Sun JDK 1.6, update 20.
The hardware is an Intel dual core @1,86GHz, with 2Gb RAM, in case it makes any difference.


Thank you very much,
George
Re: Event Admin service reference is null when debugging in eclipse, not in command line [message #654073 is a reply to message #544896] Mon, 14 February 2011 01:36 Go to previous messageGo to next message
Robert Elves is currently offline Robert ElvesFriend
Messages: 87
Registered: July 2009
Member
Hi George, did you ever uncover the solution to this problem? I'm experiencing something similar with 3.6.1. Oddly it was working fine and then (if I recall correctly) I ran the previously working run configuration but with 'clean' selected and since then EventAdmin service is null. If you ever discovered the solution I'd be interested.

Thanks,

-Rob
Re: Event Admin service reference is null when debugging in eclipse, not in command line [message #654152 is a reply to message #654073] Mon, 14 February 2011 11:42 Go to previous messageGo to next message
Gunnar Wagenknecht is currently offline Gunnar WagenknechtFriend
Messages: 486
Registered: July 2009
Location: San Francisco ✈ Germany
Senior Member

Am 14.02.2011 02:36, schrieb Robert Elves:
> [...] I ran the previously working run configuration but with 'clean' selected and since then EventAdmin service is null.

Likely the org.eclipse.equinox.event bundle is not started. You need to
start it eiter manually via the console or on the launch configuration.

-Gunnar


--
Gunnar Wagenknecht
gunnar@wagenknecht.org
http://wagenknecht.org/
Re: Event Admin service reference is null when debugging in eclipse, not in command line [message #654480 is a reply to message #654152] Tue, 15 February 2011 23:32 Go to previous messageGo to next message
Robert Elves is currently offline Robert ElvesFriend
Messages: 87
Registered: July 2009
Member
I thought that might be the case but events was there in the runtime configuration. I've since created a new configuration and the problem no loger exists. If it happens again and I discover the cause I'll post an update.

Thanks,

-Rob
Re: Event Admin service reference is null when debugging in eclipse, not in command line [message #654584 is a reply to message #654480] Wed, 16 February 2011 11:47 Go to previous message
Gunnar Wagenknecht is currently offline Gunnar WagenknechtFriend
Messages: 486
Registered: July 2009
Location: San Francisco ✈ Germany
Senior Member

Hi Robert,

Am 16.02.2011 00:32, schrieb Robert Elves:
> I thought that might be the case but events was there in the runtime configuration.

It's not enough if the bundle /is there/. It also needs to be started
(state ACTIVE).

osgi> ss equinox.event

Framework is launched.

id State Bundle
123 ACTIVE org.eclipse.equinox.event_x.y.z.q

> I've since created a new configuration and the problem no loger exists.

PDE contains some logic which should automatically mark the bundle for
start when you launch a configuration. Might be the case when you create
a new one.

-Gunnar

--
Gunnar Wagenknecht
gunnar@wagenknecht.org
http://wagenknecht.org/
Previous Topic:p2 UpdateOperation duplicate plugins and screw up installation details.
Next Topic:P2 "Headless Updating on Startup" not working
Goto Forum:
  


Current Time: Fri Apr 26 23:26:49 GMT 2024

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

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

Back to the top