Dukascopy Support Board
http://www.dukascopy.com/swiss/english/forex/jforex/forum/

Exceptions to Java Console in IChartObject hierarchy
http://www.dukascopy.com/swiss/english/forex/jforex/forum/viewtopic.php?f=88&t=48365
Page 1 of 1

Author:  hyperscalper [ Tue 20 Nov, 2012, 19:31 ]
Post subject:  Exceptions to Java Console in IChartObject hierarchy

In JForex platform update, v 2.21.8 with API v 2.7.5.2 I received the following exception in the Java Console resulting from one of my Strategy modules.

Related to code in IChartObject or IHorizontalLineChartObject I believe.

This is non-urgent because it does not yet appear to affect execution of my Strategy module, but it is just thrown frequently to the Java Console.

Below, I show TWO points in my code which appear to generate the exception. Please advise when you get a chance. I don't mind changing the code to work around it, if possible.

I did a recompilation of the .jfx but the issue is still there. No code was changed, and it was fine on the prior version. Might be interesting to know why?

        // draw a horizontal line
        final IHorizontalLineChartObject myDrawDashedHorizontalLine(final IChart chart,final String key, IChart.Type type, long time, double price) {
            IChartObject existing = chart.get(key);
            if (existing!=null) {
                chart.remove(existing); // otherwise, they accumulate?
            }
            IChartObjectFactory factory = chart.getChartObjectFactory();
            IHorizontalLineChartObject co = factory.createHorizontalLine(key, price); // .createLabel(key, time, price);
            co.setStroke(dashedStroke); // <-- Line 280 exception generated here
            return co;
        }
       
Here is the definition of dashedStroke:
   final static Stroke dashedStroke = new BasicStroke(
            1.0f,
            BasicStroke.CAP_BUTT,
            BasicStroke.JOIN_BEVEL,
            0,
            new float[] {3,7},//dashed line
            0);



20.11.2012 13:11:06.500 SEVERE settings.f ] Node has been removed.
java.lang.IllegalStateException: Node has been removed.
at java.util.prefs.AbstractPreferences.put(Unknown Source)
at java.util.prefs.AbstractPreferences.putByteArray(Unknown Source)
at com.dukascopy.dds2.greed.gui.settings.f.a(Unknown Source)
at com.dukascopy.dds2.greed.gui.settings.f.e(Unknown Source)
at com.dukascopy.dds2.greed.gui.settings.b.c(Unknown Source)
at com.dukascopy.dds2.greed.gui.component.chart.aa.n(Unknown Source)
at com.dukascopy.charts.b.b.n(Unknown Source)
at com.dukascopy.charts.chartbuilder.f.propertyChange(Unknown Source)
at java.beans.PropertyChangeSupport.firePropertyChange(Unknown Source)
at javax.swing.event.SwingPropertyChangeSupport.firePropertyChange(Unknown Source)
at java.beans.PropertyChangeSupport.firePropertyChange(Unknown Source)
at com.dukascopy.charts.drawings.ChartObject.firePropertyChange(Unknown Source)
at com.dukascopy.charts.drawings.ChartObject.setStroke(Unknown Source)
at com.fs.jforex.HyperScalperDashboardImpl.myDrawDashedHorizontalLine(HyperScalperDashboardImpl.java:280)
at com.fs.jforex.HyperScalperDashboardImpl.onTick(HyperScalperDashboardImpl.java:543)
at com.fs.jforex.HyperScalperDashboard.onTick(HyperScalperDashboard.java:88)
at com.dukascopy.api.impl.execution.w.bK(Unknown Source)
at com.dukascopy.api.impl.execution.a.call(Unknown Source)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at com.dukascopy.api.impl.execution.g$a.f(Unknown Source)
at com.dukascopy.api.impl.execution.g$a.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)


Also the following related exception from Line 409 of my code:
                IChartObject chartObject = myDrawHorizontalLine(chart,"BidLine", IChart.Type.HLINE, nowTime, tickBid); 
                chartObject.setColor(Color.GRAY); // <-- Line 409 Exception from here
                chart.addToMainChart(chartObject);
               


