RapidMiner.init() goes wrong

meliniakmeliniak Member Posts: 21 Contributor II
edited November 2018 in Help
Hi there,

I''m using the 5.0 version. The code isn't complex so far:
RapidMiner.init();
and the error is following:
Exception in thread "main" java.lang.AssertionError
        at com.rapidminer.operator.ports.impl.InputPortImpl.receiveMD(InputPortImpl.java:76)
        at com.rapidminer.operator.ports.metadata.SimplePrecondition.assumeSatisfied(SimplePrecondition.java:90)
        at com.rapidminer.operator.Operator.assumePreconditionsSatisfied(Operator.java:1855)
        at com.rapidminer.operator.OperatorChain.assumePreconditionsSatisfied(OperatorChain.java:495)
        at com.rapidminer.tools.OperatorService.registerOperator(OperatorService.java:414)
        at com.rapidminer.tools.OperatorService.parseOperators(OperatorService.java:283)
        at com.rapidminer.tools.OperatorService.parseOperators(OperatorService.java:279)
        at com.rapidminer.tools.OperatorService.parseOperators(OperatorService.java:279)
        at com.rapidminer.tools.OperatorService.parseOperators(OperatorService.java:279)
        at com.rapidminer.tools.OperatorService.parseOperators(OperatorService.java:255)
        at com.rapidminer.tools.OperatorService.registerOperators(OperatorService.java:229)
        at com.rapidminer.tools.OperatorService.registerOperators(OperatorService.java:203)
        at com.rapidminer.tools.OperatorService.init(OperatorService.java:149)
        at com.rapidminer.RapidMiner.init(RapidMiner.java:388)
        at pl.maliniak.poker.db.Test.main(Test.java:124)
Java Result: 1
As you probably have guessed I'm new to RM. All I want to do is to use a model built with GUI in my Java code. I guess I'm missing something basic. Any hints would be highly appreciable.
Tagged:

