Search code examples
eclipse-plugineclipse-rcp

Fragment Missing From Product


I created a localization fragment for one of our projects which works nicely when started from the IDE, but not at all when started from the exported product.

The fragment itself only really has two files, a MANIFEST.MF:

Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: L10N Fragment
Bundle-SymbolicName: org.acme.module.nl_xx;singleton:=true
Bundle-Version: 3.0.6.qualifier
Bundle-Vendor: ACME
Fragment-Host: org.acme.module;bundle-version="[1.0.0,2.0.0)"
Bundle-RequiredExecutionEnvironment: JavaSE-11

...and a properties file messages_de_de_xx.properties:

Special = Something

The product is started with -nl de_DE_XX and -Djava.language=de -Djava.country=DE -Djava.variant=XX. As noted, it works from Eclipse, but not from the finished EXE.

Things I tried to debug / fix:

  • made sure the exported product contains the fragment
  • made sure the build.properties / fragment JAR contains the above two files
  • played around with the country and variant (toggled upper and lower case)
  • cleared the OSGi instance area (i.e. the application preferences)
  • made sure the fragment is resolved using the OSGi console
  • tested it with a messages file for en_UK_XX (which is based on the English localization instead of the German one)
  • made sure that the files configuration\org.eclipse.equinox.simpleconfigurator\bundles.info and artifacts.xml contain something that looks plausible for the fragment

Nothing worked, so I'm out of ideas.

What could be the problem? What can I do to debug the application?


Solution

  • This is an incredible stupid problem. The messages file is supposed to have the name messages_de_DE_XX.properties (note that the last two segments are in upper case).

    My guess is it works when started from the IDE because Eclipse uses the filesystem and hence the OS standard, which is "ignore casing" for Windows.

    When started from the finished product however the files are in JARs, where casing is important.