Developer FAQ - GeoscienceAustralia/earthsci GitHub Wiki
This page lists FAQs and common issues encountered by developers. Have a quick look here before you create an issue of send an email, in case your problem has been encountered before.
Contents:
Building the project
java.lang.OutOfMemoryError during Maven/tycho build
Sometimes the Tycho reactor build runs out of heap space during the build. This can usually be fixed by increasing the maximum heap size used by the JVM during a maven build.
>> set MAVEN_OPTS=-Xmx2048m
>> mvn clean install
If you are launching maven as an external tool within Eclipse, the MAVEN_OPTS variable can be set on the "Environment" tab of the run configuration.
Maven/tycho build always querying p2 indexes
This is a known bug in Maven/tycho. A solution that will speed up build time is to run the build with the offline (-o
or --offline
) flag. This will not query out to remote repos.
See: http://stackoverflow.com/questions/10085485/disable-fetching-of-p2-repository-indexes
Running the project
"No application ID found" exception on startup
This usually occurs when running from within Eclipse with a mis-configured run configuration - usually the result of missing plugins in the run config.
- Open the run configuration dialog
Run->Run configurations
- Select the run configuration for the product
- Navigate to the plugins tab
- Click "Validate Plug-ins"
This will show any missing plugins needed to launch the application. You can either manually fix the configuration by selecting the missing plugins, or you can try "Add Required Plug-ins" to automatically resolve mandatory plugins.
This process can be a bit fiddly to get right, but once setup will require little change.
If you can't get a certain run configuration to run, or you are getting lots of errors (eg when opening the Preferences panel), you can revert to a working run configuration by following these steps:
- Delete any run configurations associated with the au.gov.ga.earthsci.application.product product.
- Open the au.gov.ga.earthsci.application.product file in the au.gov.ga.earthsci.application.product plugin, and click the little play button ("Launch an Eclipse application"). The configuration will fail to run with the "No application id has been found" error.
- Open the "Run Configurations..." dialog, navigate to the Plug-ins tab, unselect "Include optional dependencies when computing required plugins", select "Validate plug-ins automatically prior to launching", and click "Add Required Plug-ins".
- Add any optional plugins you want to include in the configuration (such as a theme plugin or any plugins you're working on).
- Delete your workspace folder (defined in the run configuration under Workspace Data->Location on the Main tab).
- The configuration should now run.
Odd "invalid operation on fragment" or "workbench not created" errors on startup
This is likely caused by OSGi bundles starting in the wrong order. The Eclipse plugin / OSGi bundle mechanism uses a 'start level' system to dictate what order bundles should load in, and whether they should auto-start or not.
When running from Eclipse these can be set in the run configuration under "Plugins".
The Webstart configuration is setup in the webstart project build.xml
in the generate-jnlp
goal.
The following configuration is known to work:
- Default start level "4"
- Auto-start defaulted to "false"
- The following bundles adjusted as below:
org.eclipse.core.runtime
: Auto-start="true"org.eclipse.equinox.common
: Auto-start="true"org.eclipse.equinox.ds
: Auto-start="true"org.eclipse.ui.ide
: Start-level="10"org.eclipse.osgi
: Start-level="-1"
The UI looks mostly ok, but all the parts are missing toolbars and menus etc.
Eclipse e4 uses an application UI model to maintain state of the application layout etc. between invocations of the application. Sometimes, particularly when running from an IDE, this can become stale/corrupted and cause the UI to fail to load correctly.
The easiest way to fix the problem is to launch the application with -clearPersistedState
. There is a ticket (#78) open to address this problem.