RapidMiner

RapidMiner

Fail to run rapidminer in java runable jar

Contributor II

Fail to run rapidminer in java runable jar

Hi everyone, 

I use rapidminer as a library in my java project. Everything works fine if I run my project in Eclipse. But recently I export my project into a runable jar file and I am not able to run it.

 

I initialize the rapidminer in my main GUI: RM rm = new RM() where the constructor of RM is :

public RM(){
                RapidMiner.setExecutionMode(ExecutionMode.EMBEDDED_WITHOUT_UI);
		RapidMiner.init();
		
		try {
			ClassLoader classLoader = getClass().getClassLoader();
			
			mainProcess = new Process(classLoader.getResourceAsStream(".\\RMprocess\\association-rule.rmp"));

			inputOprt = mainProcess.getOperator("Read CSV");
			n2bOprt = mainProcess.getOperator("Nominal to Binominal");
			fpgOprt = mainProcess.getOperator("FP-Growth");
			asOprt = mainProcess.getOperator("Create Association Rules");
		} catch (IOException e1) {
			e1.printStackTrace();
		} catch (XMLException e1) {
			e1.printStackTrace();
		}
}

After the initialization, if I press any of the button in my GUI, I find the rm null.

	@Override
	public void actionPerformed(ActionEvent arg0) {
		
		Object component = arg0.getSource();
		
		if(component == button11){
			if(rm == null){
				System.out.println("rm null");
			}
			JFileChooser fileChooser = new JFileChooser();
			if(fileChooser.showOpenDialog(this) == JFileChooser.APPROVE_OPTION){
				file = fileChooser.getSelectedFile();
				text1.setText(file.getName());
			}		
		}
}

In this case, I receive "rm null" on the console.

I am urgent to fix this problem. 

Thanks.

1 REPLY

Re: Fail to run rapidminer in java runable jar

Hi,

 

I am late to reply, but just wondering if you were able to resolve this issue.

if not, do you see any exceptions been caught in your RM contructor