Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Null Service Reference(Exported deployable feature with EventAdmin service does not work)
Null Service Reference [message #895610] Fri, 13 July 2012 19:22
Terry Jahelka is currently offline Terry JahelkaFriend
Messages: 23
Registered: February 2012
Junior Member
Hi,

I have an eclipse application that utilizes the EventAdmin service for communication between plugins. Application runs correctly from the IDE (Eclipse 3.7). When I export the deployable feature and create a top level JNLP, the application launches correctly and all plugins/views are available. When I execute the command that posts to the EventAdmin service I get "null service reference is not allowed".

Product definition includes org.eclipse.osgi (Start level 1), org.eclipse.equinox.event(start level 2), org.eclipse.equinox.ds (start level 3).

Top level JNLP contains:

<?xml version="1.0" encoding="UTF-8"?>
<jnlp spec="1.0+" codebase="file:///c:/temp/client3" href="client.jnlp">
<information>
<title>Client</title>
<vendor>Me</vendor>
<description>Client Application</description>
<shortcut>
<desktop/>
</shortcut>
</information>
<security>
<all-permissions/>
</security>
<update check="always" policy="always"/>
<resources>
<jar href="plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar"/>
<extension name="Wrapper feature" href="features/client_1.0.0.jnlp" />
<property name="osgi.instance.area" value="@user.home"/>
<property name="osgi.configuration.area" value="@user.home"/>
<property name="eclipse.application" value="client.core.application"/>
<!-- Valid log levels are INFO, WARNING, ERROR -->
<property name="logLevel" value="INFO"/>
</resources>
<resources os="Windows" arch="x86">
<j2se version="1.5+" />
</resources>
<application-desc main-class="org.eclipse.equinox.launcher.WebStartMain">
<argument>-nosplash</argument>
</application-desc>
</jnlp>

Code that is getting the null reference is:

JSONObject point = it.next();

// fire an event with the point
BundleContext ctx = FrameworkUtil.getBundle(ThreatView.class)
.getBundleContext();
ServiceReference<EventAdmin> ref = ctx
.getServiceReference(EventAdmin.class);
EventAdmin eventAdmin = ctx.getService(ref);

Map<String, Object> properties = new HashMap<String, Object>();
properties.put("data", point);

Event event = new Event("viewcommunication/asynchEvent", properties);
eventAdmin.postEvent(event);


Any and all help would be appreciated.

[Updated on: Fri, 13 July 2012 19:24]

Report message to a moderator

Previous Topic:IMenuService not works with eclipse 4.2 (seems bug?)
Next Topic:How to remove fast view option in my plugin ?
Goto Forum:
  


Current Time: Sun Dec 22 06:20:54 GMT 2024

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

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

Back to the top