Application uses ICEpdf and sometimes printing is not possible after its start.
After restart it works fine, but doing it every time is tedious.

Exception in the log says:

..... (own created exception) .....
nested exception is: java.util.MissingResourceException: Can't find bundle for base name org.icepdf.ri.resources.MessageBundle, locale de_DE
    at java.util.ResourceBundle.throwMissingResourceException(Unknown Source)
    at java.util.ResourceBundle.getBundleImpl(Unknown Source)
    at java.util.ResourceBundle.getBundle(Unknown Source)
    at org.icepdf.ri.common.SwingController.<init>(SwingController.java:274)
    at org.icepdf.ri.common.SwingController.<init>(SwingController.java:257)
.....

which repeats until restart.

I've checked used library icepdf-viewer-4.2.2 and in \org\icepdf\ri\resources there is MessageBundle_de.properties file.

Does anyone have ever experienced this and could support/advise how to fix it?

1

There are 1 best solutions below

0
On

Most probably issue is caused by change of Java version from 1.6 to 1.8
Workaround was to cache resource bundles being used. And in case of MissingResourceException exception during SwingController creation catch it and create defaule ResourceBundle:

...
SwingController sc = null;
...
} catch (MissingResourceException e) {
      ResourceBundle bundle = new PropertyResourceBundle(new ByteArrayInputStream(new byte[0]));
      sc = new SwingController(bundle);
}
...

Hope this helps someone facing same issue.