20.11.2012 13:18:53.425 SEVERE settings.f ] Node has been removed.
java.lang.IllegalStateException: Node has been removed.
at java.util.prefs.AbstractPreferences.put(Unknown Source)
at java.util.prefs.AbstractPreferences.putByteArray(Unknown Source)
at com.dukascopy.dds2.greed.gui.settings.f.a(Unknown Source)
at com.dukascopy.dds2.greed.gui.settings.f.e(Unknown Source)
at com.dukascopy.dds2.greed.gui.settings.b.c(Unknown Source)
at com.dukascopy.dds2.greed.gui.component.chart.aa.n(Unknown Source)
at com.dukascopy.charts.b.b.n(Unknown Source)
at com.dukascopy.charts.chartbuilder.f.propertyChange(Unknown Source)
at java.beans.PropertyChangeSupport.firePropertyChange(Unknown Source)
at javax.swing.event.SwingPropertyChangeSupport.firePropertyChange(Unknown Source)
at java.beans.PropertyChangeSupport.firePropertyChange(Unknown Source)
at com.dukascopy.charts.drawings.ChartObject.firePropertyChange(Unknown Source)
at com.dukascopy.charts.drawings.ChartObject.setColor(Unknown Source)
at com.fs.jforex.HyperScalperDashboardImpl.onTick(HyperScalperDashboardImpl.java:409)
at com.fs.jforex.HyperScalperDashboard.onTick(HyperScalperDashboard.java:88)
at com.dukascopy.api.impl.execution.w.bK(Unknown Source)
at com.dukascopy.api.impl.execution.a.call(Unknown Source)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at com.dukascopy.api.impl.execution.g$a.f(Unknown Source)
at com.dukascopy.api.impl.execution.g$a.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

Author:  hyperscalper [ Wed 21 Nov, 2012, 18:51 ]
Post subject:  Re: Exceptions to Java Console in IChartObject hierarchy

Hi. I'm running the latest v2.21.9 update and am still receiving these Java Console stacktraces originating from various locations within my code, all related to the ChartObject area. This Strategy module is placing various horizontal and vertical lines on a chart.

Some issues seem to remain in AbstractPreferences within the JForex code.

NON-URGENT as the code appears to run, despite the thrown exceptions.

21.11.2012 12:40:04.524   SEVERE                     settings.f ] Node has been removed.
java.lang.IllegalStateException: Node has been removed.
   at java.util.prefs.AbstractPreferences.put(Unknown Source)
   at java.util.prefs.AbstractPreferences.putByteArray(Unknown Source)
   at com.dukascopy.dds2.greed.gui.settings.f.a(Unknown Source)
   at com.dukascopy.dds2.greed.gui.settings.f.e(Unknown Source)
   at com.dukascopy.dds2.greed.gui.settings.b.c(Unknown Source)
   at com.dukascopy.dds2.greed.gui.component.chart.aa.n(Unknown Source)
   at com.dukascopy.charts.b.b.n(Unknown Source)
   at com.dukascopy.charts.chartbuilder.f.propertyChange(Unknown Source)
   at java.beans.PropertyChangeSupport.firePropertyChange(Unknown Source)
   at javax.swing.event.SwingPropertyChangeSupport.firePropertyChange(Unknown Source)
   at java.beans.PropertyChangeSupport.firePropertyChange(Unknown Source)
   at com.dukascopy.charts.drawings.ChartObject.firePropertyChange(Unknown Source)
   at com.dukascopy.charts.drawings.ChartObject.setFont(Unknown Source)
   at com.dukascopy.charts.drawings.ChartObject.setText(Unknown Source)
   at com.fs.jforex.HyperScalperDashboardImpl.onTick(HyperScalperDashboardImpl.java:622)
   at com.fs.jforex.HyperScalperDashboard.onTick(HyperScalperDashboard.java:88)
   at com.dukascopy.api.impl.execution.w.bN(Unknown Source)
   at com.dukascopy.api.impl.execution.a.call(Unknown Source)
   at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
   at java.util.concurrent.FutureTask.run(Unknown Source)
   at com.dukascopy.api.impl.execution.g$a.f(Unknown Source)
   at com.dukascopy.api.impl.execution.g$a.run(Unknown Source)
   at java.lang.Thread.run(Unknown Source)
