Community
Participate
Working Groups
I have run into an issue with BIRT with used in Mifos (http://mifos.org), detailed in http://mifosforge.jira.com/browse/MIFOS-4765. It appears that BIRT (version 2.5.0 used in Mifos) is unable to load the org.eclipse.osgi_3.5.0.v20090520.jar when it is in a packaged WAR's WEB-INF/lib, if the Servlet Container temporary directory (which the OSGi JAR gets copied into) contains e.g. '+' characters (which is common for temporary directories on Mac OS X). I've debugged this and seen that this is because org.eclipse.birt.core.framework.URLClassLoader's getFilePath() uses URLDecoder.decode( path, "utf-8" ) which removes the '+' characters, and then the JAR can't be loaded. The purpose of this issue to suggest to the BIRT development team that using URLDecoder.decode(path, "utf-8") in org.eclipse.birt.core.framework.URLClassLoader's getFilePath() is plain simply buggy IMHO - a local filesystem (temporary) directory name is not an URL? I'd argue that URLDecoder.decode() should be either removed or replaced by a more suitable API (but am unclear what the original intention of that decode in that method actually was - but then have only stumbled upon that code, and may well miss the overall purpose). The workaround used in Mifos is to set a suitable (i.e. "no '+' characters") WAR temp directory, that solves this; I've tested it via programmatic warCtx.setTempDirectory() in an Embedded Jetty test case as well as with mkdir $JETTY_HOME/work in a standalone Jetty (http://docs.codehaus.org/display/JETTY/Temporary+Directories).
Don't invoke URLDecoder.decode( path, "utf-8" ) to get file path, it's unnecessary.
Use custom decoding method instead of URLDecoder.decode() to decode file path in url. The method will ignore character '+' and acts exactly same as URLClassLoader of java does. Please notice that paths containing character '%' can't be supported either.
Verified in daily build 3.7.0.v20110412-0630