Nov 20 2012

Three problems with starting brand new Eclipse 4 RCP application

Published by at 9:10 pm under Eclipse,IT,Java

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 responses so far

5 Responses to “Three problems with starting brand new Eclipse 4 RCP application”

  1. Jan Sieverson 21 Nov 2012 at 9:18 am

    did you have a look at the Tycho Eclipse 4 RCP tutorial?

    http://www.eclipsecon.org/europe2012/sessions/building-eclipse-plugins-and-rcp-applications-tycho

  2. Lars Vogelon 21 Nov 2012 at 8:20 pm

    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.

  3. Radoslaw Urbason 21 Nov 2012 at 8:55 pm

    @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.

  4. genteandcasas.wordpress.comon 23 Aug 2015 at 4:49 am

    genteandcasas.wordpress.com

    Radek’s Tech Blog » Three problems with starting brand new Eclipse 4 RCP application

  5. roof maintenance Companyon 26 Apr 2017 at 11:51 pm

    roof maintenance Company

    Radek's Tech Blog » Three problems with starting brand new Eclipse 4 RCP application

Trackback URI | Comments RSS

Leave a Reply

You must be logged in to post a comment.