21.11.2012 12:40:05.964   SEVERE                     settings.f ] Node has been removed.
java.lang.IllegalStateException: Node has been removed.
   at java.util.prefs.AbstractPreferences.put(Unknown Source)
   at java.util.prefs.AbstractPreferences.putByteArray(Unknown Source)
   at com.dukascopy.dds2.greed.gui.settings.f.a(Unknown Source)
   at com.dukascopy.dds2.greed.gui.settings.f.e(Unknown Source)
   at com.dukascopy.dds2.greed.gui.settings.b.c(Unknown Source)
   at com.dukascopy.dds2.greed.gui.component.chart.aa.n(Unknown Source)
   at com.dukascopy.charts.b.b.n(Unknown Source)
   at com.dukascopy.charts.chartbuilder.f.propertyChange(Unknown Source)
   at java.beans.PropertyChangeSupport.firePropertyChange(Unknown Source)
   at javax.swing.event.SwingPropertyChangeSupport.firePropertyChange(Unknown Source)
   at java.beans.PropertyChangeSupport.firePropertyChange(Unknown Source)
   at com.dukascopy.charts.drawings.ChartObject.firePropertyChange(Unknown Source)
   at com.dukascopy.charts.drawings.ChartObject.setColor(Unknown Source)
   at com.fs.jforex.HyperScalperDashboardImpl.onTick(HyperScalperDashboardImpl.java:409)
   at com.fs.jforex.HyperScalperDashboard.onTick(HyperScalperDashboard.java:88)
   at com.dukascopy.api.impl.execution.w.bN(Unknown Source)
   at com.dukascopy.api.impl.execution.a.call(Unknown Source)
   at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
   at java.util.concurrent.FutureTask.run(Unknown Source)
   at com.dukascopy.api.impl.execution.g$a.f(Unknown Source)
   at com.dukascopy.api.impl.execution.g$a.run(Unknown Source)
   at java.lang.Thread.run(Unknown Source)
21.11.2012 12:40:06.312   SEVERE                     settings.f ] Node has been removed.
java.lang.IllegalStateException: Node has been removed.
   at java.util.prefs.AbstractPreferences.put(Unknown Source)
   at java.util.prefs.AbstractPreferences.putByteArray(Unknown Source)
   at com.dukascopy.dds2.greed.gui.settings.f.a(Unknown Source)
   at com.dukascopy.dds2.greed.gui.settings.f.e(Unknown Source)
   at com.dukascopy.dds2.greed.gui.settings.b.c(Unknown Source)
   at com.dukascopy.dds2.greed.gui.component.chart.aa.n(Unknown Source)
   at com.dukascopy.charts.b.b.n(Unknown Source)
   at com.dukascopy.charts.chartbuilder.f.propertyChange(Unknown Source)
   at java.beans.PropertyChangeSupport.firePropertyChange(Unknown Source)
   at javax.swing.event.SwingPropertyChangeSupport.firePropertyChange(Unknown Source)
   at java.beans.PropertyChangeSupport.firePropertyChange(Unknown Source)
   at com.dukascopy.charts.drawings.ChartObject.firePropertyChange(Unknown Source)
   at com.dukascopy.charts.drawings.ChartObject.setColor(Unknown Source)
   at com.fs.jforex.HyperScalperDashboardImpl.onTick(HyperScalperDashboardImpl.java:583)
   at com.fs.jforex.HyperScalperDashboard.onTick(HyperScalperDashboard.java:88)
   at com.dukascopy.api.impl.execution.w.bN(Unknown Source)
   at com.dukascopy.api.impl.execution.a.call(Unknown Source)
   at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
   at java.util.concurrent.FutureTask.run(Unknown Source)
   at com.dukascopy.api.impl.execution.g$a.f(Unknown Source)
   at com.dukascopy.api.impl.execution.g$a.run(Unknown Source)
   at java.lang.Thread.run(Unknown Source)
