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.

Compling a strategy with updated jar files in ..\lib\ext dir
 Post subject: Compling a strategy with updated jar files in ..\lib\ext dir Post rating: 0   New post Posted: Mon 08 Sep, 2008, 08:41 
User avatar

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

I'm importing classes from a jar from the java lib\ext directory.
I can compile to an jfx and run the strategy. When I then update the jar file in the lib\ext dir and recompile the strategy on the JForex platform, it seems the new jar isn't taken. It still compiles the old jars, even when I relogon or restart JForex.

I guess the strategies and the referenced jars are uploaded to the DK server and compiled there?
What can be done so that the compiler would recognize the updated jars?

Thanks and have a great day!
R.


 
 Post subject: Re: compling strategy with updated jar files in ..\lib\ext d Post rating: 0   New post Posted: Mon 08 Sep, 2008, 09:59 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Please avoid to use ext/lib directory.
@Library annotation must be used instead to point to required jar.


 
 Post subject: Re: compling strategy with updated jar files in ..\lib\ext d Post rating: 0   New post Posted: Wed 10 Sep, 2008, 23:21 
User avatar

User rating: 3
Joined: Wed 18 May, 2011, 16:25
Posts: 331
Location: SwitzerlandSwitzerland
I finally soughted out what is causing the problem -
it's Vista's UAC!! :!:

When modifying or replacing a file somewhere below the "program files" directory without an installer, Vista makes a shadow copy of the file in the "virtualstore" and let applications that have used this file work with this "old" version. If you search your PC for files, windows search will not list files from within this virtual store.
That's why the strategy could still compile, even after I had removed ALL instances of the jar-file from the pc that I could find through file searches in explorer.

After I got a clue what was happening, I was able to find the shadow copy in the virtual store:
C:\Users\<username>\AppData\Local\VirtualStore\Program Files\Java\jre1.6.0_07\lib\ext\...jar
After deleting this file, the strategy compiled with the new version of the jar in the jre's original lib\ext dir.

Therefore as a general rule in Vista it is somewhat dangerous to manually replace or modify files below "program files" and should be avoided if possible!!
If there's no other way, the virtual store should always be checked for shadow copies to go sure the the applications are using the modified/new files.

After this experience, that took me quite a while to figure out what was going on, I strongly agree to use the @Library annotation to point to the jars instead of placing the files in the lib\ext dir.

Thanks again for your thoughts and help!


 
 Post subject: Re: Compling a strategy with updated jar files in ..\lib\ext dir Post rating: 0   New post Posted: Tue 03 Feb, 2009, 15:21 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
How to use the Library annotation: https://www.dukascopy.com/swiss/english/forex/jforex/forum/viewtopic.php?f=5&t=142


 

Jump to:  

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