• Post Reply Bookmark Topic Watch Topic
  • New Topic

Jave Error Interpretation  RSS feed

 
Bob Matthews
Ranch Hand
Posts: 136
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I understand that the following is rather difficult given that it involves Dukascopy JForex Platform API and Weka data mining API but I shall ask anyway
I have approached both Dukascopy and Weka support but am not making any progress so far

I currently have the following code for seven weka classifiers:-

(a) in the initial part of my java program



(b) in the weka subroutine



I am getting the following error (four times)

2016.05.02 07:06:34,Connected to database C:/Users/Stan/.netbeans-derby/us_copiosus_USDCAD_S
2016.05.02 07:06:36,Number of records in table USDCAD_S: 4100
2016.05.02 07:06:36,j value = : 0
2016.05.02 07:06:36,java.lang.ClassCastException: com.dukascopy.dds2.greed.agent.compiler.c cannot be cast to java.net.URLClassLoader
2016.05.02 07:06:36,j value = : 1
2016.05.02 07:06:36,j value = : 2
2016.05.02 07:06:36,java.lang.ClassCastException: com.dukascopy.dds2.greed.agent.compiler.c cannot be cast to java.net.URLClassLoader
2016.05.02 07:06:36,j value = : 3
2016.05.02 07:06:36,j value = : 4
2016.05.02 07:06:36,java.lang.ClassCastException: com.dukascopy.dds2.greed.agent.compiler.c cannot be cast to java.net.URLClassLoader
2016.05.02 07:06:36,j value = : 5
2016.05.02 07:06:36,j value = : 6
2016.05.02 07:06:36,java.lang.ClassCastException: com.dukascopy.dds2.greed.agent.compiler.c cannot be cast to java.net.URLClassLoader

pointing to problem classifiers 1, 3, 5 & 7 i.e. those with enclosed options

Any comments ?

Bob M
 
Bob Matthews
Ranch Hand
Posts: 136
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi again

The problem has been narrowed down somewhat........................

This is because Weka’s option handling mechanism uses weka.core.Utils.forName() to instantiate schemes from (potentially) partial scheme names by scanning the classpath entries for matches.

The class loader that is available to Weka appears to be a com.dukascopy.dds2.greed.agent.compiler.c, which is not a subclass of a Java URLClassloader.

The easiest thing to try first is to put a System.setProperty(“weka.test.maventest”, “true”) early on in the code of your program (before any Weka setOptions() methods are called).

setProperty is a static method in the System class (a core java.lang class).

And so I tried this suggestion:-

From the Dukascopy JForex platform I get the following error.............

Syntax error on token(s), misplaced construct(s)

And from within an IDE (Netbeans) I get the following error..............

'cannot find symbol - class setProperty'

The guy from weka finished up by saying

I’m at a loss. The following compiles from the command line with Oracle Java 1.8 on the mac:



Can anybody help me please

Bob M
 
Paul Clapham
Sheriff
Posts: 22844
43
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not sure I understand your problem -- are you saying you're unable to insert a call to the System.setProperty method and you get a variety of compiler errors?

If so then it would be more practical if you posted the code in question and described the errors you are getting in the context of that posted code.
 
Bob Matthews
Ranch Hand
Posts: 136
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes - correct!

I am trying to get a single line of code to compile

That line is

System.setProperty("weka.test.maventest", "true");

I have described the errors I get above
Two sets of errors depending on whether I am in Dukascopy's JForex platform API or I am in Netbeans 8.1

In both cases I am inserting this single line into a java forex Strategy

Bob M
 
Paul Clapham
Sheriff
Posts: 22844
43
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, in the absence of any visible code all I can do is to suggest you arrange things so that line of code is the first one executed.
 
Bob Matthews
Ranch Hand
Posts: 136
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Paul

I am probably not explaining myself very well.........................

I have various java programs which trade on the foreign exchange market through Dukascopy (Switerland)

Part of the program utilizes weka - a data mining program from NZ

Weka has classifiers and you can choose which ones you wish to employ

Many of them work well in my programs BUT some, like meta-classifiers need to identify a base classifier in their arguments

An example of this type of argument is as follows:-

-I, 6, -P, 0.72785, -S, 1, -W, weka.classifiers.rules.DecisionTable, --, -E, uac, -S, weka.attributeSelection.BestFit, -X, -1

and it is the two "weka....." parts which fall over




 
Bob Matthews
Ranch Hand
Posts: 136
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Paul

I put the line of code into the start subsection and it compiles !

Thank you

Bob M
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!