com.rapidminer.tools.XMLException: Cannot create operator

maxfax
maxfax New Altair Community Member
edited November 5 in Community Q&A
Hallo ich versuche mit Java einen Prozess auszuführen aber ich kriege immer unzählig viele Fehler obwohl ich es ziemlich genau so gemacht habe wie es in den Tutorials steht glaube ich . Ich weiß nicht was ich falsch mache :/  Der Prozess (xml) läuft auch in Rapidminer --> er öffnet ein datei liest sie macht allen möglichen kram (stemming etc ) und dann erstellt er eine neue Datei die nun gestemmt ist.

Was mache ich falsch ?

Ich nutze Windows 7 und Rapidminer
import java.io.File;
import java.io.IOException;

import com.rapidminer.Process;
import com.rapidminer.RapidMiner;
import com.rapidminer.RapidMiner.ExecutionMode;
import com.rapidminer.operator.OperatorException;
import com.rapidminer.repository.MalformedRepositoryLocationException;
import com.rapidminer.repository.ProcessEntry;
import com.rapidminer.repository.RepositoryException;
import com.rapidminer.repository.RepositoryLocation;
import com.rapidminer.tools.XMLException;

public class ProcessCreator {

public static void createProcess() {
// invoke init before using the OperatorService
RapidMiner.setExecutionMode(ExecutionMode.COMMAND_LINE);
RapidMiner.init();
System.out.println("FERTISCH");
RepositoryLocation pLoc;

try {

pLoc = new RepositoryLocation("//NewLocalRepository/Newlocal");
ProcessEntry pEntry = (ProcessEntry) pLoc.locateEntry();
String processXML = pEntry.retrieveXML();
Process rm5 = new Process(processXML);
System.out.println("Init Fertitsch");
// create process

//rm5 = new Process(new File("C:/Tokenizer.xml"));
rm5.run();
} catch (MalformedRepositoryLocationException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();


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

}

public static void main(String args[]) {
ProcessCreator.createProcess();
}
}

Der Fehler ist :



com.rapidminer.tools.XMLException: Cannot create operator: Operator cannot be constructed: 'read_document(com.rapidminer.operator.text.io.DocumentLoader)': com/rapidminer/operator/nio/file/FileInputPortHandler
at com.rapidminer.io.process.XMLImporter.parseOperator(XMLImporter.java:520)
at com.rapidminer.io.process.XMLImporter.parseProcess(XMLImporter.java:418)
at com.rapidminer.io.process.XMLImporter.parseOperator(XMLImporter.java:728)
at com.rapidminer.io.process.XMLImporter.parseOperator(XMLImporter.java:480)
at com.rapidminer.io.process.XMLImporter.parseRootOperator(XMLImporter.java:344)
at com.rapidminer.io.process.XMLImporter.parse(XMLImporter.java:309)
at com.rapidminer.io.process.XMLImporter.parse(XMLImporter.java:285)
at com.rapidminer.Process.readProcess(Process.java:1072)
at com.rapidminer.Process.readProcess(Process.java:1054)
at com.rapidminer.Process.<init>(Process.java:254)
at ProcessCreator.createProcess(ProcessCreator.java:29)
at ProcessCreator.main(ProcessCreator.java:57)
Caused by: com.rapidminer.operator.OperatorCreationException: Operator cannot be constructed: 'read_document(com.rapidminer.operator.text.io.DocumentLoader)': com/rapidminer/operator/nio/file/FileInputPortHandler
at com.rapidminer.operator.OperatorDescription.createOperatorInstance(OperatorDescription.java:347)
at com.rapidminer.io.process.XMLImporter.parseOperator(XMLImporter.java:510)
... 11 more
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at com.rapidminer.operator.OperatorDescription.createOperatorInstanceByDescription(OperatorDescription.java:360)
at com.rapidminer.operator.OperatorDescription.createOperatorInstance(OperatorDescription.java:339)
... 12 more
Caused by: java.lang.NoClassDefFoundError: com/rapidminer/operator/nio/file/FileInputPortHandler
at com.rapidminer.operator.text.io.DocumentLoader.getParameterTypes(DocumentLoader.java:109)
at com.rapidminer.operator.Operator.getParameters(Operator.java:1120)
at com.rapidminer.operator.io.AbstractReader.observeParameters(AbstractReader.java:102)
at com.rapidminer.operator.io.AbstractReader.<init>(AbstractReader.java:96)
at com.rapidminer.operator.text.io.DocumentLoader.<init>(DocumentLoader.java:62)
... 18 more


Bin für jede Hilfe dankbar !!

Answers

  • Marco_Boeck
    Marco_Boeck New Altair Community Member
    Hi,

    please post in english only so everyone can understand and benefit from problems and their respective solutions.
    As you can see here:

    Caused by: java.lang.NoClassDefFoundError
    your error is caused by a missing library, in your case the Text Extension.

    Regards,
    Marco