Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Classpath issues when using Design Engine in a servlet
jsherriff
I'm trying to use the design engine in a servlet under grails and have classnotfound issues when referencing plug-in jars. This is what I'm trying:
IPlatformContext context = new PlatformServletContext(servletContext);
DesignConfig config = new DesignConfig();
config.setProperty("BIRT_HOME", servletContext.getRealPath(".") + "/WEB-INF/platform/")
config.setBIRTHome(servletContext.getRealPath(".") + "/WEB-INF/platform/")
config.setPlatformContext(context);
Platform.startup(config);
IDesignEngineFactory factory = (IDesignEngineFactory) Platform.createFactoryObject(IDesignEngineFactory.EXTENSION_DESIGN_ENGINE_FACTORY);
IDesignEngine engine = factory.createDesignEngine(config);
As soon as I reference a plugin class, I get:
Caused by: java.lang.NoClassDefFoundError: org.eclipse.birt.chart.reportitem.ChartXTabUtil
(for example).
Needless to say, the plugins dir is under WEB-INF/platform/. What might I be doing wrong?
Find more posts tagged with
Comments
jsherriff
After deeper investigating, this seems more sinister and less sinister at the same time. I worked around the not found exceptions by copying the reportitem jar to my lib - which doesn't seem like it should be necessary. I get further, but now I'm getting a classcastexception on org.eclipse.birt.chart.reportitem.ChartReportItemImpl at:
ChartReportItemImpl reportItem = (ChartReportItemImpl) chartHandle.getReportItem( );
Any ideas? I see another googlit with this same error, but it doesn't come to a resolution.
J
jsherriff
OK. The classcastexception seems due to the duplicate reportitem jars. Moving the jar from the plugins dir to lib (as opposed to copying it) results in other more fundamental things failing. This is ponderous. I'm back to square one.
I've tried setting my thread classloader to the osgi classloader to no avail. I've read that I'm not supposed to add the plugins jars to my classpath...how's this supposed to work?
J