Hi,
I'm trying to use RM process in Java Spring Web app but when I run application and call method for RM this error occur:
com/rapidminer/license/AlreadyRegisteredException
In java application this code working properly.
Please help me!
My setup: RM 7, Tomcat 8...
void RapidMinerProcessCaller() {
RapidMiner.setExecutionMode(ExecutionMode.COMMAND_LINE);
RapidMiner.init();
RepositoryLocation pLoc=null;
try {
pLoc = new RepositoryLocation("//Local Repository/processes/Stacking");
} catch (MalformedRepositoryLocationException e) {
e.printStackTrace();
}
ProcessEntry pEntry=null;
try {
pEntry = (ProcessEntry) pLoc.locateEntry();
} catch (RepositoryException e) {
e.printStackTrace();
}
String processXML=null;
try {
processXML = pEntry.retrieveXML();
} catch (RepositoryException e) {
e.printStackTrace();
}
Process myProcess=null;
try {
myProcess = new Process(processXML);
} catch (IOException e) {
e.printStackTrace();
} catch (XMLException e) {
e.printStackTrace();
}
IOContainer ioResult=null;
try {
ioResult = myProcess.run();
} catch (OperatorException e) {
e.printStackTrace();
}
ExampleSet resultSet =null;
if (ioResult.getElementAt(0) instanceof ExampleSet) {
try{
resultSet= (ExampleSet)ioResult.getElementAt(0);
}
catch (Exception e){
e.getMessage();
}
}
HashMap<String, String> results = new HashMap<String, String>();
for (Example example : resultSet) {
Iterator<Attribute> allAtts = example.getAttributes().allAttributes();
while(allAtts.hasNext()) {
Attribute a = allAtts.next();
if (a.isNumerical()) {
double value = example.getValue(a);
results.put(a.getName(), example.getValueAsString(a));
} else {
String value = example.getValueAsString(a);
results.put(a.getName(), example.getValueAsString(a));
}
}
}
Thanks in advance,
Adnan