Three problems with starting brand new Eclipse 4 RCP application

Recently I decided to finally give Eclipse 4 RCP a try. I created small application in a few minutes. Everything worked smoothly in Eclipse IDE. Next step was to prepare Maven build. Using Tycho 0.16.0 I was able to build my brand new RCP application using command line. The problems started when I tried to run application built by Maven.

Here are three problems I experienced:

  • Application crashing on start-up with an exception like this:
    org.eclipse.core.runtime.AssertionFailedException:
    null argument:applicationXMI argument missing

    In order to resolve that I had to add new program argument (Launching tab in Product Configuration Editor)

    -clearPersistedState
  • Application crashing on start-up with another exception:
    !ENTRY org.eclipse.osgi 4 0 2012-11-20 20:43:46.516
    !MESSAGE Application error
    !STACK 1
    java.lang.IllegalStateException: Unable to acquire application service. Ensure that the org.eclipse.core.runtime bundle is resolved and started (see config.ini).

    When you run your RCP application from IDE start-up levels for bundles are set appropriately, but this does not happen in product configuration. These three bundles should have Auto-Start set to true and following start levels (Configuration tab in Editor):

    • org.eclipse.core.runtime 2
    • org.eclipse.equinox.ds 3
    • org.eclipse.equinox.event 3
  • Application starting up fine but no controls being rendered inside a part. Eclipse remote debug helped me to determine that an part object was instantiated as expectged but a method creating all the controls wasn’t actually called. For some reason annotation @PostConstruct wasn’t respected. In order to resolve this issue I had to replace bundle javax.annotation 1.1.0 with version 1.0.0. Eclipse Juno IDE is shipped with version 1.0.0 so everything worked fine there but Tycho picked up version 1.1.0 from Eclipse p2 repository for Juno.

5 comments

  1. For the third one we have fixed that in the e4 tools, see https://bugs.eclipse.org/bugs/show_bug.cgi?id=394327

    Also building RCP applications with Tycho is described here: http://www.vogella.com/articles/EclipseTycho/article.html

    I add the configuration of the start levels very soon, this info is currently missing in the tutorial.

    Error number one sounds strange, clearPersistedState should be independent of this error message, I suspect you forgot to add the file to your build.properties.

    Like

  2. @Jan Unfortunately I didn’t attend your tutorial at EclipseCon. Taking a look at github would definitely help me save some time.

    @Lars I’m glad to see that javax.annotation issue is fixed now. I’m not sure what was going on with applicationXMI though, I definitely checked build.properties, that’s the first thing I look into when I see differences between product launched from IDE and a regular one.

    A brand new issue I see right now with Tycho – there is a problem with icons for win32.win32.x86_64 launcher. ICO file set in product configuration works nice for 32-bit exe, but in 64-bit one default Eclipse icon is used for all larger sizes instead custom one.

    Like

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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