21.11.2012 12:40:06.628   SEVERE                     settings.f ] Node has been removed.
java.lang.IllegalStateException: Node has been removed.
   at java.util.prefs.AbstractPreferences.put(Unknown Source)
   at java.util.prefs.AbstractPreferences.putByteArray(Unknown Source)
   at com.dukascopy.dds2.greed.gui.settings.f.a(Unknown Source)
   at com.dukascopy.dds2.greed.gui.settings.f.e(Unknown Source)
   at com.dukascopy.dds2.greed.gui.settings.b.c(Unknown Source)
   at com.dukascopy.dds2.greed.gui.component.chart.aa.n(Unknown Source)
   at com.dukascopy.charts.b.b.n(Unknown Source)
   at com.dukascopy.charts.chartbuilder.f.propertyChange(Unknown Source)
   at java.beans.PropertyChangeSupport.firePropertyChange(Unknown Source)
   at javax.swing.event.SwingPropertyChangeSupport.firePropertyChange(Unknown Source)
   at java.beans.PropertyChangeSupport.firePropertyChange(Unknown Source)
   at com.dukascopy.charts.drawings.ChartObject.firePropertyChange(Unknown Source)
   at com.dukascopy.charts.drawings.ChartObject.setFont(Unknown Source)
   at com.dukascopy.charts.drawings.ChartObject.setText(Unknown Source)
   at com.fs.jforex.HyperScalperDashboardImpl.onTick(HyperScalperDashboardImpl.java:622)
   at com.fs.jforex.HyperScalperDashboard.onTick(HyperScalperDashboard.java:88)
   at com.dukascopy.api.impl.execution.w.bN(Unknown Source)
   at com.dukascopy.api.impl.execution.a.call(Unknown Source)
   at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
   at java.util.concurrent.FutureTask.run(Unknown Source)
   at com.dukascopy.api.impl.execution.g$a.f(Unknown Source)
   at com.dukascopy.api.impl.execution.g$a.run(Unknown Source)
   at java.lang.Thread.run(Unknown Source)
Size Bias Primed !
21.11.2012 12:40:43.374  WARNING                    datacache.u ] WARN: file [https://www.dukascopy.com/datafeed/EURUSD/2003/07/05/BID_candles_min_1.bi5] was not found [https://www.dukascopy.com/datafeed/EURUSD/2003/07/05/BID_candles_min_1.bi5]
21.11.2012 12:40:51.771   SEVERE                     settings.f ] Node has been removed.
java.lang.IllegalStateException: Node has been removed.
   at java.util.prefs.AbstractPreferences.put(Unknown Source)
   at java.util.prefs.AbstractPreferences.putByteArray(Unknown Source)
   at com.dukascopy.dds2.greed.gui.settings.f.a(Unknown Source)
   at com.dukascopy.dds2.greed.gui.settings.f.e(Unknown Source)
   at com.dukascopy.dds2.greed.gui.settings.b.c(Unknown Source)
   at com.dukascopy.dds2.greed.gui.component.chart.aa.n(Unknown Source)
   at com.dukascopy.charts.b.b.n(Unknown Source)
   at com.dukascopy.charts.chartbuilder.f.propertyChange(Unknown Source)
   at java.beans.PropertyChangeSupport.firePropertyChange(Unknown Source)
   at javax.swing.event.SwingPropertyChangeSupport.firePropertyChange(Unknown Source)
   at java.beans.PropertyChangeSupport.firePropertyChange(Unknown Source)
   at com.dukascopy.charts.drawings.ChartObject.firePropertyChange(Unknown Source)
   at com.dukascopy.charts.drawings.ChartObject.setColor(Unknown Source)
   at com.fs.jforex.HyperScalperDashboardImpl.onTick(HyperScalperDashboardImpl.java:484)
   at com.fs.jforex.HyperScalperDashboard.onTick(HyperScalperDashboard.java:88)
   at com.dukascopy.api.impl.execution.w.bN(Unknown Source)
   at com.dukascopy.api.impl.execution.a.call(Unknown Source)
   at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
   at java.util.concurrent.FutureTask.run(Unknown Source)
   at com.dukascopy.api.impl.execution.g$a.f(Unknown Source)
   at com.dukascopy.api.impl.execution.g$a.run(Unknown Source)
   at java.lang.Thread.run(Unknown Source)

Author:  API Support [ Thu 22 Nov, 2012, 14:29 ]
Post subject:  Re: Exceptions to Java Console in IChartObject hierarchy

The fix is included in API 2.7.6.

Author:  hyperscalper [ Thu 22 Nov, 2012, 16:49 ]
Post subject:  Re: Exceptions to Java Console in IChartObject hierarchy

Thank you. I can easily wait until that API level is supported by the JForex platform where I run the Strategy modules, rather than standalone.
HyperScalper

  Page 1 of 1