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.

Strategy with jar - Remote-Run
 Post subject: Strategy with jar - Remote-Run Post rating: 0   New post Posted: Mon 01 Jul, 2013, 23:39 
User avatar

User rating: 1
Joined: Thu 15 Mar, 2012, 16:30
Posts: 20
Hello Support,
I created a JAR file containing my additional classes, and referenced it with @Library in the Strategy source.
This works fine on Local-Run, but on Remote-Run it crashes my Strategy as soon as I'm creating an Instance of a Class from my *.jar
(I reduced Functionality to 1 Class with 1 Method returning a String and tested it with an empty Strategy)

Why is it not possible to remotly run a Strategy that was created using a *.jar File?


 
 Post subject: Re: Strategy with jar - Remote-Run Post rating: 0   New post Posted: Sat 31 Aug, 2013, 17:50 
User avatar

User rating: 98
Joined: Mon 23 Jul, 2012, 02:02
Posts: 656
Location: United States, Durham, NC
Does this possibility exist now ?

I am confused, since elsewhere in this forum it is claimed that
the .jfx file, as compiled, contains all classes.

Specifically, in this post. But I am confused about that claim:
viewtopic.php?f=65&t=49446&p=72304&hilit=jfx+compiler#p72304

If this were true, then with either Local or Remote execution,
the external JAR would not be needed, as all statically compiled
classes would be in the .jfx file, for Remote execution.

However, Dynamically loaded resources or classes
would not work with this approach. Colo(u)r me confused........

I have an urgent need to provide a Remote JAR file, so is there
any solution or workaround for this on the Remote Servers ?

Even a "manual" method through consultation with [email protected]
would be fine for me in the interim, just to get things started for testing.
A single custom application support jar accessible to a Remote Strategy
would be enough for me to develop my Remote solutions.

Should I contact support to arrange for this, in the very short term, before
a comprehensive solution can be developed ?

HyperScalper


 
 Post subject: Re: Strategy with jar - Remote-Run Post rating: 0   New post Posted: Mon 02 Sep, 2013, 04:44 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
JFX contains all JAR files, provided in @Library path.

https://www.dukascopy.com/wiki/#Include_libraries


 
 Post subject: Remote Server execution does not require JAR files on server Post rating: 0   New post Posted: Mon 02 Sep, 2013, 15:39 
User avatar

User rating: 98
Joined: Mon 23 Jul, 2012, 02:02
Posts: 656
Location: United States, Durham, NC
What about the OP's observation of the failure on the Remote Server?
Is this just wrong, or what needs to be done for the Remote Execution to
be successful, despite the lack of the JAR file, since classes are built into
the JFX file ?

So, specifically, does this mean that a Remote Run can be done
without the need for the @Library designated supporting jars being present
on the server ? ...are ALL classes in @Library references at compilation
time placed in the resulting .jfx ?

IT WORKS
I have to conclude the OP's original observation is just incorrect...
I created a test strategy with a supporting jar referenced by @Library and
verified that for Local Run and for Remote Run, that my custom class file was
indeed loaded in both cases, WITHOUT the need for the JAR file being
present either locally or remotely at runtime; it's only needed at
compile time when the jfx is created.

So the JFX does appear to include at least referenced classes from
supporting jars, at compile time, so that the JAR is not needed at
run time. Not sure about classes or resources which are not
directly referenced by the compiler but will experiment further...

It is clear to me now how you handle the "bundling" of
class files into the JFX at compile time, so that we don't need JAR files
on the Remote Server. Brilliant work !

But, I doubt many realize this, so it would be helpful if some Wiki
entry could be made to really explain the jfx compilation and
subsequent execution environment, with emphasis on local
versus remote execution.

Thanks, and sorry if I am just slow to understand... :)
HyperScalper


 
 Post subject: Re: Strategy with jar - Remote-Run Post rating: 0   New post Posted: Mon 02 Sep, 2013, 16:27 
User avatar

User rating: 98
Joined: Mon 23 Jul, 2012, 02:02
Posts: 656
Location: United States, Durham, NC
I am new to Remote Server execution.

So, on the Remote Server, if we restrict ourselves to IContext.getFilesDir()
then we can also use file I/O on the Remote Server? I was also not aware
of that.

HyperScalper


 

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