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
API Support
Post subject: Re: WindowBuilder/SWT ClassNotFoundException error
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"