Skip to content

Using OpenML Java apiconnector in Matlab #1

Open

Description

@DraXus

I tried to use Java apiconnector in Matlab R2012a but got the following error:

Java exception occurred:
java.lang.NoSuchMethodError:
com.thoughtworks.xstream.io.xml.DomDriver.<init>(Ljava/lang/String;Lcom/thoughtworks/xstream/io/naming/NameCoder;)V
 at org.openml.apiconnector.xstream.XstreamXmlMapping.getInstance(XstreamXmlMapping.java:63)
 at org.openml.apiconnector.io.HttpConnector.doApiRequest(HttpConnector.java:30)
 at org.openml.apiconnector.io.ApiSessionHash.openmlAuthenticate(ApiSessionHash.java:162)
 at org.openml.apiconnector.io.ApiSessionHash.update(ApiSessionHash.java:84)
 at org.openml.apiconnector.io.ApiSessionHash.set(ApiSessionHash.java:71)
 at org.openml.apiconnector.io.OpenmlConnector.<init>(OpenmlConnector.java:89)

This problem occurs because an older version of xstream is loaded by Matlab in the static java class path and therefore it's not using the xstream library provided in the dynamic java class path. I've been googling and couldn't find any elegant solution. Apparently, the only workaround would be to replace the xstream.jar file in the "jarext" Matlab folder with the new version, but that could lead to internal Matlab problems.

So at the moment it's not possible to use the Java apiconnector in Matlab, but I would like to leave this comment here for future reference.

Activity

  1. joaquinvanschoren commented on Feb 19, 2015

    @joaquinvanschoren
    Contributor

    I remember we had a similar issue with RapidMiner. Jan, do you remember how
    you solved that?

    On Thu Feb 19 2015 at 11:31:14 AM Manuel Martín [email protected]
    wrote:

    I tried to use Java apiconnector in Matlab R2012a but got the following
    error:

    Java exception occurred:
    java.lang.NoSuchMethodError:
    com.thoughtworks.xstream.io.xml.DomDriver.(Ljava/lang/String;Lcom/thoughtworks/xstream/io/naming/NameCoder;)V
    at org.openml.apiconnector.xstream.XstreamXmlMapping.getInstance(XstreamXmlMapping.java:63)
    at org.openml.apiconnector.io.HttpConnector.doApiRequest(HttpConnector.java:30)
    at org.openml.apiconnector.io.ApiSessionHash.openmlAuthenticate(ApiSessionHash.java:162)
    at org.openml.apiconnector.io.ApiSessionHash.update(ApiSessionHash.java:84)
    at org.openml.apiconnector.io.ApiSessionHash.set(ApiSessionHash.java:71)
    at org.openml.apiconnector.io.OpenmlConnector.(OpenmlConnector.java:89)

    This problem occurs because an older version of xstream is loaded by
    Matlab in the static java class path and therefore it's not using the
    xstream library provided in the dynamic java class path. I've been googling
    and couldn't find any elegant solution. Apparently, the only workaround
    would be to replace the xstream.jar file in the "jarext" Matlab folder with
    the new version, but that could lead to internal Matlab problems.

    So at the moment it's not possible to use the Java apiconnector in Matlab,
    but I would like to leave this comment here for future reference.

    —
    Reply to this email directly or view it on GitHub
    #1.

  2. janvanrijn commented on Feb 19, 2015

    @janvanrijn
    Member

    I didn't solve that problem yet, as there was a second problem with
    RapidMiner as well.

    A solution would be to downgrade xstream version of the apiconnector,
    but that isn't straightforward as we rely heavily on one of the new
    features.

    2015-02-20 0:57 GMT+13:00 Joaquin Vanschoren [email protected]:

    I remember we had a similar issue with RapidMiner. Jan, do you remember how
    you solved that?

    On Thu Feb 19 2015 at 11:31:14 AM Manuel Martín [email protected]
    wrote:

    I tried to use Java apiconnector in Matlab R2012a but got the following
    error:

    Java exception occurred:
    java.lang.NoSuchMethodError:

    com.thoughtworks.xstream.io.xml.DomDriver.(Ljava/lang/String;Lcom/thoughtworks/xstream/io/naming/NameCoder;)V
    at
    org.openml.apiconnector.xstream.XstreamXmlMapping.getInstance(XstreamXmlMapping.java:63)
    at
    org.openml.apiconnector.io.HttpConnector.doApiRequest(HttpConnector.java:30)
    at
    org.openml.apiconnector.io.ApiSessionHash.openmlAuthenticate(ApiSessionHash.java:162)
    at
    org.openml.apiconnector.io.ApiSessionHash.update(ApiSessionHash.java:84)
    at org.openml.apiconnector.io.ApiSessionHash.set(ApiSessionHash.java:71)
    at
    org.openml.apiconnector.io.OpenmlConnector.(OpenmlConnector.java:89)

    This problem occurs because an older version of xstream is loaded by
    Matlab in the static java class path and therefore it's not using the
    xstream library provided in the dynamic java class path. I've been
    googling
    and couldn't find any elegant solution. Apparently, the only workaround
    would be to replace the xstream.jar file in the "jarext" Matlab folder
    with
    the new version, but that could lead to internal Matlab problems.

    So at the moment it's not possible to use the Java apiconnector in
    Matlab,
    but I would like to leave this comment here for future reference.

    —
    Reply to this email directly or view it on GitHub
    #1.

    —
    Reply to this email directly or view it on GitHub
    #1 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions