Dukascopy
 
 
Wiki JStore Search Login

rangeCheck error in userInterface.getBottomTab()
 Post subject: rangeCheck error in userInterface.getBottomTab() Post rating: 0   New post Posted: Sat 17 Sep, 2016, 15:44 

User rating: 1
Joined: Tue 24 Apr, 2012, 13:41
Posts: 39
Hello,

Below is the error demonstration.

In JForex I open three almost identical simple strategies:
package jforex;
 
import com.dukascopy.api.*;
import javax.swing.*;

public class XXXX implements IStrategy {
    private IUserInterface userInterface = null;
   private final String tabName = "XXXX tab";
 
    @Override
    public void onStart(IContext context) throws JFException {
        this.userInterface = context.getUserInterface();
        JPanel tab = userInterface.getBottomTab(tabName);
    }
 
    @Override
    public void onTick(Instrument instrument, ITick tick) throws JFException {}
 
    @Override
    public void onBar(Instrument instrument, Period period, IBar askBar, IBar bidBar) throws JFException {}
 
    @Override
    public void onMessage(IMessage message) throws JFException {}
 
    @Override
    public void onAccount(IAccount account) throws JFException {}
 
    @Override
    public void onStop() throws JFException {
        if (userInterface != null) {
            userInterface.removeBottomTab(tabName);
        }
    }
}

The only one difference between strategies is XXXX replaced by YYYY and ZZZZ consequently (all files attached).
Attachment:
File comment: Strategy #1
XXXX.java [956 Bytes]
Downloaded 77 times
Attachment:
File comment: Strategy #2
YYYY.java [956 Bytes]
Downloaded 58 times
Attachment:
File comment: Strategy #3
ZZZZ.java [956 Bytes]
Downloaded 81 times


I do the following steps:
  1. in the "Strategies" tab I select all three strategies,
  2. in the "Strategies" tab I press "start" button once,
  3. I close log tabs for all strategies (i.e. tabs named "XXXX", "YYYY", "ZZZZ" and eventually ""). I close those tabs because (1) I don’t need them, (2) those tabs take place on my dashboard and (3) change its layout,
  4. in "Strategies" tab I press "stop" button,
  5. in "Strategies" tab I press "start" button again,
  6. I do repeat aforementioned steps 3-5 until an error occurs (usually 1-3 times).

As a result the following error occurs:
JForex log:
Quote:
12:40:23 Strategy "ZZZZ" is stopped at 2016-09-17 12:40:23.354 GMT on the local computer with no parameters. Reason: Stopped by Engine
12:40:23 Strategy "YYYY" is stopped at 2016-09-17 12:40:23.329 GMT on the local computer with no parameters. Reason: Stopped by Engine
12:40:23 Stopping "ZZZZ" strategy at 2016-09-17 12:40:23.302 GMT on the local computer
12:40:23 Stopping "YYYY" strategy at 2016-09-17 12:40:23.302 GMT on the local computer
12:40:13 Strategy "XXXX" is stopped at 2016-09-17 12:40:13.342 GMT on the local computer with no parameters. Reason: Stopped by Engine
12:40:13 Strategy "ZZZZ" Strategy ID: D49D8E07B1B721A62B641E3F854B9DBC is started at 2016-09-17 12:40:13.260 GMT on the local computer with no parameters
12:40:13 Stopping "XXXX" strategy at 2016-09-17 12:40:13.260 GMT on the local computer
12:40:13 java.lang.IndexOutOfBoundsException: Index: 9, Tab count: 9 @ javax.swing.JTabbedPane.checkIndex(Unknown Source)
12:40:13 Strategy "YYYY" Strategy ID: DBBEF3FC6136D755A07D4BF5BC18C9B7 is started at 2016-09-17 12:40:13.226 GMT on the local computer with no parameters
12:40:13 Strategy "XXXX" Strategy ID: 060520EFF8FA30A31A78FBEEF1F57442 is started at 2016-09-17 12:40:13.135 GMT on the local computer with no parameters
12:40:13 Starting "ZZZZ" strategy at 2016-09-17 12:40:13.135 GMT on the local computer
12:40:13 Starting "YYYY" strategy at 2016-09-17 12:40:13.135 GMT on the local computer
12:40:13 Starting "XXXX" strategy at 2016-09-17 12:40:13.135 GMT on the local computer
12:40:07 Strategy "XXXX" is stopped at 2016-09-17 12:40:07.012 GMT on the local computer with no parameters. Reason: Stopped by Engine


