RapidMiner

[SOLVED]:RapidMiner Integration with Java

Contributor II keshr3106
Contributor II

[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,


   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();
       }
     }
   }



I run the above code. The code compiled but gave following error during its run:


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 <clinit>
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
SEVERE: Failed to register operator: RapidMiner Core : 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
SEVERE: Failed to register operator: RapidMiner Core : 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
SEVERE: Failed to register operator: RapidMiner Core : 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)


Can someone please help out with the code?

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.
11 REPLIES
RM Staff
RM Staff

Re: RapidMiner Integration with Java

Hi,

disable assertions, they are not being maintained and will cause useless errors.

Regards,
Marco
_________________________________________________________
Team Lead Software Engineering | RapidMiner GmbH
Contributor II keshr3106
Contributor II

Re: RapidMiner Integration with Java

Hello,

I disabled assertions and I still get some errors though it has reduced.


Mar 28, 2014 10:19:52 PM com.rapidminer.tools.ParameterService init
INFO: Reading configuration resource com/rapidminer/resources/rapidminerrc.
Mar 28, 2014 10:19:52 PM com.rapidminer.tools.I18N <clinit>
INFO: Set locale to en.
Mar 28, 2014 10:19:52 PM com.rapid_i.Launcher ensureRapidMinerHomeSet
INFO: Property rapidminer.home is not set. Guessing.
Mar 28, 2014 10:19:52 PM com.rapid_i.Launcher ensureRapidMinerHomeSet
INFO: Trying base directory of classes (build) 'null'...failed
Mar 28, 2014 10:19:52 PM 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 10:19:52 PM 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 10:19:52 PM 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 10:19:52 PM com.rapidminer.tools.plugin.Plugin registerPlugins
INFO: Register plugin: Text Processing
Mar 28, 2014 10:19:55 PM com.rapidminer.tools.expression.parser.ExpressionParserFactory <clinit>
INFO: Default version of expression parser registered successfully
Mar 28, 2014 10:19:56 PM com.rapidminer.parameter.ParameterTypePassword decryptPassword
WARNING: Password in XML file looks like unencrypted plain text.
Mar 28, 2014 10:19:57 PM com.rapidminer.tools.OperatorService init
INFO: Number of registered operator classes: 494; number of registered operator descriptions: 495; number of replacements: 432
Mar 28, 2014 10:19:58 PM com.rapidminer.tools.jdbc.JDBCProperties <init>
WARNING: Missing database driver class name for ODBC Bridge (e.g. Access)
Mar 28, 2014 10:19:58 PM com.rapidminer.tools.jdbc.JDBCProperties registerDrivers
INFO: JDBC driver ca.ingres.jdbc.IngresDriver not found. Probably the driver is not installed.
[Fatal Error] :1:1: Premature end of file.
Mar 28, 2014 10:19:58 PM com.rapidminer.tools.WrapperLoggingHandler log
INFO: No filename given for result file, using stdout for logging results!
Mar 28, 2014 10:19:58 PM com.rapidminer.Process run
INFO: Process C:\Users\Keshav\.RapidMiner5\repositories\Local Repository\linsvmtest.rmp starts
com.rapidminer.operator.UserError: Cannot resolve relative repository location 'lsvmword'. Process is not associated with a repository.
at com.rapidminer.Process.resolveRepositoryLocation(Process.java:1248)
at com.rapidminer.operator.Operator.getParameterAsRepositoryLocation(Operator.java:1456)
at com.rapidminer.operator.io.RepositorySource.getRepositoryEntry(RepositorySource.java:91)
at com.rapidminer.operator.io.RepositorySource.read(RepositorySource.java:105)
at com.rapidminer.operator.io.AbstractReader.doWork(AbstractReader.java:126)
at com.rapidminer.operator.Operator.execute(Operator.java:867)
at com.rapidminer.operator.execution.SimpleUnitExecutor.execute(SimpleUnitExecutor.java:51)
at com.rapidminer.operator.ExecutionUnit.execute(ExecutionUnit.java:711)
at com.rapidminer.operator.OperatorChain.doWork(OperatorChain.java:375)
at com.rapidminer.operator.Operator.execute(Operator.java:867)
at com.rapidminer.Process.run(Process.java:949)
at com.rapidminer.Process.run(Process.java:873)
at com.rapidminer.Process.run(Process.java:832)
at com.rapidminer.Process.run(Process.java:827)
at com.rapidminer.Process.run(Process.java:817)
at ReadRapidminerProcess.main(ReadRapidminerProcess.java:19)
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)
>


