Null Service Reference [message #895610] |
Fri, 13 July 2012 19:22 |
Terry Jahelka 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
|
|
|
Powered by
FUDForum. Page generated in 0.02855 seconds