Dukascopy
 
 
Wiki JStore Search Login

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

    Try to find an answer in Wiki before asking a question.
    Submit programming questions in this forum only.
    Off topics are strictly forbidden.

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

Security problem, does not match trust level?
 Post subject: Security problem, does not match trust level? Post rating: 0   New post Posted: Sat 14 Jan, 2012, 00:56 

User rating: 0
Joined: Sat 19 Nov, 2011, 01:24
Posts: 23
Location: United Kingdom,
When trying to submit and order using this code
engine.submitOrder("jh", selectedInstrument, IEngine.OrderCommand.BUY, 0.1, 0, 0, askPrice-SL*instrument.getPipValue(), askPrice+TP*instrument.getPipValue());

I get this error message

23:51:21 Strategy tester: java.lang.SecurityException: class "com.dukascopy.api.IOrder$State" does not match trust level of other classes in the same package @ jforex.FileRead.onTick(FileRead.java:208)


 
 Post subject: Re: Security problem, does not match trust level? Post rating: 0   New post Posted: Sun 15 Jan, 2012, 12:12 

User rating: 0
Joined: Sat 19 Nov, 2011, 01:24
Posts: 23
Location: United Kingdom,
Sorted it out, in case any one is wondering it had to do with the java security level settings on the computer, after changing them I had to restart which I wasn't doing.


 
 Post subject: Re: Security problem, does not match trust level? Post rating: 0   New post Posted: Tue 27 Mar, 2012, 17:52 
User avatar

User rating: 11
Joined: Tue 27 Mar, 2012, 17:47
Posts: 111
Location: GermanyGermany
I have the same problem but I could not figure out where to change those security settings.
I have the following:
public void onBar(Instrument instrument, Period period, IBar askBar, IBar bidBar) throws JFException {
        // Check instrument
        if(instrument != Instrument.EURUSD)
            return;
        // Check if previous close is higher or not
        IBar prevBar = history.getBar(Instrument.EURUSD, Period.ONE_MIN, OfferSide.BID, 1);
        if(bidBar.getClose()<prevBar.getClose()){
            console.getOut().println("Bear");
        }
        else{
            console.getOut().println("Bull");
        }
    }

When this method gets called, the following error is printed in the Messages tab:
16:43:40 java.lang.SecurityException: class "com.dukascopy.api.impl.j" does not match trust level of other classes in the same package @ MyInitialStrategy.onBar(MyInitialStrategy.java:45)

Line 45 is mapped here to Line 6:
IBar prevBar = history.getBar(Instrument.EURUSD, Period.ONE_MIN, OfferSide.BID, 1);

Why is this message raised and what can I do about it?
Please help.

Regards,
Juergen


 
 Post subject: Re: Security problem, does not match trust level? Post rating: 0   New post Posted: Wed 28 Mar, 2012, 11:39 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
FXjuxe wrote:
I have the same problem but I could not figure out where to change those security settings.
We could not replicate the issue.
pag24 wrote:
Sorted it out, in case any one is wondering it had to do with the java security level settings on the computer, after changing them I had to restart which I wasn't doing.
Could you please provide the Java security settings that fixed the problem?


 
 Post subject: Re: Security problem, does not match trust level? Post rating: 0   New post Posted: Thu 29 Mar, 2012, 15:32 
User avatar

User rating: 11
Joined: Tue 27 Mar, 2012, 17:47
Posts: 111
Location: GermanyGermany
Ok, for now I have found that it is no good idea to have the strategy file saved in the eclipse workspace.
If you copy it to another empty location where it does not interfere with other project files, then the problem may disappear.
At least this solved my problem for now.
I think it has something to do with mixed mode security issues, see here.

Regards,
Juergen


 

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