What changes must I make to the code? Where am I going wrong? Please help.

From,

Keshav
Contributor II keshr3106
Contributor II

Re: RapidMiner Integration with Java

Update:
After disabling assertions, I set right the rapidminer.home error by adding this line of code:

System.setProperty("rapidminer.home", "C:\\Program Files (x86)\\Rapid-I\\RapidMiner5");


Now, the following error alone exists:



Welcome to DrJava.  Working directory is C:\Users\Keshav\Documents
> run ReadRapidminerProcess
Mar 29, 2014 10:08:16 AM com.rapidminer.tools.ParameterService init
INFO: Reading configuration resource com/rapidminer/resources/rapidminerrc.
Mar 29, 2014 10:08:16 AM com.rapidminer.tools.I18N <clinit>
INFO: Set locale to en.
Mar 29, 2014 10:08:16 AM com.rapid_i.Launcher ensureRapidMinerHomeSet
INFO: rapidminer.home is 'C:\Program Files (x86)\Rapid-I\RapidMiner5'.
Mar 29, 2014 10:08:16 AM com.rapidminer.tools.plugin.Plugin registerPlugins
INFO: Register plugin: Text Processing
Mar 29, 2014 10:08:20 AM com.rapidminer.tools.expression.parser.ExpressionParserFactory <clinit>
INFO: Default version of expression parser registered successfully
Mar 29, 2014 10:08:21 AM com.rapidminer.parameter.ParameterTypePassword decryptPassword
WARNING: Password in XML file looks like unencrypted plain text.
Mar 29, 2014 10:08:23 AM com.rapidminer.tools.OperatorService init
INFO: Number of registered operator classes: 494; number of registered operator descriptions: 495; number of replacements: 432
Mar 29, 2014 10:08:24 AM com.rapidminer.tools.jdbc.JDBCProperties <init>
WARNING: Missing database driver class name for ODBC Bridge (e.g. Access)
Mar 29, 2014 10:08:24 AM com.rapidminer.tools.jdbc.JDBCProperties registerDrivers
INFO: JDBC driver ca.ingres.jdbc.IngresDriver not found. Probably the driver is not installed.
[Fatal Error] :1:1: Premature end of file.
Mar 29, 2014 10:08:24 AM com.rapidminer.tools.WrapperLoggingHandler log
INFO: No filename given for result file, using stdout for logging results!
Mar 29, 2014 10:08:24 AM com.rapidminer.Process run
INFO: Process C:\Users\Keshav\.RapidMiner5\repositories\Local Repository\linsvmtest.rmp starts
com.rapidminer.operator.UserError: Cannot resolve relative repository location 'lsvmword'. Process is not associated with a repository.
at com.rapidminer.Process.resolveRepositoryLocation(Process.java:1248)
at com.rapidminer.operator.Operator.getParameterAsRepositoryLocation(Operator.java:1456)
at com.rapidminer.operator.io.RepositorySource.getRepositoryEntry(RepositorySource.java:91)
at com.rapidminer.operator.io.RepositorySource.read(RepositorySource.java:105)
at com.rapidminer.operator.io.AbstractReader.doWork(AbstractReader.java:126)
at com.rapidminer.operator.Operator.execute(Operator.java:867)
at com.rapidminer.operator.execution.SimpleUnitExecutor.execute(SimpleUnitExecutor.java:51)
at com.rapidminer.operator.ExecutionUnit.execute(ExecutionUnit.java:711)
at com.rapidminer.operator.OperatorChain.doWork(OperatorChain.java:375)
at com.rapidminer.operator.Operator.execute(Operator.java:867)
at com.rapidminer.Process.run(Process.java:949)
at com.rapidminer.Process.run(Process.java:873)
at com.rapidminer.Process.run(Process.java:832)
at com.rapidminer.Process.run(Process.java:827)
at com.rapidminer.Process.run(Process.java:817)
at ReadRapidminerProcess.main(ReadRapidminerProcess.java:21)
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)


How to deal with this error?

Regards,

Keshav
Contributor II keshr3106
Contributor II

Re: RapidMiner Integration with Java

UPDATE:
Made some modifications to the code.

