"[SOLVED]:RapidMiner Integration with Java"
Hello,
I need to run a RapidMiner process in Java. Like explained in this link :http://stackoverflow.com/questions/15834182/integration-of-rapidminer-in-java-application,
Regards,
Keshav
PS: The amount of errors displayed was very large - due to the space constraint of 20,000 characters,I pasted only a part of the error message.
I need to run a RapidMiner process in Java. Like explained in this link :http://stackoverflow.com/questions/15834182/integration-of-rapidminer-in-java-application,
I run the above code. The code compiled but gave following error during its run:
import com.rapidminer.Process;
import com.rapidminer.RapidMiner;
import com.rapidminer.operator.Operator;
import com.rapidminer.operator.OperatorException;
import com.rapidminer.operator.io.ExcelExampleSource;
import com.rapidminer.tools.XMLException;
import java.io.File;
import java.io.IOException;
import java.lang.Object;
public class ReadRapidminerProcess {
public static void main(String[] args) {
try {
RapidMiner.setExecutionMode(RapidMiner.ExecutionMode.COMMAND_LINE);
RapidMiner.init();
Process process = new Process(new File("C:\\Users\\Keshav\\.RapidMiner5\\repositories\\Local Repository\\lsvmtest.rmp"));
process.run();
} catch (IOException | XMLException | OperatorException ex) {
ex.printStackTrace();
}
}
}
Can someone please help out with the code?
Mar 28, 2014 3:05:23 AM com.rapidminer.tools.ParameterService init
INFO: Reading configuration resource com/rapidminer/resources/rapidminerrc.
Mar 28, 2014 3:05:23 AM com.rapidminer.tools.I18N
INFO: Set locale to en.
Mar 28, 2014 3:05:23 AM com.rapid_i.Launcher ensureRapidMinerHomeSet
INFO: Property rapidminer.home is not set. Guessing.
Mar 28, 2014 3:05:23 AM com.rapid_i.Launcher ensureRapidMinerHomeSet
INFO: Trying base directory of classes (build) 'null'...failed
Mar 28, 2014 3:05:23 AM com.rapid_i.deployment.update.client.ManagedExtension readConfiguration
WARNING: Failed to read global extension state: java.io.IOException: Property rapidminer.home is not set
java.io.IOException: Property rapidminer.home is not set
at com.rapidminer.tools.FileSystemService.getRapidMinerHome(FileSystemService.java:93)
at com.rapidminer.tools.FileSystemService.getLibraryFile(FileSystemService.java:99)
at com.rapidminer.tools.plugin.Plugin.getPluginLocation(Plugin.java:1113)
at com.rapid_i.deployment.update.client.ManagedExtension.getGlobalExtensionsDir(ManagedExtension.java:172)
at com.rapid_i.deployment.update.client.ManagedExtension.readConfiguration(ManagedExtension.java:257)
at com.rapid_i.deployment.update.client.ManagedExtension.init(ManagedExtension.java:349)
at com.rapidminer.tools.plugin.Plugin.initAll(Plugin.java:941)
at com.rapidminer.RapidMiner.init(RapidMiner.java:550)
at ReadRapidminerProcess.main(ReadRapidminerProcess.java:16)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at edu.rice.cs.drjava.model.compiler.JavacCompiler.runCommand(JavacCompiler.java:272)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at edu.rice.cs.dynamicjava.symbol.JavaClass$JavaMethod.evaluate(JavaClass.java:362)
at edu.rice.cs.dynamicjava.interpreter.ExpressionEvaluator.handleMethodCall(ExpressionEvaluator.java:92)
at edu.rice.cs.dynamicjava.interpreter.ExpressionEvaluator.visit(ExpressionEvaluator.java:84)
at koala.dynamicjava.tree.StaticMethodCall.acceptVisitor(StaticMethodCall.java:121)
at edu.rice.cs.dynamicjava.interpreter.ExpressionEvaluator.value(ExpressionEvaluator.java:38)
at edu.rice.cs.dynamicjava.interpreter.ExpressionEvaluator.value(ExpressionEvaluator.java:37)
at edu.rice.cs.dynamicjava.interpreter.StatementEvaluator.visit(StatementEvaluator.java:106)
at edu.rice.cs.dynamicjava.interpreter.StatementEvaluator.visit(StatementEvaluator.java:29)
at koala.dynamicjava.tree.ExpressionStatement.acceptVisitor(ExpressionStatement.java:101)
at edu.rice.cs.dynamicjava.interpreter.StatementEvaluator.evaluateSequence(StatementEvaluator.java:66)
at edu.rice.cs.dynamicjava.interpreter.Interpreter.evaluate(Interpreter.java:77)
at edu.rice.cs.dynamicjava.interpreter.Interpreter.interpret(Interpreter.java:47)
at edu.rice.cs.drjava.model.repl.newjvm.InterpreterJVM.interpret(InterpreterJVM.java:246)
at edu.rice.cs.drjava.model.repl.newjvm.InterpreterJVM.interpret(InterpreterJVM.java:220)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at sun.rmi.server.UnicastServerRef.dispatch(Unknown Source)
at sun.rmi.transport.Transport$1.run(Unknown Source)
at sun.rmi.transport.Transport$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Unknown Source)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown Source)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(Unknown Source)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Mar 28, 2014 3:05:23 AM com.rapidminer.tools.plugin.Plugin initAll
WARNING: None of the properties rapidminer.init.plugins and rapidminer.home is set. No globally installed plugins will be loaded.
Mar 28, 2014 3:05:23 AM com.rapid_i.deployment.update.client.ManagedExtension getManagedExtensionsDirectories
WARNING: None of the properties rapidminer.init.plugins and rapidminer.home is set. No globally installed extensions will be loaded.
Mar 28, 2014 3:05:23 AM com.rapid_i.deployment.update.client.ManagedExtension getManagedExtensionsDirectories
WARNING: None of the properties rapidminer.init.plugins and rapidminer.home is set. No globally installed extensions will be loaded.
Mar 28, 2014 3:05:23 AM com.rapidminer.tools.plugin.Plugin registerPlugins
INFO: Register plugin: Text Processing
Mar 28, 2014 3:05:23 AM com.rapidminer.tools.plugin.Plugin registerPlugins
INFO: Register plugin: Web Mining
Mar 28, 2014 3:05:25 AM com.rapidminer.tools.OperatorService parseOperators
严重:注册失败接线员:RapidMiner有限公司re : hierarchical_classification
java.lang.AssertionError
at com.rapidminer.operator.ports.impl.AbstractInputPort.receiveMD(AbstractInputPort.java:80)
at com.rapidminer.operator.ports.metadata.ExampleSetPrecondition.assumeSatisfied(ExampleSetPrecondition.java:86)
at com.rapidminer.operator.Operator.assumePreconditionsSatisfied(Operator.java:2130)
at com.rapidminer.operator.OperatorChain.assumePreconditionsSatisfied(OperatorChain.java:502)
at com.rapidminer.tools.OperatorService.registerOperator(OperatorService.java:520)
at com.rapidminer.tools.OperatorService.parseOperators(OperatorService.java:301)
at com.rapidminer.tools.OperatorService.parseOperators(OperatorService.java:293)
at com.rapidminer.tools.OperatorService.parseOperators(OperatorService.java:293)
at com.rapidminer.tools.OperatorService.parseOperators(OperatorService.java:269)
at com.rapidminer.tools.OperatorService.registerOperators(OperatorService.java:231)
at com.rapidminer.tools.OperatorService.registerOperators(OperatorService.java:204)
at com.rapidminer.tools.OperatorService.init(OperatorService.java:133)
at com.rapidminer.RapidMiner.init(RapidMiner.java:559)
at ReadRapidminerProcess.main(ReadRapidminerProcess.java:16)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at edu.rice.cs.drjava.model.compiler.JavacCompiler.runCommand(JavacCompiler.java:272)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at edu.rice.cs.dynamicjava.symbol.JavaClass$JavaMethod.evaluate(JavaClass.java:362)
at edu.rice.cs.dynamicjava.interpreter.ExpressionEvaluator.handleMethodCall(ExpressionEvaluator.java:92)
at edu.rice.cs.dynamicjava.interpreter.ExpressionEvaluator.visit(ExpressionEvaluator.java:84)
at koala.dynamicjava.tree.StaticMethodCall.acceptVisitor(StaticMethodCall.java:121)
at edu.rice.cs.dynamicjava.interpreter.ExpressionEvaluator.value(ExpressionEvaluator.java:38)
at edu.rice.cs.dynamicjava.interpreter.ExpressionEvaluator.value(ExpressionEvaluator.java:37)
at edu.rice.cs.dynamicjava.interpreter.StatementEvaluator.visit(StatementEvaluator.java:106)
at edu.rice.cs.dynamicjava.interpreter.StatementEvaluator.visit(StatementEvaluator.java:29)
at koala.dynamicjava.tree.ExpressionStatement.acceptVisitor(ExpressionStatement.java:101)
at edu.rice.cs.dynamicjava.interpreter.StatementEvaluator.evaluateSequence(StatementEvaluator.java:66)
at edu.rice.cs.dynamicjava.interpreter.Interpreter.evaluate(Interpreter.java:77)
at edu.rice.cs.dynamicjava.interpreter.Interpreter.interpret(Interpreter.java:47)
at edu.rice.cs.drjava.model.repl.newjvm.InterpreterJVM.interpret(InterpreterJVM.java:246)
at edu.rice.cs.drjava.model.repl.newjvm.InterpreterJVM.interpret(InterpreterJVM.java:220)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at sun.rmi.server.UnicastServerRef.dispatch(Unknown Source)
at sun.rmi.transport.Transport$1.run(Unknown Source)
at sun.rmi.transport.Transport$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Unknown Source)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown Source)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(Unknown Source)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Mar 28, 2014 3:05:25 AM com.rapidminer.tools.OperatorService parseOperators
严重:注册失败接线员:RapidMiner有限公司re : fixedsplitvalidation
java.lang.AssertionError
at com.rapidminer.operator.ports.impl.AbstractInputPort.receiveMD(AbstractInputPort.java:80)
at com.rapidminer.operator.ports.metadata.SimplePrecondition.assumeSatisfied(SimplePrecondition.java:90)
at com.rapidminer.operator.Operator.assumePreconditionsSatisfied(Operator.java:2130)
at com.rapidminer.operator.OperatorChain.assumePreconditionsSatisfied(OperatorChain.java:502)
at com.rapidminer.tools.OperatorService.registerOperator(OperatorService.java:520)
at com.rapidminer.tools.OperatorService.parseOperators(OperatorService.java:301)
at com.rapidminer.tools.OperatorService.parseOperators(OperatorService.java:293)
at com.rapidminer.tools.OperatorService.parseOperators(OperatorService.java:293)
at com.rapidminer.tools.OperatorService.parseOperators(OperatorService.java:293)
at com.rapidminer.tools.OperatorService.parseOperators(OperatorService.java:269)
at com.rapidminer.tools.OperatorService.registerOperators(OperatorService.java:231)
at com.rapidminer.tools.OperatorService.registerOperators(OperatorService.java:204)
at com.rapidminer.tools.OperatorService.init(OperatorService.java:133)
at com.rapidminer.RapidMiner.init(RapidMiner.java:559)
at ReadRapidminerProcess.main(ReadRapidminerProcess.java:16)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at edu.rice.cs.drjava.model.compiler.JavacCompiler.runCommand(JavacCompiler.java:272)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at edu.rice.cs.dynamicjava.symbol.JavaClass$JavaMethod.evaluate(JavaClass.java:362)
at edu.rice.cs.dynamicjava.interpreter.ExpressionEvaluator.handleMethodCall(ExpressionEvaluator.java:92)
at edu.rice.cs.dynamicjava.interpreter.ExpressionEvaluator.visit(ExpressionEvaluator.java:84)
at koala.dynamicjava.tree.StaticMethodCall.acceptVisitor(StaticMethodCall.java:121)
at edu.rice.cs.dynamicjava.interpreter.ExpressionEvaluator.value(ExpressionEvaluator.java:38)
at edu.rice.cs.dynamicjava.interpreter.ExpressionEvaluator.value(ExpressionEvaluator.java:37)
at edu.rice.cs.dynamicjava.interpreter.StatementEvaluator.visit(StatementEvaluator.java:106)
at edu.rice.cs.dynamicjava.interpreter.StatementEvaluator.visit(StatementEvaluator.java:29)
at koala.dynamicjava.tree.ExpressionStatement.acceptVisitor(ExpressionStatement.java:101)
at edu.rice.cs.dynamicjava.interpreter.StatementEvaluator.evaluateSequence(StatementEvaluator.java:66)
at edu.rice.cs.dynamicjava.interpreter.Interpreter.evaluate(Interpreter.java:77)
at edu.rice.cs.dynamicjava.interpreter.Interpreter.interpret(Interpreter.java:47)
at edu.rice.cs.drjava.model.repl.newjvm.InterpreterJVM.interpret(InterpreterJVM.java:246)
at edu.rice.cs.drjava.model.repl.newjvm.InterpreterJVM.interpret(InterpreterJVM.java:220)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at sun.rmi.server.UnicastServerRef.dispatch(Unknown Source)
at sun.rmi.transport.Transport$1.run(Unknown Source)
at sun.rmi.transport.Transport$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Unknown Source)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown Source)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(Unknown Source)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Mar 28, 2014 3:05:25 AM com.rapidminer.tools.OperatorService parseOperators
严重:注册失败接线员:RapidMiner有限公司re : conditionedfeaturegeneration
java.lang.AssertionError
at com.rapidminer.operator.ports.impl.AbstractInputPort.receiveMD(AbstractInputPort.java:80)
at com.rapidminer.operator.ports.metadata.SimplePrecondition.assumeSatisfied(SimplePrecondition.java:90)
at com.rapidminer.operator.Operator.assumePreconditionsSatisfied(Operator.java:2130)
at com.rapidminer.tools.OperatorService.registerOperator(OperatorService.java:520)
at com.rapidminer.tools.OperatorService.parseOperators(OperatorService.java:301)
at com.rapidminer.tools.OperatorService.parseOperators(OperatorService.java:293)
at com.rapidminer.tools.OperatorService.parseOperators(OperatorService.java:293)
at com.rapidminer.tools.OperatorService.parseOperators(OperatorService.java:293)
at com.rapidminer.tools.OperatorService.parseOperators(OperatorService.java:269)
at com.rapidminer.tools.OperatorService.registerOperators(OperatorService.java:231)
at com.rapidminer.tools.OperatorService.registerOperators(OperatorService.java:204)
at com.rapidminer.tools.OperatorService.init(OperatorService.java:133)
at com.rapidminer.RapidMiner.init(RapidMiner.java:559)
at ReadRapidminerProcess.main(ReadRapidminerProcess.java:16)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at edu.rice.cs.drjava.model.compiler.JavacCompiler.runCommand(JavacCompiler.java:272)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at edu.rice.cs.dynamicjava.symbol.JavaClass$JavaMethod.evaluate(JavaClass.java:362)
at edu.rice.cs.dynamicjava.interpreter.ExpressionEvaluator.handleMethodCall(ExpressionEvaluator.java:92)
at edu.rice.cs.dynamicjava.interpreter.ExpressionEvaluator.visit(ExpressionEvaluator.java:84)
at koala.dynamicjava.tree.StaticMethodCall.acceptVisitor(StaticMethodCall.java:121)
at edu.rice.cs.dynamicjava.interpreter.ExpressionEvaluator.value(ExpressionEvaluator.java:38)
at edu.rice.cs.dynamicjava.interpreter.ExpressionEvaluator.value(ExpressionEvaluator.java:37)
at edu.rice.cs.dynamicjava.interpreter.StatementEvaluator.visit(StatementEvaluator.java:106)
at edu.rice.cs.dynamicjava.interpreter.StatementEvaluator.visit(StatementEvaluator.java:29)
at koala.dynamicjava.tree.ExpressionStatement.acceptVisitor(ExpressionStatement.java:101)
at edu.rice.cs.dynamicjava.interpreter.StatementEvaluator.evaluateSequence(StatementEvaluator.java:66)
at edu.rice.cs.dynamicjava.interpreter.Interpreter.evaluate(Interpreter.java:77)
at edu.rice.cs.dynamicjava.interpreter.Interpreter.interpret(Interpreter.java:47)
at edu.rice.cs.drjava.model.repl.newjvm.InterpreterJVM.interpret(InterpreterJVM.java:246)
at edu.rice.cs.drjava.model.repl.newjvm.InterpreterJVM.interpret(InterpreterJVM.java:220)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at sun.rmi.server.UnicastServerRef.dispatch(Unknown Source)
at sun.rmi.transport.Transport$1.run(Unknown Source)
at sun.rmi.transport.Transport$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Unknown Source)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown Source)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(Unknown Source)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Regards,
Keshav
PS: The amount of errors displayed was very large - due to the space constraint of 20,000 characters,I pasted only a part of the error message.
0
Answers
disable assertions, they are not being maintained and will cause useless errors.
Regards,
Marco
I disabled assertions and I still get some errors though it has reduced. What changes must I make to the code? Where am I going wrong? Please help.
From,
Keshav
After disabling assertions, I set right the rapidminer.home error by adding this line of code: Now, the following error alone exists: How to deal with this error?
Regards,
Keshav
Made some modifications to the code. The previous 'Process is not associated with a repository.' error is set right but I get the following error: XML Code: Any help on how to deal with this?
Regards,
Keshav
you are doing the following: however when you call locateEntry() on a repository location where a process lies, you will recieve a SimpleProcessEntry instead. This is why you are getting the ClassCastException.
Regards,
Marco
from,
Keshav
you can use the following snippet to load a process from a known repository and location: Note that you can load processes from other sources as well, e.g. a File or the XML string representation.
Regards,
Marco
I implemented the code as directed: 然而,我无法编译它。(drjava)
Compiler Output: Can you please tell me what should I import to remove this error? Where is the class Repository found?
Thank you very much for your prompt replies!
Regards,
Keshav
Repository is an interface in the package com.rapidminer.repository in the main RapidMiner Studio project.
Regards,
Marco
It works properly now.I am now able to successfully integrate RapidMiner and Java!
Thank you very much for your help!
Regards,
Keshav
Is there any way to get the JAR? I am already scouring the net and could not obtain it.