Dukascopy
 
 
Wiki JStore Search Login

JFOREX-3611 AccessControlException when removing chart objects.
 Post subject: JFOREX-3611 AccessControlException when removing chart objects. Post rating: 0   New post Posted: Sat 18 Feb, 2012, 22:50 

User rating: 0
Joined: Wed 18 May, 2011, 23:19
Posts: 8
Location: Czech Republic,
I'm working on a strategy using 3 instruments on the same time, and for every instrument I'm using a chart to draw objects on it (from AOS). Everytime I receive new bar, I remove all objects from related chart and regenerate/redraw them again. However, when I call removeAll() on a chart that is not set as main, I'm receiving this exception (for every new bar):

java.security.AccessControlException: access denied (java.lang.RuntimePermission preferences)
at java.security.AccessControlContext.checkPermission(AccessControlContext.java:374)
at java.security.AccessController.checkPermission(AccessController.java:546)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
at java.util.prefs.Preferences.userRoot(Preferences.java:442)
at com.dukascopy.dds2.greed.gui.settings.e.Zy(Unknown Source)
at com.dukascopy.dds2.greed.gui.settings.e.ZA(Unknown Source)
at com.dukascopy.dds2.greed.gui.settings.e.ZC(Unknown Source)
at com.dukascopy.dds2.greed.gui.settings.e.XW(Unknown Source)
at com.dukascopy.dds2.greed.gui.settings.b.XW(Unknown Source)
at com.dukascopy.dds2.greed.gui.component.orders.ConditionalOrderEntryPanel.bE(Unknown Source)
at com.dukascopy.dds2.greed.gui.component.orders.ConditionalOrderEntryPanel.bz(Unknown Source)
at com.dukascopy.dds2.greed.gui.component.orders.OrderEntryPanel.bz(Unknown Source)
at com.dukascopy.dds2.greed.gui.a.f.aa(Unknown Source)
at com.dukascopy.dds2.greed.gui.o.valueChanged(Unknown Source)
at javax.swing.tree.DefaultTreeSelectionModel.fireValueChanged(DefaultTreeSelectionModel.java:629)
at javax.swing.tree.DefaultTreeSelectionModel.notifyPathChange(DefaultTreeSelectionModel.java:1078)
at javax.swing.tree.DefaultTreeSelectionModel.setSelectionPaths(DefaultTreeSelectionModel.java:287)
at com.dukascopy.dds2.greed.gui.component.tree.WorkspaceJTreeSelectionModel.setSelectionPaths(Unknown Source)
at javax.swing.tree.DefaultTreeSelectionModel.setSelectionPath(DefaultTreeSelectionModel.java:170)
at javax.swing.JTree.setSelectionPath(JTree.java:1598)
at com.dukascopy.dds2.greed.gui.component.tree.o.b(Unknown Source)
at com.dukascopy.dds2.greed.gui.component.chart.listeners.e.Y(Unknown Source)
at com.dukascopy.charts.b.b.Y(Unknown Source)
at com.dukascopy.charts.drawings.q.Y(Unknown Source)
at com.dukascopy.charts.drawings.j.gv(Unknown Source)
at com.dukascopy.charts.drawings.q.gv(Unknown Source)
at com.dukascopy.charts.chartbuilder.r.removeAll(Unknown Source)
at com.dukascopy.charts.d.b.removeAll(Unknown Source)
at meridian.Pair.onBar(Pair.java:111)
at meridian.LaManche.onBar(LaManche.java:61)
at com.dukascopy.dds2.greed.agent.strategy.tester.b.a(Unknown Source)
at com.dukascopy.dds2.greed.agent.strategy.tester.r.run(Unknown Source)
at com.dukascopy.dds2.greed.agent.strategy.tester.b.Bc(Unknown Source)
at com.dukascopy.dds2.greed.actions.StrategyTesterAction.yX(Unknown Source)
at com.dukascopy.dds2.greed.actions.StrategyTesterAction.yw(Unknown Source)
at com.dukascopy.dds2.greed.actions.c.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:680)

When I click on the chart to show instrument where removeAll() is called, I don't receive this exception anymore, and when I click on any other chart, I receive it again.


 
 Post subject: Re: AccessControlException when running strategy with multiple instruments. Post rating: 0   New post Posted: Thu 23 Feb, 2012, 13:30 
