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:
null argument:applicationXMI argument missing
In order to resolve that I had to add new program argument (Launching tab in Product Configuration Editor)
- Application crashing on start-up with another exception:
!ENTRY org.eclipse.osgi 4 0 2012-11-20 20:43:46.516
!MESSAGE Application error
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.
Many times when working with Eclipse RCP I had to generate ad-hoc updatesites (usually containing some 3rd party plug-ins). What I usually did to achieve this (with Eclipse IDE):
- create new feature project
- add plug-ins to the feature
- create new updatesite project
- add the feature to the updatesite (pre-p2 style – site.xml)
- export newly created updatesite (letting Eclipse to deal with creating p2 meta data)
Since I needed to automate this process I started researching on p2 capabilities and found out that it can be done from command line using FeatureAndBundlesPublisher application. Sample command line invocation to do it:
%ECLIPSE_EXE% -application org.eclipse.equinox.p2.publisher.FeaturesAndBundlesPublisher -metadataRepository file:/%P2_TARGET% -artifactRepository file:/%P2_TARGET% -source %P2_SRC% -compress -configs win32.win32.x86 -publishArtifacts
- ECLIPSE_EXE – points to Eclipse executable;
- P2_TARGET – path to an empty directory where p2 repository should be created;
- P2_SRC – path to the directory with /plugins subdirectory and plug-ins to be published (jar files) inside;
- -compress parameter is optional. It compresses artifacts.xml and content.xml to jar (zip) files.
4th edition of Java Developers’ Day is over. It was the first time I attended this conference. I enjoyed most of the sessions and the organization was pretty good. I will definitely plan to be there next year as well. My favorite JDD09 speakers/sessions:
There are several new and exciting features in Galileo release. Multiple projects, hundreds of contributors, huge audience…
I decided to choose my very personal Top 5 for Galileo release:
- Update. New UI for installing and updating new features in Eclipse really leverages user experience. After introducing p2 in 3.4 a lot of people missed old Update Manager. With more stable and matured p2 in 3.5 version hopefully no one is missing 3.3 style updates any more. One capability I would find useful there is installing particular Installable Units instead just these which are based on Eclipse features. In p2 world all IUs are supposed to be equal.
- Setting the cookies in Browser. I’m really happy to finally see setCookie(value, url) method in SWT Browser class. That’s the part of API that was really missing there to make embedded browser more functional in Eclipse RCP world. Next step would be probably providing SWT support for the Webkit based browsers.
- Target Platforms. Galileo way of defining target platform is another item I find really useful for Eclipse RCP. Finally at least partially runtime for Eclipse RCP application can be independent from the plug-ins set in Eclipse IDE used for development!
- Mylyn. Previous Mylyn version satisfied most of my requirements to work with Bugzilla. But new Mylyn Editor just feels better for me even if it took me a day or two to get used to the context activation button being moved from right to left side of the toolbar.
- OSGi Declarative Services. I’m excited about declarative services in Equinox. I didn’t have opportunity to try it yet but I have high hopes for the near future!
I’m considering learning new programming language or technology.
My very basic requirements:
- no for buying new laptop (I’m happy with my ThinkPad)
- no for buying new mobile device just to run something at all (I’m happy with my Nokia)
Single click …
Downloading update from http://wordpress.org/wordpress-2.8.zip
Unpacking the core update
Verifying the unpacked files
Installing the latest version
WordPress upgraded successfully
… and voilà! Upgrade completed!
The website of Państwowa Komisja Wyborcza (the institution responsible for the elections in Poland) around the time when the official results are supposed to be published.
Państwowa Komisja Wyborcza
Recently I’m getting a bit confused about p2. There is an update site created with PDE headless build. There are IUs generated for each plug-in/fragment/feature. Everything looks great so far.
Let’s assume: plug-in A and fragment B with a defined host plug-in A are sitting together on single update site. Plug-in A in reality cannot run without appropriate version of fragment B (e.g. situation similar to SWT).
My understanding of p2-power was that I wouldn’t need to create separate feature C aggregating A and B just to make fragment B be automatically installed when I request installation of plug-in A.
I spent some time on reviewing Eclipse Bugzilla and mailing lists. Interesting findings:
Any suggestions about handling such “required” fragment scenario without getting rid of autogenerated p2 repository and hand crafting p2 metadata?