Java Console:
Quote:
2016-09-17 16:13:34.287 WARN c - Index: 5, Size: 0
java.lang.IndexOutOfBoundsException: Index: 5, Size: 0
at java.util.ArrayList.rangeCheck(Unknown Source)
at java.util.ArrayList.get(Unknown Source)
at javax.swing.JTabbedPane.getTabComponentAt(Unknown Source)
at com.dukascopy.dds2.greed.gui.docking.components.tabbedpane.CustomTabbedPane.setSelectedIndex(L:53)
at javax.swing.JTabbedPane.setSelectedComponent(Unknown Source)
at com.dukascopy.dds2.greed.gui.component.chart.a.dI(L:801)
at com.dukascopy.dds2.greed.gui.docking.a.c.d(L:174)
at com.dukascopy.dds2.greed.gui.docking.a.c.e(L:186)
at com.dukascopy.dds2.greed.gui.component.chart.a.b(L:470)
at com.dukascopy.dds2.greed.agent.n.getBottomTab(L:50)
at jforex.XXXX.onStart(XXXX.java:13)
at com.dukascopy.api.impl.execution.u.call(L:27)
at com.dukascopy.api.impl.execution.u.call(L:13)
at com.dukascopy.api.impl.connect.aq.a(L:127)
at com.dukascopy.api.impl.connect.cd.bP(L:700)
at com.dukascopy.api.impl.connect.cd.call(L:666)
at com.dukascopy.api.impl.execution.k.call(L:34)
at java.util.concurrent.FutureTask.run(Unknown Source)
at com.dukascopy.api.impl.execution.g$a.f(L:904)
at com.dukascopy.api.impl.execution.g$a.run(L:926)
at java.lang.Thread.run(Unknown Source)
2016-09-17 16:13:34.369 ERROR c - Uncaught exception in [AWT-EventQueue-2] thread: null
java.lang.ClassCastException
at javax.swing.LayoutComparator.compare(Unknown Source)
at javax.swing.LayoutComparator.compare(Unknown Source)
at java.util.Arrays.mergeSort(Unknown Source)
at java.util.Arrays.mergeSort(Unknown Source)
at java.util.Arrays.mergeSort(Unknown Source)
at java.util.Arrays.mergeSort(Unknown Source)
at java.util.Arrays.mergeSort(Unknown Source)
at java.util.Arrays.mergeSort(Unknown Source)
at java.util.Arrays.mergeSort(Unknown Source)
at java.util.Arrays.mergeSort(Unknown Source)
at java.util.Arrays.legacyMergeSort(Unknown Source)
at java.util.Arrays.sort(Unknown Source)
at java.util.ArrayList.sort(Unknown Source)
at java.util.Collections.sort(Unknown Source)
at javax.swing.SortingFocusTraversalPolicy.enumerateAndSortCycle(Unknown Source)
at javax.swing.SortingFocusTraversalPolicy.getFocusTraversalCycle(Unknown Source)
at javax.swing.SortingFocusTraversalPolicy.getComponentAfter(Unknown Source)
at javax.swing.LayoutFocusTraversalPolicy.getComponentAfter(Unknown Source)
at java.awt.Component.getNextFocusCandidate(Unknown Source)
at java.awt.DefaultKeyboardFocusManager.doRestoreFocus(Unknown Source)
at java.awt.DefaultKeyboardFocusManager.restoreFocus(Unknown Source)
at java.awt.DefaultKeyboardFocusManager.dispatchEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$500(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
2016-09-17 16:13:52.085 ERROR c - Uncaught exception in [AWT-EventQueue-2] thread: No such child: 5
java.lang.ArrayIndexOutOfBoundsException: No such child: 5
at java.awt.Container.getComponent(Unknown Source)
at javax.swing.BoxLayout.checkRequests(Unknown Source)
at javax.swing.BoxLayout.preferredLayoutSize(Unknown Source)
at com.dukascopy.dds2.greed.gui.docking.components.ClientDockableHeader.ajJ(L:335)
at com.dukascopy.dds2.greed.gui.docking.components.ClientDockableHeader.b(L:293)
at com.dukascopy.dds2.greed.gui.component.message.MessagePanel.d(L:247)
at com.dukascopy.dds2.greed.gui.component.message.MessagePanel.a(L:196)
at com.dukascopy.dds2.greed.gui.component.message.MessagePanel.a(L:112)
at com.dukascopy.dds2.greed.gui.ClientForm.a(L:562)
at com.dukascopy.dds2.greed.actions.PostMessageAction.GN(L:109)
at com.dukascopy.dds2.greed.actions.e.run(L:65)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$500(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
2016-09-17 16:13:52.671 ERROR o$b - Exception thrown while running onStart method: null
java.util.ConcurrentModificationException
at java.util.ArrayList$Itr.checkForComodification(Unknown Source)
at java.util.ArrayList$Itr.next(Unknown Source)
at com.dukascopy.docking.framework.tree.DockableTree.a(L:454)
at com.dukascopy.docking.framework.tree.DockableTree.Fq(L:313)
at com.dukascopy.dds2.greed.gui.docking.top.b.a(L:96)
at com.dukascopy.dds2.greed.gui.docking.top.b.a(L:77)
at com.dukascopy.dds2.greed.gui.component.chart.a.b(L:467)
at com.dukascopy.dds2.greed.agent.n.getBottomTab(L:50)
at jforex.XXXX.onStart(XXXX.java:13)
at com.dukascopy.api.impl.execution.u.call(L:27)
at com.dukascopy.api.impl.execution.u.call(L:13)
at com.dukascopy.api.impl.connect.aq.a(L:127)
at com.dukascopy.api.impl.connect.cd.bP(L:700)
at com.dukascopy.api.impl.connect.cd.call(L:666)
at com.dukascopy.api.impl.execution.k.call(L:34)
at java.util.concurrent.FutureTask.run(Unknown Source)
at com.dukascopy.api.impl.execution.g$a.f(L:904)
at com.dukascopy.api.impl.execution.g$a.run(L:926)
at java.lang.Thread.run(Unknown Source)


Would you address the issue?

Best regards,
FXer


 

Jump to:  

  © 1998-2024 Dukascopy® Bank SA
On-line Currency forex trading with Swiss Forex Broker - ECN Forex Brokerage,
Managed Forex Accounts, introducing forex brokers, Currency Forex Data Feed and News
Currency Forex Trading Platform provided on-line by Dukascopy.com