Resolve NullPointerException in ModelServiceImpl constructor

I was creating a launch configuration for a plug-in test and wanted to have only a minimal set of plugins configured. Thus I am using PDE to add all required plug-ins of the test. The “Validate Plug-ins” action does not recognize any issue.

screenshot 3.png

However, when starting the test it fails with a NullPointerException in ModelServiceImpl‘s constructor. The reason here is that no instance of IEventBroker was retrieved from the application context. To enhance the situation I have opened Bug#522051 and giving this as an error message.

To solve this issue when running on Equinox, the bundle org.eclipse.equinox.event has to be added to the launch configuration. Also configure this bundle to start automatically at start level 2.

screenshot 4.png

I would have liked to give this hint already with the improved error message, but theoretically the IEventBroker could be also provided by another OSGi implementation, so this additional hint was rejected with reason. I hope that this post will help you then further.

3 thoughts on “Resolve NullPointerException in ModelServiceImpl constructor

  1. I will try to improve the “Add Required Plugins” action. This is a hint for those who stumble over this error and need a solution. See ya!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s