final ClassLoader loader = ObjectUtilities.getClassLoader(getClass());
Class.forName("org.mozilla.javascript.Context", false, loader);
}
catch (Exception e)
{
throw new ModuleInitializeException("Unable to load the Rhino scripting framework class. " +
"This class is required to execute the RhinoExpressions.");
}
final URL expressionMetaSource = ObjectUtilities.getResource
("org/pentaho/reporting/engine/classic/extensions/modules/rhino/meta-expressions.xml", RhinoModule.class);
if (expressionMetaSource == null)
{
throw new ModuleInitializeException("Error: Could not find the expression meta-data description file");
}
try
{
ExpressionRegistry.getInstance().registerFromXml(expressionMetaSource);
}
catch (Exception e)
{
throw new ModuleInitializeException("Error: Could not parse the element meta-data description file", e);
}
}