Dukascopy
 
 
Wiki JStore Search Login

Attention! Read the forum rules carefully before posting a topic.

    Submit JForex API bug reports in this forum only.
    Submit Converter issues in Converter Issues.
    Off topics are strictly forbidden.

Any topics which do not satisfy these rules will be deleted.

AccessControlException and NoClassDefFoundError from JForexUtils.convertPipToCurrency
 Post subject: AccessControlException and NoClassDefFoundError from JForexUtils.convertPipToCurrency Post rating: 0   New post Posted: Fri 17 Oct, 2014, 14:25 

User rating: 0
Joined: Mon 09 Sep, 2013, 19:33
Posts: 2
On my remote strategy I frequently get an AccessControlException or NoClassDefFoundError exception.
The exception seems to be thrown by JForexUtils.convertPipToCurrency.
Any idea what is causing this?

Remote strategy log:
ERROR
10.10.2014 12:28:21   at com.dukascopy.api.impl.execution.ScienceThreadPoolExecutor$Worker.run(ScienceThreadPoolExecutor.java:926)
ERROR
10.10.2014 12:28:21   at java.util.concurrent.FutureTask.run(FutureTask.java:262)
ERROR
10.10.2014 12:28:21   at com.dukascopy.api.impl.execution.TaskOnBar.call(TaskOnBar.java:23)
ERROR
10.10.2014 12:28:21   at com.dukascopy.api.impl.execution.TaskOnBar.postData(TaskOnBar.java:85)
ERROR
10.10.2014 12:28:21   at jforex.strategy.fork.Fork.onBar(Fork.java:150)
ERROR
10.10.2014 12:28:21   at jforex.strategy.fork.Fork$CreateOrdersTask.call(Fork.java:353)
ERROR
10.10.2014 12:28:21   at jforex.strategy.common.OrderLib.submitOrder(OrderLib.java:33)
ERROR
10.10.2014 12:28:21   at com.dukascopy.dds2.greed.util.JForexUtils.convertPipToCurrency(JForexUtils.java:151)
ERROR
10.10.2014 12:28:21   at com.dukascopy.dds2.greed.util.JForexUtils.convertPipToCurrency(JForexUtils.java:182)
ERROR
10.10.2014 12:28:21   at com.dukascopy.dds2.greed.util.JForexUtils.convert(JForexUtils.java:124)
ERROR
10.10.2014 12:28:21   at com.dukascopy.dds2.greed.util.JForexUtils.getInterPrice(JForexUtils.java:230)
ERROR
10.10.2014 12:28:21   java.lang.NoClassDefFoundError: Could not initialize class org.apache.commons.lang3.StringUtils @ jforex.strategy.fork.Fork.onBar(Fork.java:150)
ERROR
10.10.2014 12:28:11   java.lang.NoClassDefFoundError: Could not initialize class org.apache.commons.lang3.StringUtils @ jforex.strategy.fork.Fork.onBar(Fork.java:150)
ERROR
10.10.2014 12:28:11   at java.lang.Thread.run(Thread.java:745)
ERROR
10.10.2014 12:28:11   at com.dukascopy.api.impl.execution.ScienceThreadPoolExecutor$Worker.runTask(ScienceThreadPoolExecutor.java:904)
ERROR
10.10.2014 12:28:11   at com.dukascopy.api.impl.execution.TaskOnBar.call(TaskOnBar.java:23)
ERROR
10.10.2014 12:28:11   at com.dukascopy.api.impl.execution.TaskOnBar.call(TaskOnBar.java:63)
ERROR
10.10.2014 12:28:11   at jforex.strategy.fork.Fork.onBar(Fork.java:150)
ERROR
10.10.2014 12:28:11   at jforex.strategy.fork.Fork$DummyTimer.nextTime(Fork.java:469)
ERROR
10.10.2014 12:28:11   at jforex.strategy.common.OrderLib.submitOrder(OrderLib.java:33)
ERROR
10.10.2014 12:28:11   at com.dukascopy.dds2.greed.util.JForexUtils.convertPipToCurrency(JForexUtils.java:151)
ERROR
10.10.2014 12:28:11   at com.dukascopy.dds2.greed.util.JForexUtils.convertPipToCurrency(JForexUtils.java:182)
ERROR
10.10.2014 12:28:11   at com.dukascopy.dds2.greed.util.JForexUtils.convert(JForexUtils.java:124)
ERROR
10.10.2014 12:28:11   at com.dukascopy.dds2.greed.util.JForexUtils.getInterPrice(JForexUtils.java:230)
ERROR
10.10.2014 12:28:11   java.lang.NoClassDefFoundError: Could not initialize class org.apache.commons.lang3.StringUtils @ jforex.strategy.fork.Fork.onBar(Fork.java:150)
INFO
10.10.2014 12:28:11   Event:Labour Force Survey time: 10/10/2014 12:28:09
ERROR
10.10.2014 12:28:00   java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "accessClassInPackage.sun.text") @ jforex.strategy.fork.Fork.onBar(Fork.java:150)
ERROR
10.10.2014 12:28:00   ... 17 more
ERROR
10.10.2014 12:28:00   at org.apache.commons.lang3.StringUtils.(StringUtils.java:737)
ERROR
10.10.2014 12:28:00   at com.dukascopy.dds2.greed.agent.compiler.JFXClassLoader.loadClass(JFXClassLoader.java:62)
ERROR
10.10.2014 12:28:00   at java.lang.ClassLoader.loadClass(ClassLoader.java:412)
ERROR
10.10.2014 12:28:00   at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:305)
ERROR
10.10.2014 12:28:00   at java.lang.SecurityManager.checkPermission(SecurityManager.java:549)
ERROR
10.10.2014 12:28:00   at java.security.AccessControlContext.checkPermission(AccessControlContext.java:372)
ERROR
10.10.2014 12:28:00   Caused by: java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "accessClassInPackage.sun.text")
ERROR
10.10.2014 12:28:00   at java.lang.Thread.run(Thread.java:745)
ERROR
10.10.2014 12:28:00   at com.dukascopy.api.impl.execution.ScienceThreadPoolExecutor$Worker.run(ScienceThreadPoolExecutor.java:926)
ERROR
10.10.2014 12:28:00   at java.util.concurrent.FutureTask.run(FutureTask.java:262)
ERROR
10.10.2014 12:28:00   at com.dukascopy.api.impl.execution.TaskOnBar.call(TaskOnBar.java:23)
ERROR
10.10.2014 12:28:00   at com.dukascopy.api.impl.execution.TaskOnBar.postData(TaskOnBar.java:85)
ERROR
10.10.2014 12:28:00   at jforex.strategy.fork.Fork.onBar(Fork.java:150)
ERROR
10.10.2014 12:28:00   at jforex.strategy.fork.Fork$CreateOrdersTask.call(Fork.java:353)
ERROR
10.10.2014 12:28:00   at jforex.strategy.common.OrderLib.calculateOrderAmount(OrderLib.java:24)
ERROR
10.10.2014 12:28:00   at com.dukascopy.dds2.greed.util.JForexUtils.convertPipToCurrency(JForexUtils.java:151)
ERROR
10.10.2014 12:28:00   at com.dukascopy.dds2.greed.util.JForexUtils.convertPipToCurrency(JForexUtils.java:182)
ERROR
10.10.2014 12:28:00   at com.dukascopy.dds2.greed.util.JForexUtils.convert(JForexUtils.java:124)
ERROR
10.10.2014 12:28:00   null: java.lang.ExceptionInInitializerError
ERROR
10.10.2014 12:28:00   java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "accessClassInPackage.sun.text") @ jforex.strategy.fork.Fork.onBar(Fork.java:150)


 
 Post subject: Re: AccessControlException and NoClassDefFoundError from JForexUtils.convertPipToCurrency Post rating: 0   New post Posted: Mon 20 Oct, 2014, 10:40 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Please provide the strategy that replicates the case.


 
 Post subject: Re: AccessControlException and NoClassDefFoundError from JForexUtils.convertPipToCurrency Post rating: 0   New post Posted: Sun 02 Nov, 2014, 23:39 

User rating: 0
Joined: Mon 09 Sep, 2013, 19:33
Posts: 2
The exception occurres randomly, so I cannot provide a strategy that replicates it.
Looking at the stack trace from the exception it seems to be thrown in convertPipToCurrency.
I use convertPipToCurrency to calculate the order amount before placing an order.
Sometimes calling it seems to generate the exception, but most of the time it works.

Here is the part of my code that calls convertPipToCurrency:
double tickValue = context.getUtils().convertPipToCurrency(instrument, account.getAccountCurrency());
double lots = (account.getEquity() * riskPercentage/100) / ((stoploss/instrument.getPipValue()) * tickValue * LOT_SIZE);


 
 Post subject: Re: AccessControlException and NoClassDefFoundError from JForexUtils.convertPipToCurrency Post rating: 0   New post Posted: Mon 03 Nov, 2014, 10:34 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
The issue has been registered. We will investigate it as soon as possible.


 

Jump to:  

cron
  © 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