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.

WindowBuilder/SWT ClassNotFoundException error
 Post subject: WindowBuilder/SWT ClassNotFoundException error Post rating: 0   New post Posted: Mon 26 May, 2014, 11:36 

User rating: 2
Joined: Tue 25 Dec, 2012, 17:56
Posts: 15
I use JForex-SDK.2.30.0.1 - my strategy starts a number of concurrent Java tasks for calculations independent from JForex-SDK functions. The complete strategy with all external tasks works very well within JForex Client.

I'm trying to add a WinndowBuilder/SWT GUI for external tasks - this uses Referenced Library SWT-LIB - C:\eclipse\plugins\org.eclipse.swt.win32.win32.x86_64_3.100.1.v4236b.jar
All was tested outside of JForex Client and works OK.

When I try to run the strategy within JForex Client (Historical Tester), it generates the following ClassNotFoundException error:

26.05.2014 12:10:58.288 WARNING connect.cu ] White Label Image is not received
26.05.2014 12:10:58.787 SEVERE b.c ] Uncaught exception in [Thread-33] thread: org/eclipse/swt/widgets/Display
java.lang.NoClassDefFoundError: org/eclipse/swt/widgets/Display
at deep.DeepStatsLog.run(DeepStatsLog.java:23)
my comment -> line 23: display = Display.findDisplay(Thread.currentThread());
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: org.eclipse.swt.widgets.Display
at java.lang.ClassLoader.findClass(Unknown Source)
at com.dukascopy.dds2.greed.agent.a.c.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at com.dukascopy.dds2.greed.agent.a.c.loadClass(Unknown Source)
... 2 more

It appears to be a project configuration problem, e.g. Maven Dependencies may require including SWT dependency.
Could you provide me with some help. If needed, I'll send you a test project.

Best regards, leoterra


 
 Post subject: Re: WindowBuilder/SWT ClassNotFoundException error Post rating: 0   New post Posted: Mon 26 May, 2014, 13:19 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
leoterra wrote:
Caused by: java.lang.ClassNotFoundException: org.eclipse.swt.widgets.Display
Make sure that you have included in the @Library annotation all of the required jar files, not only the main one.


 
 Post subject: Re: WindowBuilder/SWT ClassNotFoundException error - beware of blank spaces!!! Post rating: 0   New post Posted: Mon 26 May, 2014, 16:27 

User rating: 2
Joined: Tue 25 Dec, 2012, 17:56
Posts: 15
Thanks. I did and it helped but only after one hour wrestling. It turned out that @Library hates spaces, so if one writes nicely: @Library("WBtestLibrary.jar; swt.jar"), it will not find swt.jar (because it looks for " swt.jar"). You must write exactly: @Library("WBtestLibrary.jar;swt.jar").

WBtestLibraryswt.jar above is my test library, of course, and swt.jar is a renamed "...\eclipse\plugins\org.eclipse.swt.win32.win32.x86_64_3.100.1.v4236b.jar"

Happy programming,
leoterra


 

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