public class ReadRapidminerProcess {
     public static void main(String[] args) {
       try {
       
         RapidMiner.setExecutionMode(RapidMiner.ExecutionMode.COMMAND_LINE);
         System.setProperty("rapidminer.home", "C:\\Program Files (x86)\\Rapid-I\\RapidMiner5");
         RapidMiner.init();
         RepositoryLocation loc = new RepositoryLocation("//Local Repository/linsvmtest");
         IOObjectEntry entry = (IOObjectEntry) loc.locateEntry();
         Process process = new Process(new File("C:\\Users\\Keshav\\.RapidMiner5\\repositories\\Local Repository\\linsvmtest.rmp"));
         process.run();

       }
              catch (IOException e) {
       // TODO Auto-generated catch block
       e.printStackTrace();
   } catch (XMLException e) {
       // TODO Auto-generated catch block
       e.printStackTrace();
   } catch (OperatorException e) {
       // TODO Auto-generated catch block
       e.printStackTrace();
   }
   catch (RepositoryException e) {
       // TODO Auto-generated catch block
       e.printStackTrace();
   }
     }
   }


The previous 'Process is not associated with a repository.' error is set right but I get the following error:




Mar 30, 2014 3:04:04 AM com.rapidminer.tools.ParameterService init
INFO: Reading configuration resource com/rapidminer/resources/rapidminerrc.
Mar 30, 2014 3:04:04 AM com.rapidminer.tools.I18N <clinit>
INFO: Set locale to en.
Mar 30, 2014 3:04:04 AM com.rapid_i.Launcher ensureRapidMinerHomeSet
INFO: rapidminer.home is 'C:\Program Files (x86)\Rapid-I\RapidMiner5'.
Mar 30, 2014 3:04:04 AM com.rapidminer.tools.plugin.Plugin registerPlugins
INFO: Register plugin: Text Processing
Mar 30, 2014 3:04:07 AM com.rapidminer.tools.expression.parser.ExpressionParserFactory <clinit>
INFO: Default version of expression parser registered successfully
Mar 30, 2014 3:04:08 AM com.rapidminer.parameter.ParameterTypePassword decryptPassword
WARNING: Password in XML file looks like unencrypted plain text.
Mar 30, 2014 3:04:10 AM com.rapidminer.tools.OperatorService init
INFO: Number of registered operator classes: 494; number of registered operator descriptions: 495; number of replacements: 432
Mar 30, 2014 3:04:11 AM com.rapidminer.tools.jdbc.JDBCProperties <init>
WARNING: Missing database driver class name for ODBC Bridge (e.g. Access)
Mar 30, 2014 3:04:11 AM com.rapidminer.tools.jdbc.JDBCProperties registerDrivers
INFO: JDBC driver ca.ingres.jdbc.IngresDriver not found. Probably the driver is not installed.
[Fatal Error] :1:1: Premature end of file.
java.lang.ClassCastException: com.rapidminer.repository.local.SimpleProcessEntry cannot be cast to com.rapidminer.repository.IOObjectEntry
at ReadRapidminerProcess.main(ReadRapidminerProcess.java:28)
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)