JForex Master
User avatar

User rating:
Joined: Wed 16 Sep, 2009, 18:23
Posts: 1054
Location: Geneva, Switzerland
Could you please provide the strategy or a piece of the code to help us investigate this.


 
 Post subject: Re: AccessControlException when running strategy with multiple instruments. Post rating: 0   New post Posted: Tue 20 Mar, 2012, 19:05 

User rating: 0
Joined: Tue 14 Feb, 2012, 11:24
Posts: 7
Location: Switzerland, ZH
Hallo,

i think i get the same error when trying to use IChart.removeAll() and multiple charts are open:

Single Message Exception:
18:00:50 java.security.AccessControlException: access denied (java.lang.RuntimePermission preferences) @ jforex.dailyPivot.cleanChart(dailyPivot.java:568)


Full Message:

java.security.AccessControlException: access denied (java.lang.RuntimePermission preferences)
at java.security.AccessControlContext.checkPermission(AccessControlContext.java:374)
at java.security.AccessController.checkPermission(AccessController.java:546)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
at java.util.prefs.Preferences.userRoot(Preferences.java:442)
at com.dukascopy.dds2.greed.gui.settings.e.Zw(Unknown Source)
at com.dukascopy.dds2.greed.gui.settings.e.Zy(Unknown Source)
at com.dukascopy.dds2.greed.gui.settings.e.ZA(Unknown Source)
at com.dukascopy.dds2.greed.gui.settings.e.XU(Unknown Source)
at com.dukascopy.dds2.greed.gui.settings.b.XU(Unknown Source)
at com.dukascopy.dds2.greed.gui.component.orders.ConditionalOrderEntryPanel.bE(Unknown Source)
at com.dukascopy.dds2.greed.gui.component.orders.ConditionalOrderEntryPanel.bz(Unknown Source)
at com.dukascopy.dds2.greed.gui.component.orders.OrderEntryPanel.bz(Unknown Source)
at com.dukascopy.dds2.greed.gui.a.f.aa(Unknown Source)
at com.dukascopy.dds2.greed.gui.o.valueChanged(Unknown Source)
at javax.swing.tree.DefaultTreeSelectionModel.fireValueChanged(DefaultTreeSelectionModel.java:629)
at javax.swing.tree.DefaultTreeSelectionModel.notifyPathChange(DefaultTreeSelectionModel.java:1078)
at javax.swing.tree.DefaultTreeSelectionModel.setSelectionPaths(DefaultTreeSelectionModel.java:287)
at com.dukascopy.dds2.greed.gui.component.tree.WorkspaceJTreeSelectionModel.setSelectionPaths(Unknown Source)
at javax.swing.tree.DefaultTreeSelectionModel.setSelectionPath(DefaultTreeSelectionModel.java:170)
at javax.swing.JTree.setSelectionPath(JTree.java:1598)
at com.dukascopy.dds2.greed.gui.component.tree.o.b(Unknown Source)
at com.dukascopy.dds2.greed.gui.component.chart.listeners.e.Y(Unknown Source)
at com.dukascopy.charts.b.b.Y(Unknown Source)
at com.dukascopy.charts.drawings.q.Y(Unknown Source)
at com.dukascopy.charts.drawings.j.gu(Unknown Source)
at com.dukascopy.charts.drawings.q.gu(Unknown Source)
at com.dukascopy.charts.chartbuilder.r.removeAll(Unknown Source)
at com.dukascopy.charts.d.b.removeAll(Unknown Source)
at jforex.dailyPivot.cleanChart(dailyPivot.java:568)
at jforex.dailyPivot.onStop(dailyPivot.java:229)
at com.dukascopy.api.impl.execution.v.call(Unknown Source)
at com.dukascopy.api.impl.connect.au.onStop(Unknown Source)
at com.dukascopy.api.impl.connect.JForexTaskManager$a.call(Unknown Source)
at com.dukascopy.api.impl.execution.k.call(Unknown Source)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
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(Thread.java:680)


So here is the code i use to draw the lines, which works fine:

