Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
My own chartevent handler does not get fired if and ONLY IF run in Debugger
hanl1
<p>So I am debugging a simple chart event handler that draws all data points on a chart in a particular color. It works well if I export my events to a .jar and include it as a resource in my .rptdesign file, but recently I have been trying to debug it in debug mode. (I'm on BIRT2.5.2 although there's no difference if I try this on BIRT3.7.*). The issue is, if I run it in debugger, the report will render, without any complaints, but only that the datapoints are no longer colored. After some digging and stuff I pinned the issue down to this point in </p><p>org.eclipse.birt.chart.script.AbstractScriptHandler::register(): </p><pre class="_prettyXprint _linenums:630"> if ( getEventHandlerClass().isAssignableFrom( handlerClass ) ) { try { javahandler = (T) SecurityUtil.newClassInstance( handlerClass ); } catch ( InstantiationException e ) { throw new ChartException( ChartEnginePlugin.ID, BirtException.ERROR, e ); } catch ( IllegalAccessException e ) { throw new ChartException( ChartEnginePlugin.ID, BirtException.ERROR, e ); } getLogger( ).log( ILogger.INFORMATION, Messages.getString( "Info.java.handler.loaded", //$NON-NLS-1$ handlerClass, ULocale.getDefault( ) ) ); }</pre><p>The first if statement returns false whereas handlerClass really is an implementation of getEventHandlerClass() which is IChartEventHandler.class. It is this if statement that eventually determines if my event handlers will be used. Some more painful debugging revealed that this might have something to do with java class loaders. I got to a point where I have solid observation that these two classes are loaded with different classloader and hence the 'false' if statement evaluation, but I have no idea how this happened or how to prevent this from happening. I know this is barely enough information for anyone to provide concrete help, I'm just wondering if anyone has seen similar issues before, or if someone can suggest a direction on how to resolve this, may it be a classpath setup, debug configuration, or hardcore debugging. Thanks.</p><p> </p><p> </p><p>EDIT: </p><p>Since I have little idea what could be the issue I did not post more details of my setup, because anything could be relevant or irrelevant. Please ask me for more info that you think might matter. I will actively monitor this thread. </p>
Find more posts tagged with
Comments
kclark
<p>So the chart is rendered correctly when your not debugging, correct? I don't use the debugger too much, but I've got some interesting behavior in the past when using it which is why I do most of my debugging from the console using eclipsec.exe and reading the output. I know this might not help too much. Generally speaking I get more debugging done just using eclipsec.exe instead of the debugger in the designer.</p>