XML Code:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<process version="5.3.013">
  <context>
    <input/>
    <output/>
    <macros/>
  </context>
  <operator activated="true" class="process" compatibility="5.3.013" expanded="true" name="Process">
    <process expanded="true">
      <operator activated="true" class="retrieve" compatibility="5.3.013" expanded="true" height="60" name="Retrieve" width="90" x="45" y="30">
        <parameter key="repository_entry" value="//Local Repository/lsvmword"/>
      </operator>
      <operator activated="true" class="retrieve" compatibility="5.3.013" expanded="true" height="60" name="Retrieve (2)" width="90" x="179" y="30">
        <parameter key="repository_entry" value="//Local Repository/lsvmmodel"/>
      </operator>
      <operator activated="true" class="text:process_document_from_file" compatibility="5.3.002" expanded="true" height="76" name="Process Documents from Files" width="90" x="45" y="120">
        <list key="text_directories">
          <parameter key="unlabelled1" value="C:\Users\Keshav\Documents\Academics\Project\train2\output1"/>
        </list>
        <parameter key="prune_method" value="percentual"/>
        <process expanded="true">
          <operator activated="true" class="text:tokenize" compatibility="5.3.002" expanded="true" height="60" name="Tokenize" width="90" x="45" y="30"/>
          <operator activated="true" class="text:filter_by_length" compatibility="5.3.002" expanded="true" height="60" name="Filter Tokens (by Length)" width="90" x="179" y="120"/>
          <operator activated="true" class="text:stem_porter" compatibility="5.3.002" expanded="true" height="60" name="Stem (Porter)" width="90" x="313" y="210"/>
          <operator activated="true" class="text:filter_stopwords_english" compatibility="5.3.002" expanded="true" height="60" name="Filter Stopwords (English)" width="90" x="447" y="300"/>
          <connect from_port="document" to_op="Tokenize" to_port="document"/>
          <connect from_op="Tokenize" from_port="document" to_op="Filter Tokens (by Length)" to_port="document"/>
          <connect from_op="Filter Tokens (by Length)" from_port="document" to_op="Stem (Porter)" to_port="document"/>
          <connect from_op="Stem (Porter)" from_port="document" to_op="Filter Stopwords (English)" to_port="document"/>
          <connect from_op="Filter Stopwords (English)" from_port="document" to_port="document 1"/>
          <portSpacing port="source_document" spacing="0"/>
          <portSpacing port="sink_document 1" spacing="0"/>
          <portSpacing port="sink_document 2" spacing="0"/>
        </process>
      </operator>
      <operator activated="true" class="apply_model" compatibility="5.3.013" expanded="true" height="76" name="Apply Model" width="90" x="179" y="120">
        <list key="application_parameters"/>
      </operator>
      <operator activated="true" class="select_attributes" compatibility="5.3.013" expanded="true" height="76" name="Select Attributes" width="90" x="313" y="75">
        <parameter key="attribute_filter_type" value="subset"/>
        <parameter key="attributes" value="label|metadata_file|"/>
      </operator>
      <operator activated="true" class="write_csv" compatibility="5.3.013" expanded="true" height="76" name="Write CSV" width="90" x="447" y="75">
        <parameter key="csv_file" value="C:\Users\Keshav\Documents\Academics\Project\train2\test1\svm\csv1.csv"/>
        <parameter key="column_separator" value=","/>
      </operator>
      <operator activated="true" class="retrieve" compatibility="5.3.013" expanded="true" height="60" name="Retrieve (3)" width="90" x="45" y="210">
        <parameter key="repository_entry" value="lsvmword"/>
      </operator>
      <operator activated="true" class="retrieve" compatibility="5.3.013" expanded="true" height="60" name="Retrieve (4)" width="90" x="179" y="210">
        <parameter key="repository_entry" value="lsvmmodel"/>
      </operator>
      <operator activated="true" class="text:process_document_from_file" compatibility="5.3.002" expanded="true" height="76" name="Process Documents from Files (2)" width="90" x="45" y="300">
        <list key="text_directories">
          <parameter key="unlabelled2" value="C:\Users\Keshav\Documents\Academics\Project\train2\output2"/>
        </list>
        <parameter key="prune_method" value="percentual"/>
        <process expanded="true">
          <operator activated="true" class="text:tokenize" compatibility="5.3.002" expanded="true" name="Tokenize (2)"/>
          <operator activated="true" class="text:filter_by_length" compatibility="5.3.002" expanded="true" name="Filter Tokens (2)"/>
          <operator activated="true" class="text:stem_porter" compatibility="5.3.002" expanded="true" name="Stem (2)"/>
          <operator activated="true" class="text:filter_stopwords_english" compatibility="5.3.002" expanded="true" name="Filter Stopwords (2)"/>
          <connect from_port="document" to_op="Tokenize (2)" to_port="document"/>
          <connect from_op="Tokenize (2)" from_port="document" to_op="Filter Tokens (2)" to_port="document"/>
          <connect from_op="Filter Tokens (2)" from_port="document" to_op="Stem (2)" to_port="document"/>
          <connect from_op="Stem (2)" from_port="document" to_op="Filter Stopwords (2)" to_port="document"/>
          <connect from_op="Filter Stopwords (2)" from_port="document" to_port="document 1"/>
          <portSpacing port="source_document" spacing="0"/>
          <portSpacing port="sink_document 1" spacing="0"/>
          <portSpacing port="sink_document 2" spacing="0"/>
        </process>
      </operator>
      <operator activated="true" class="apply_model" compatibility="5.3.013" expanded="true" height="76" name="Apply Model (2)" width="90" x="179" y="300">
        <list key="application_parameters"/>
      </operator>
      <operator activated="true" class="select_attributes" compatibility="5.3.013" expanded="true" height="76" name="Select Attributes (2)" width="90" x="313" y="255">
        <parameter key="attribute_filter_type" value="subset"/>
        <parameter key="attributes" value="label|metadata_file|"/>
      </operator>
      <operator activated="true" class="retrieve" compatibility="5.3.013" expanded="true" height="60" name="Retrieve (5)" width="90" x="45" y="390">
        <parameter key="repository_entry" value="lsvmword"/>
      </operator>
      <operator activated="true" class="retrieve" compatibility="5.3.013" expanded="true" height="60" name="Retrieve (6)" width="90" x="179" y="390">
        <parameter key="repository_entry" value="lsvmmodel"/>
      </operator>
      <operator activated="true" class="text:process_document_from_file" compatibility="5.3.002" expanded="true" height="76" name="Process Documents from Files (3)" width="90" x="45" y="480">
        <list key="text_directories">
          <parameter key="unlabelled3" value="C:\Users\Keshav\Documents\Academics\Project\train2\output3"/>
        </list>
        <parameter key="prune_method" value="percentual"/>
        <process expanded="true">
          <operator activated="true" class="text:tokenize" compatibility="5.3.002" expanded="true" name="Tokenize (3)"/>
          <operator activated="true" class="text:filter_by_length" compatibility="5.3.002" expanded="true" name="Filter Tokens (3)"/>
          <operator activated="true" class="text:stem_porter" compatibility="5.3.002" expanded="true" name="Stem (3)"/>
          <operator activated="true" class="text:filter_stopwords_english" compatibility="5.3.002" expanded="true" name="Filter Stopwords (3)"/>
          <connect from_port="document" to_op="Tokenize (3)" to_port="document"/>
          <connect from_op="Tokenize (3)" from_port="document" to_op="Filter Tokens (3)" to_port="document"/>
          <connect from_op="Filter Tokens (3)" from_port="document" to_op="Stem (3)" to_port="document"/>
          <connect from_op="Stem (3)" from_port="document" to_op="Filter Stopwords (3)" to_port="document"/>
          <connect from_op="Filter Stopwords (3)" from_port="document" to_port="document 1"/>
          <portSpacing port="source_document" spacing="0"/>
          <portSpacing port="sink_document 1" spacing="0"/>
          <portSpacing port="sink_document 2" spacing="0"/>
        </process>
      </operator>
      <operator activated="true" class="apply_model" compatibility="5.3.013" expanded="true" height="76" name="Apply Model (3)" width="90" x="179" y="480">
        <list key="application_parameters"/>
      </operator>
      <operator activated="true" class="select_attributes" compatibility="5.3.013" expanded="true" height="76" name="Select Attributes (3)" width="90" x="313" y="435">
        <parameter key="attribute_filter_type" value="subset"/>
        <parameter key="attributes" value="|label|metadata_file"/>
      </operator>
      <operator activated="true" class="write_csv" compatibility="5.3.013" expanded="true" height="76" name="Write CSV (2)" width="90" x="447" y="255">
        <parameter key="csv_file" value="C:\Users\Keshav\Documents\Academics\Project\train2\test1\svm\csv2.csv"/>
        <parameter key="column_separator" value=","/>
      </operator>
      <operator activated="true" class="write_csv" compatibility="5.3.013" expanded="true" height="76" name="Write CSV (3)" width="90" x="447" y="435">
        <parameter key="csv_file" value="C:\Users\Keshav\Documents\Academics\Project\train2\test1\svm\csv3.csv"/>
        <parameter key="column_separator" value=","/>
      </operator>
      <connect from_op="Retrieve" from_port="output" to_op="Process Documents from Files" to_port="word list"/>
      <connect from_op="Retrieve (2)" from_port="output" to_op="Apply Model" to_port="model"/>
      <connect from_op="Process Documents from Files" from_port="example set" to_op="Apply Model" to_port="unlabelled data"/>
      <connect from_op="Apply Model" from_port="labelled data" to_op="Select Attributes" to_port="example set input"/>
      <connect from_op="Select Attributes" from_port="example set output" to_op="Write CSV" to_port="input"/>
      <connect from_op="Write CSV" from_port="through" to_port="result 1"/>
      <connect from_op="Retrieve (3)" from_port="output" to_op="Process Documents from Files (2)" to_port="word list"/>
      <connect from_op="Retrieve (4)" from_port="output" to_op="Apply Model (2)" to_port="model"/>
      <connect from_op="Process Documents from Files (2)" from_port="example set" to_op="Apply Model (2)" to_port="unlabelled data"/>
      <connect from_op="Apply Model (2)" from_port="labelled data" to_op="Select Attributes (2)" to_port="example set input"/>
      <connect from_op="Select Attributes (2)" from_port="example set output" to_op="Write CSV (2)" to_port="input"/>
      <connect from_op="Retrieve (5)" from_port="output" to_op="Process Documents from Files (3)" to_port="word list"/>
      <connect from_op="Retrieve (6)" from_port="output" to_op="Apply Model (3)" to_port="model"/>
      <connect from_op="Process Documents from Files (3)" from_port="example set" to_op="Apply Model (3)" to_port="unlabelled data"/>
      <connect from_op="Apply Model (3)" from_port="labelled data" to_op="Select Attributes (3)" to_port="example set input"/>
      <connect from_op="Select Attributes (3)" from_port="example set output" to_op="Write CSV (3)" to_port="input"/>
      <connect from_op="Write CSV (2)" from_port="through" to_port="result 2"/>
      <connect from_op="Write CSV (3)" from_port="through" to_port="result 3"/>
      <portSpacing port="source_input 1" spacing="0"/>
      <portSpacing port="sink_result 1" spacing="0"/>
      <portSpacing port="sink_result 2" spacing="0"/>
      <portSpacing port="sink_result 3" spacing="0"/>
      <portSpacing port="sink_result 4" spacing="0"/>
    </process>
  </operator>
