NullPointerException in com.lowagie.text.rtf.parser.destinations.RtfDestinationFontTable.importSystemFonts()
OS: AIX 6.1
Application Server: JBoss 4.2.3.GA
RtfDestinationFontTable.getEnvironmentVariables method throws exception when running in managed environment under application server.
so line "String systemRoot = pr.getProperty("SystemRoot");" causes NullPointerException cause Properties pr aren't initialized.
We use folowing fix:
com.lowagie.text.rtf.parser.destinations.RtfDestinationFontTable.importSystemFonts:
private void importSystemFonts() {
Properties pr = null;
try {
pr = getEnvironmentVariables();
} catch (Throwable e) {
}
if (null != pr)
{
String systemRoot = pr.getProperty("SystemRoot");
String fileSeperator = System.getProperty("file.separator");
FontFactory.registerDirectory(systemRoot + fileSeperator + "fonts");
}
}
Anonymous
JBoss exception stacktrace