Answers

  • meliniakmeliniak Member Posts: 21 Contributor II
    Well, for anybody out there with the same problem, I turned off the assertions (no -enableassertions argument for the JVM) and it started to work.
  • AuspritAusprit Member Posts: 3 Contributor I
    Hello everyone,

    Sorry to get this post out of the closet, but I'm having the exact same problem.

    For now, the project only include rapidminer.jar and launcher.jar (I guess I'll add other ones if java complains) on the classpath.

    Here is the result (which is very similar to the one of the OP).

    2011-04-01 09:15:15 CONFIG: Locale not specified explicitly. Set default locale to US. (RapidMiner.init())
    2011-04-01 09:15:15 CONFIG: Initializing I18N (RapidMiner.splashMessage())
    2011-04-01 09:15:15 CONFIG: Ensuring RapidMiner Home is set (RapidMiner.splashMessage())
    2011-04-01 09:15:15 INFO: Property rapidminer.home is not set. Guessing. (Launcher.ensureRapidMinerHomeSet())
    2011-04-01 09:15:15 INFO: Trying parent directory of '/home/adam/NetBeansProjects/wii/ift603/trunk/lib/rapidminer.jar'...gotcha! (Launcher.ensureRapidMinerHomeSet())
    2011-04-01 09:15:15 INFO: Trying parent directory of '/home/adam/NetBeansProjects/wii/ift603/trunk/lib/launcher.jar'...gotcha! (Launcher.ensureRapidMinerHomeSet())
    2011-04-01 09:15:15 CONFIG: Reading Configuration Files (RapidMiner.splashMessage())
    2011-04-01 09:15:15 CONFIG: Reading configuration resource com/rapidminer/resources/rapidminerrc. (ParameterService.loadAllRCFiles())
    2011-04-01 09:15:15 CONFIG: Execution mode UNKNOWN does not permit file access. Ignoring all rcfiles. (ParameterService.loadAllRCFiles())
    2011-04-01 09:15:15 CONFIG: Registering Plugins (RapidMiner.splashMessage())
    2011-04-01 09:15:15 CONFIG: Read extension state. (ManagedExtension.readConfiguration())
    2011-04-01 09:15:15 CONFIG: Plugin directory /home/adam/NetBeansProjects/wii/ift603/trunk/lib/plugins does not exist. (Plugin.findAndRegisterPlugins())
    2011-04-01 09:15:15 CONFIG: Loading renderers from 'Weka'. (RendererService.init())
    2011-04-01 09:15:15 CONFIG: Reading parse rules from jar:file:/home/adam/.RapidMiner5/managed/rmx_weka-5.1.0.jar!/com/rapidminer/resources/parserulesWekaExtension.xml (XMLImporter.importParseRules())
    2011-04-01 09:15:16 CONFIG: Loading renderers from 'Reporting'. (RendererService.init())
    2011-04-01 09:15:16 CONFIG: Reading parse rules from jar:file:/home/adam/.RapidMiner5/managed/rmx_reporting-5.1.0.jar!/com/rapidminer/resources/parserulesReporting.xml (XMLImporter.importParseRules())
    2011-04-01 09:15:16 CONFIG: Initializing Operators (RapidMiner.splashMessage())
    2011-04-01 09:15:16 CONFIG: Loading operators from 'OperatorsCore.xml'. (OperatorService.registerOperators())
    2011-04-01 09:15:16 CONFIG: Loading operator documentation from jar:file:/home/adam/NetBeansProjects/wii/ift603/trunk/lib/rapidminer.jar!/com/rapidminer/resources/i18n/OperatorsCoreDocumentation.xml. (OperatorDocBundle$XMLControl.newBundle())
    2011-04-01 09:15:16 SEVERE: Failed to register operator: java.lang.AssertionError (OperatorService.parseOperators())
     java.lang.AssertionError
         com.rapidminer.operator.ports.impl.InputPortImpl.receiveMD(InputPortImpl.java:81)
         com.rapidminer.operator.ports.metadata.ExampleSetPrecondition.assumeSatisfied(ExampleSetPrecondition.java:86)
         com.rapidminer.operator.Operator.assumePreconditionsSatisfied(Operator.java:2002)
         com.rapidminer.operator.OperatorChain.assumePreconditionsSatisfied(OperatorChain.java:496)
         com.rapidminer.tools.OperatorService.registerOperator(OperatorService.java:431)
         com.rapidminer.tools.OperatorService.parseOperators(OperatorService.java:260)
         com.rapidminer.tools.OperatorService.parseOperators(OperatorService.java:256)
         com.rapidminer.tools.OperatorService.parseOperators(OperatorService.java:256)
         com.rapidminer.tools.OperatorService.parseOperators(OperatorService.java:232)
         com.rapidminer.tools.OperatorService.registerOperators(OperatorService.java:206)
         com.rapidminer.tools.OperatorService.registerOperators(OperatorService.java:180)
         com.rapidminer.tools.OperatorService.init(OperatorService.java:131)
         com.rapidminer.RapidMiner.init(RapidMiner.java:460)
         RandomForests.RandomForest.<init>(RandomForest.java:41)
         Test.TestAdam.mainAdam(TestAdam.java:42)
         ift603.Main.main(Main.java:31)
    If you have any idea of what causes this problem, I'd like to know since disabling assertion looks like too drastic of a change.

    Thanks,

    BTW, if you wonder about the project it's a student project using some data mining techniques in order to recognize gesture done with a wii remote : won't be doing any money out of it !

    EDIT : I tried rebuilding RapidMiner from souce : didn't change anything. But, for some reason, when I create a new project and call RapidMiner.init(), everything works fine. I don't see any difference between the two projects, both call RapidMiner.init() first thing in the main.
  • AuspritAusprit Member Posts: 3 Contributor I
    Well, to solve my problem I changed a bit the source code of InputPortImpl to declare metadata to an empty MetaData. It fixed the problem... well, this problem.

    Now further along the process I got another AssertionError :

    Apr 1, 2011 12:39:44 PM com.rapid_i.Launcher ensureRapidMinerHomeSet
    INFO: Property rapidminer.home is not set. Guessing.
    Apr 1, 2011 12:39:44 PM com.rapid_i.Launcher ensureRapidMinerHomeSet
    INFO: Trying parent directory of '/home/adam/NetBeansProjects/trunk/lib/rapidminer.jar'...gotcha!
    Apr 1, 2011 12:39:45 PM com.rapidminer.parameter.ParameterTypePassword decryptPassword
    WARNING: Password in XML file looks like unencrypted plain text.
    Exception in thread "main" java.lang.AssertionError
    at com.rapidminer.io.process.rules.ChangeParameterValueRule.<init>(ChangeParameterValueRule.java:47)
    at com.rapidminer.io.process.XMLImporter.constructRuleFromElement(XMLImporter.java:187)
    at com.rapidminer.io.process.XMLImporter.importParseRules(XMLImporter.java:164)
    at com.rapidminer.io.process.XMLImporter.init(XMLImporter.java:123)
    at com.rapidminer.RapidMiner.init(RapidMiner.java:471)
    at ift603.Main.main(Main.java:29)
    Still, a new project with only a call to RapidMiner.init() works wonderfully with the patched build I made, which is weird...

    Is it reasonable that so much assertions just mess everything up ? I mean, usually people get away with a simple RapidMiner.init()...
  • AuspritAusprit Member Posts: 3 Contributor I
    Ausprit wrote:

    Still, a new project with only a call to RapidMiner.init() works wonderfully with the patched build I made, which is weird...

    Is it reasonable that so much assertions just mess everything up ? I mean, usually people get away with a simple RapidMiner.init()...
    Alright, I found that the AssertionError weren't activated in the new project : this clarify part of my problem, I guess.

    Why is it that so many AssertionError are left unhandled in the source code ? Would it be worthwhile to signal them in the bug tracker ?
  • prayerslayerprayerslayer Member Posts: 3 Contributor I
    Well... I don't know if this is the solution, but I was stuck the whole day on the exact same problem. I set up a really small project to test it and it worked again after I removed several JVM flags (ea, Heap Space and the likes) from Eclipse.

    Edit: Okay, as someone already pointed out, everything is alright when assertions are disabled. That means no -ea JVM flag and if you happen to use Maven, check out the enableAssertions configuration in the Surefire plugin.

    http://maven.apache.org/plugins/maven-surefire-plugin/test-mojo.html#enableAssertions
  • NeilNeil Member Posts: 1 Contributor I
    Thanks @prayerslayer

    Your advice worked for me.  The following needs to be added to the maven's pom.xml:
    (I am running RM from IntelliJ as a maven project)

    <build>
       <plugins>
           <plugin>
               <groupId>org.apache.maven.plugins</groupId>
               <artifactId>maven-surefire-plugin</artifactId>
               <version>2.9</version>
               <configuration>
                   <enableAssertions>false</enableAssertions>
               </configuration>
           </plugin>
       </plugins>
    </build>
Sign In or Register to comment.