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.

subscribeToFeed AbstractMethodErrors
 Post subject: subscribeToFeed AbstractMethodErrors Post rating: 0   New post Posted: Tue 08 Jan, 2013, 18:28 
User avatar

User rating: 0
Joined: Thu 16 Jun, 2011, 21:37
Posts: 98
Location: SwitzerlandSwitzerland
Hello Support,

unfortunately I am getting an error pertaining to the custom feed subscription. The line where this happens is:
context.subscribeToFeed(rangeBarFeedDescriptor, strategyListener);

When I run this code in the JForex strategy manager I don't get this error, but only in my standalone IDE development; if I am not mistaken I believe that dukascopy uses a java compiler which comes bundled with JForex. This leads me to believe that this has to do with the standalone java compiler. The java I use is: jdk/jre7-openjdk 7.u9_2.3.3-1

I believe this is what is also causing the problem for my other bugs. In any case the error is as follows:

SEVERE: com.dukascopy.dds2.greed.agent.strategy.tester.TesterConfig.subscribeToFeed(Lcom/dukascopy/api/feed/IFeedDescriptor;Lcom/dukascopy/api/feed/IFeedListener;)V
java.lang.AbstractMethodError: com.dukascopy.dds2.greed.agent.strategy.tester.TesterConfig.subscribeToFeed(Lcom/dukascopy/api/feed/IFeedDescriptor;Lcom/dukascopy/api/feed/IFeedListener;)V
   at testjforex.testStrategy.TestStrategy.onStart(TestStrategy.java:56)
   at com.dukascopy.dds2.greed.agent.strategy.tester.StrategyRunner.run(StrategyRunner.java:428)
   at java.lang.Thread.run(Thread.java:722)


 
 Post subject: Re: subscribeToFeed AbstractMethodErrors Post rating: 0   New post Posted: Tue 08 Jan, 2013, 18:33 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Please provide an example program and an example strategy which replicate the issue.


 
 Post subject: Re: subscribeToFeed AbstractMethodErrors Post rating: 0   New post Posted: Tue 08 Jan, 2013, 20:33 
User avatar

User rating: 70
Joined: Sat 22 Sep, 2012, 17:43
Posts: 118
Location: Brazil, Fortaleza, Ceará
It's not easy to get that exception at runtime - conflicting JForex SDK versions being exposed?

If you use the same source files directory in your IDE and JForex strategy manager?
and/or if your strategy development consists of multiple classes where some are hardly updated after compilation
while others (like the class holding main trading logic) is updated frequently?

then this error could come about where some updated aspect is compiled against a different SDK version to
already compiled aspects compiled against a different SDK version.

Also compilation against one version of SDK of all files but launch/execution against another version e.g. compile in IDE (old SDK) but run in latest JForex instance.


 
 Post subject: Re: subscribeToFeed AbstractMethodErrors Post rating: 0   New post Posted: Thu 10 Jan, 2013, 21:49 
User avatar

User rating: 0
Joined: Thu 16 Jun, 2011, 21:37
Posts: 98
Location: SwitzerlandSwitzerland
CriticalSection wrote:
It's not easy to get that exception at runtime - conflicting JForex SDK versions being exposed?

If you use the same source files directory in your IDE and JForex strategy manager?
and/or if your strategy development consists of multiple classes where some are hardly updated after compilation
while others (like the class holding main trading logic) is updated frequently?

then this error could come about where some updated aspect is compiled against a different SDK version to
already compiled aspects compiled against a different SDK version.

Also compilation against one version of SDK of all files but launch/execution against another version e.g. compile in IDE (old SDK) but run in latest JForex instance.


Hi CriticalSection,

yes I use the same source files in both platforms. I compile my back end strategy logic within a jar library in my IDE (netbeans). This strategy logic is its own maven project, which has a dependency that is another maven project that strictly holds all the duka API jars. This duka API maven project is recompiled after a new version of the API is released and after I have changed the version numbers in the pom.xml. All projects that use it are then rebuilt to make sure that the newest API is used including the strategy manager project I have that is the headless manager of strategies for when I am testing from within the IDE.

Support: I will provide an example of this in the near future, thanks for your continued help.


 
 Post subject: Re: subscribeToFeed AbstractMethodErrors Post rating: 0   New post Posted: Fri 11 Jan, 2013, 21:31 
User avatar

User rating: 0
Joined: Thu 16 Jun, 2011, 21:37
Posts: 98
Location: SwitzerlandSwitzerland
Hi Support,

so I've come up with a simple strategy that reproduces the error:
import java.util.*;

import com.dukascopy.api.*;
import com.dukascopy.api.feed.IFeedDescriptor;
import com.dukascopy.api.feed.IFeedListener;
import com.dukascopy.api.feed.util.RangeBarFeedDescriptor;

public class TestStrategy2 implements IStrategy {
    private IEngine engine;
    private IConsole console;
    private IHistory history;
    private IContext context;
    private IIndicators indicators;
    private IUserInterface userInterface;
   
    @Override
    public void onStart(IContext context) throws JFException {
        this.engine = context.getEngine();
        this.console = context.getConsole();
        this.history = context.getHistory();
        this.context = context;
        this.indicators = context.getIndicators();
        this.userInterface = context.getUserInterface();
       
        IFeedListener strategyListener = new IFeedListener() {
           
            @Override
            public void onFeedData(IFeedDescriptor feedDescriptor, ITimedData feedData) {
                console.getOut().println("range bar completed: " + feedData + " of feed: " + feedDescriptor);
            }
           
        };
       
        IFeedDescriptor rangeBarFeedDescriptor = new RangeBarFeedDescriptor(Instrument.EURUSD, PriceRange.TWO_PIPS, OfferSide.ASK);
        context.subscribeToFeed(rangeBarFeedDescriptor, strategyListener);
       
    }

    public void onAccount(IAccount account) throws JFException {
    }

    public void onMessage(IMessage message) throws JFException {
    }

    public void onStop() throws JFException {
    }

    public void onTick(Instrument instrument, ITick tick) throws JFException {
    }
   
    public void onBar(Instrument instrument, Period period, IBar askBar, IBar bidBar) throws JFException {
    }
}


As described above, I have a JForexLibs Maven project which was cleaned and rebuilt before testing this strategy through my StrategyManager Maven project (which was also cleaned and rebuilt).

Please post what version of open jre/jdk you are using to try and replicate this bug and what version of netbeans is being used too. My assumption is that you are also testing on a linux based distro.

Many thanks,
mm


 
 Post subject: Re: subscribeToFeed AbstractMethodErrors Post rating: 0   New post Posted: Tue 15 Jan, 2013, 19:58 
User avatar

User rating: 0
Joined: Thu 16 Jun, 2011, 21:37
Posts: 98
Location: SwitzerlandSwitzerland
This error has been fixed and was appearing due to my mistake. Thanks again for the support and patience.


 

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