</process>


Any help on how to deal with this?

Regards,
Keshav
RM Staff
RM Staff

Re: RapidMiner Integration with Java

Hi,

you are doing the following:

IOObjectEntry entry = (IOObjectEntry) loc.locateEntry();

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
_________________________________________________________
Team Lead Software Engineering | RapidMiner GmbH
Contributor II keshr3106
Contributor II

Re: RapidMiner Integration with Java

Okay...can you please tell what change in the code should I make ?

from,
Keshav
RM Staff
RM Staff

Re: RapidMiner Integration with Java

Hi,

you can use the following snippet to load a process from a known repository and location:

Repository repo = RepositoryManager.getInstance(null).getRepository("Local Repository");
RepositoryProcessLocation processLocation = new RepositoryProcessLocation(new RepositoryLocation(repo.getLocation(), "nameOfMyProcess"));
Process process = processLocation.load(null);
process.run();


Note that you can load processes from other sources as well, e.g. a File or the XML string representation.

Regards,
Marco
_________________________________________________________
Team Lead Software Engineering | RapidMiner GmbH
Contributor II keshr3106
Contributor II

Re: RapidMiner Integration with Java

Hello,

I implemented the code as directed:


   
    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;
    import com.rapidminer.repository.RepositoryLocation;
    import com.rapidminer.repository.RepositoryException;
    import com.rapidminer.repository.IOObjectEntry;
    import com.rapidminer.repository.RepositoryManager;
    import com.rapidminer.RepositoryProcessLocation;
   
   
