Hitachi Vantara Pentaho Community Forums
Results 1 to 5 of 5

Thread: Help needed to use weka.dll(converted using IKVM) to deserialize an ANN model

  1. #1

    Exclamation Help needed to use weka.dll(converted using IKVM) to deserialize an ANN model

    Hello All,

    I am posting on Pentaho forum for very first time. Any help would be much appreciated.

    I am running into following issue while trying to use weka.dll (.net version of weka.jar converted using IKVM) in my .net 4.0 project. I have followed steps mentioned in - . The exact steps worked for me and I was able to create a weka.dll file.

    Useful Information -
    1. I am running Weka(3.6.7) for Windows x64 in a 64 bit Intel® Core i7 3.40GHZ desktop machine and Windows 7
    2. I am running Java™ version
    3. I downloaded IKVM 7.0.4335.0 into my Program Files folder

    When I try to serialize my ANN model (generated using WEKA console) in my C# code (like below) using “weka.dll” I get “InvalidClassException” error

    Code – “weka.classifiers.Classifier cl = (weka.classifiers.Classifier) + @"\test.model");”

    Error thrown - “ javax.swing.JComponent; local class incompatible: stream classdesc serialVersionUID = -1030230214076481435, local class serialVersionUID = 5670834184508236790}” – I have included the stack trace at the bottom of this message

    I have tested running the model through a JAVA interface using weka.jar, and it has worked absolutely fine.

    While running IKVM to convert weka.jar file into weka.dll file it gave me following warning which I ignored – unable to compile class “weka.gui.MacArffOpenFilesHandler” <missing class “”>


    Just in case, I have included steps that I have used to convert weka.jar file into weka.dll

    IKVM Setup -
    1. Download IKVM package from and put the folder extracted under C:\Program Files
    2. In command line prompt browse to C:\Program Files\IKVM and type IKVM and hit enter to test it
    3. Setup the environment for using IKVM tools
      1. Add "C:\Program Files\ikvm-7.0.4335.0\bin" to Path variable in system environment
      2. Add "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322" to Path variable in system environment

    4. Use IKVMC to convert the WEKA jar files to .net dll ( )

    Creating Weka dll
    1. Change directory to location, where weka.jar file is located, in command prompt
    2. Run following command ikvmc -target:library weka.jar
    3. This will create weka.dll file

    Referencing weka in .net project -
    1. Add reference to generated weka.dll
    2. Add reference to IKVM.Runtime from C:\Program Files\ikvm-7.0.4335.0\bin
    3. Add reference to IKVM.OpenJDK.Core from C:\Program Files\ikvm-7.0.4335.0\bin

    Stack trace of the error –
    at , ObjectInputStream )
    at , ObjectStreamClass )
    at )
    at )
    at , ObjectStreamClass )
    at , ObjectStreamClass )
    at )
    at )
    at stream)
    at filename)
    at WEKAInitializer.UnitTest1.LoadANNModel() in C:\Users\saurabh\Documents\Visual Studio 2010\Projects\WEKAInitializer\WEKAInitializer\UnitTest1.cs:line 71

  2. #2
    Join Date
    Aug 2006


    This has been answered over on the Weka mailing list:

  3. #3
    Join Date
    Jul 2014


    Dear Community,

    i am so sorry that i open the old thread. But I have excact the same Problem and the link to the mailing list doesn't work. Can somebody give me
    a solution to that problem?

    thank you very much.

  4. #4
    Join Date
    Aug 2006


    I've never used IKVM I'm afraid. I'd suggest that you use the latest version of Weka 3.6 and see if the serialisation error is specific to just the MultilayerPerceptron classifier.


  5. #5
    Join Date
    Jul 2014


    Hello Mark,

    I think I get the Error everytime when i serialize something on WEKA and load it from IKVM over the weka.dll. I found out that I get the error when do this with the KnowledgeFlow.

    I could save all things with XML, I bet then I wouldn't get the errors. The problem is that I can't save the trained model then.

    When you have any idea, tell me...

    Thank you very much.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2017 Pentaho Corporation. All Rights Reserved.