private void drawPivots(Instrument curInstr, HashMap<String,Double> curPivs) throws JFException {
// Draw them if Plot is open
chart = context.getChart(curInstr);

if (chart!=null) {
Set<String> allKeys = curPivs.keySet();


// Now for each KEY in the set, draw an horizontal line
for (String thisKey : allKeys ) {
IHorizontalLineChartObject hLine = chart.getChartObjectFactory().createHorizontalLine();
hLine.setPrice(0, curPivs.get( thisKey ));
hLine.setText( thisKey );
hLine.setColor( colPiv );
hLine.setOpacity( 0.8f );
chart.addToMainChartUnlocked(hLine);
}

}
}


And this is the code which fails, the first chart lines get removed, then exception is thrown and it stops there.

private void cleanChart( Instrument curInstr ) throws JFException {
// Locate chart object
chart = context.getChart(curInstr);

if (chart!=null) chart.removeAll();
}


 
 Post subject: Re: AccessControlException when running strategy with multiple instruments. Post rating: 0   New post Posted: Wed 21 Mar, 2012, 08:20 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
This will get fixed with the next release. As a temporary workaround consider adding @RequiresFullAccess before the strategy class.


 
 Post subject: java.security.AccessControlException when adding an IChartObj Post rating: 0   New post Posted: Tue 27 Mar, 2012, 15:13 
User avatar

User rating: 3
Joined: Wed 18 May, 2011, 16:25
Posts: 331
Location: SwitzerlandSwitzerland
Dear Support,

I'm getting a security access control error when adding a rayline object to the chart using
chart.addToMainChart(rayLineObj);

Nevertheless, the object is painted on the chart.
What permissions are missing?

Best regards,
RR.

Quote:
13:56:33 at com.dukascopy.charts.d.b.addToMainChart(Unknown Source)
13:56:33 at com.dukascopy.charts.chartbuilder.r.addToMainChart(Unknown Source)
13:56:33 at com.dukascopy.charts.drawings.q.g(Unknown Source)
13:56:33 at com.dukascopy.charts.drawings.j.g(Unknown Source)
13:56:33 at com.dukascopy.charts.utils.a.execute(Unknown Source)
13:56:33 at com.dukascopy.charts.drawings.l.invoke(Unknown Source)
13:56:33 at com.dukascopy.charts.drawings.q.k(Unknown Source)
13:56:33 at com.dukascopy.charts.b.b.k(Unknown Source)
13:56:33 at com.dukascopy.dds2.greed.gui.component.chart.ab.k(Unknown Source)
13:56:33 at com.dukascopy.dds2.greed.gui.settings.b.c(Unknown Source)
13:56:33 at com.dukascopy.dds2.greed.gui.settings.e.e(Unknown Source)
13:56:33 at com.dukascopy.dds2.greed.gui.settings.e.O(Unknown Source)
13:56:33 at com.dukascopy.dds2.greed.gui.settings.e.Za(Unknown Source)
13:56:33 at com.dukascopy.dds2.greed.gui.settings.e.Zw(Unknown Source)
13:56:33 at java.util.prefs.Preferences.userRoot(Unknown Source)
13:56:33 at java.lang.SecurityManager.checkPermission(Unknown Source)
13:56:33 at java.security.AccessController.checkPermission(Unknown Source)
13:56:33 at java.security.AccessControlContext.checkPermission(Unknown Source)
13:56:33 java.security.AccessControlException: access denied (java.lang.RuntimePermission preferences)
13:56:33 Add ChartObject.GeneralError------


 
 Post subject: Re: JFOREX-3611 AccessControlException when removing chart objects. Post rating: 0   New post Posted: Wed 28 Mar, 2012, 12:53 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
RoadRunner wrote:
I'm getting a security access control error when adding a rayline object to the chart using
chart.addToMainChart(rayLineObj);
The similar issue with chart object removal has been fixed on the upcoming JForex-API 2.6.63. We can not replicate the issue with IChart.addToMainChart(). Could you please provide an example strategy which replicates the issue?


 
 Post subject: Re: JFOREX-3611 AccessControlException when removing chart objects. Post rating: 0   New post Posted: Thu 29 Mar, 2012, 13:51 
User avatar

User rating: 3
Joined: Wed 18 May, 2011, 16:25
Posts: 331
Location: SwitzerlandSwitzerland
Dear Support,

thank you for your reply.
I've tested the code with the new release 2.6.63 and didn't encounter the SecurityManager.checkPermission-issue anymore.

Kind regards,
RR.


 

Jump to:  

  © 1998-2025 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