public class ReadRapidminerProcess {
      public static void main(String[] args) {
        try {
       
          RapidMiner.setExecutionMode(RapidMiner.ExecutionMode.COMMAND_LINE);
          System.setProperty("rapidminer.home", "C:\\Program Files (x86)\\Rapid-I\\RapidMiner5");
          RapidMiner.init();
          /*
          RepositoryLocation loc = new RepositoryLocation("//Local Repository/linsvmtest");
          IOObjectEntry entry = (IOObjectEntry) loc.locateEntry();
          Process process = new Process(new File("C:\\Users\\Goutham\\.RapidMiner5\\repositories\\Local Repository\\linsvmtest.rmp"));
          process.run();
          */
          Repository repo = RepositoryManager.getInstance(null).getRepository("Local Repository");
          RepositoryProcessLocation processLocation = new RepositoryProcessLocation(new RepositoryLocation(repo.getLocation(), "linsvmtest"));
          Process process = processLocation.load(null);
          process.run();

        }
              catch (IOException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    } catch (XMLException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    } catch (OperatorException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
    catch (RepositoryException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
      }
    }


However, I am not able to compile it.(drjava)

Compiler Output:

Error: cannot find symbol
  symbol:  class Repository
  location: class ReadRapidminerProcess


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
RM Staff
RM Staff

Re: RapidMiner Integration with Java

Hi,

Repository is an interface in the package com.rapidminer.repository in the main RapidMiner Studio project.

Regards,
Marco
_________________________________________________________
Team Lead Software Engineering | RapidMiner GmbH