Options

Problem distributing a NetBeans application that integrates with RapidMiner

stelmanstelman Member Posts: 3 Contributor I
edited November 2018 in Help
Hi everyone!

I am trying to integrate rapidminer with java. I use NetBeans.

I load the rapidminer.jar and I can initialize RapidMiner properly by using Rapidminer.init(). Then, I successfuly load and run a process and get the results back.

However, this only runs successfuly in NetBeans. When I do a cleanbuild of the app, the end result is a single .jar for my application, along with a lib folder that contains the rapidminer.jar. When I open the application's jar RapidMiner won't initialize. Therefore, I can run my program only through NetBeans and I can't distribute it.

Any ideas why this might be? I tried setting the home directory and the rc file with the following code (because the wiki recommended something like that), because I thought that maybe the rapidminer.jar tries to look for some folders and libraries relative to the .jar's path. However, this didn't fix the problem. RapidMiner will still not initialize.

<code>
ParameterService.init();
       System.setProperty("rapidminer.home", "C:\\Program Files\\Rapid-I\\RapidMiner5");
       
       System.setProperty(RapidMiner.PROPERTY_RAPIDMINER_RC_FILE,
               "C:\\Program Files\\Rapid-I\\RapidMiner5\\resources\\com\\rapidminer\\resources\\rapidminerrc");
</code>

Thank you in advance for any help/assistance. I tried going through the forum and I also looked at the rapidminer wiki, but I couldn't solve this problem 2 days now. I wonder whether it has something to do with NetBeans and not RapidMiner.

Ideally, I'd like to be able to distribute my app without having to install RapidMiner on a new computer.  I thought that I could simply include the .jar and set the home and the rc file.
Tagged:

Answers

  • Options
    Marco_BoeckMarco_Boeck Administrator, Moderator, Employee, Member, University Professor Posts: 1,993 RM Engineering
    Hi,

    the description "RapidMiner does not initialize" is not very descriptive ;)
    What is the error you are getting?
    Also please note that when integrating RapidMiner, your application has to be licensed under the AGPL (or you need to buy an OEM license if you do not want your sourcecode to be open source).

    Regards,
    Marco
  • Options
    stelmanstelman Member Posts: 3 Contributor I
    Hi Marco,

    Thanks for the reply.

    The problem occurs only when I try to start the .jar externally (not through NetBeans). How can I recover the error log in this case?

    Thank you in advance
  • Options
    Marco_BoeckMarco_Boeck Administrator, Moderator, Employee, Member, University Professor Posts: 1,993 RM Engineering
    Hi,

    with the latest development version there is a rm.log file in the .RapidMiner5 folder, however as we are currently migrating to Git I don't think the latest development version is available for everyone right now. So you will have to resort to starting the .jar via commandline and see what errors you get there.

    Regards,
    Marco
  • Options
    stelmanstelman Member Posts: 3 Contributor I
    Marco, thank you for the advice. Here is the output. It seems the main error is "Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: com/rapid_i/Launcher"

    ***********************************8

    Microsoft Windows [Version 6.1.7601]
    Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

    c:\dist>java -jar LostDaysPrediction.jar
    ╔ΎΫΊ 03, 2013 1:02:31 ╠╠ com.rapidminer.tools.ParameterService init
    INFO: Reading configuration resource com/rapidminer/resources/rapidminerrc.
    Jun 03, 2013 1:02:38 PM com.rapidminer.tools.I18N <clinit>
    INFO: Set locale to en.
    Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: com/rapid
    _i/Launcher
            at com.rapidminer.tools.ParameterService.ensureRapidMinerHomeSet(Paramet
    erService.java:505)
            at com.rapidminer.RapidMiner.init(RapidMiner.java:532)
            at lostdaysprediction.MainForm.jButton2ActionPerformed(MainForm.java:394
    )
            at lostdaysprediction.MainForm.access$100(MainForm.java:35)
            at lostdaysprediction.MainForm$10.actionPerformed(MainForm.java:205)
            at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
            at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
            at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
            at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
            at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Sour
    ce)
            at java.awt.Component.processMouseEvent(Unknown Source)
            at javax.swing.JComponent.processMouseEvent(Unknown Source)
            at java.awt.Component.processEvent(Unknown Source)
            at java.awt.Container.processEvent(Unknown Source)
            at java.awt.Component.dispatchEventImpl(Unknown Source)
            at java.awt.Container.dispatchEventImpl(Unknown Source)
            at java.awt.Component.dispatchEvent(Unknown Source)
            at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
            at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
            at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
            at java.awt.Container.dispatchEventImpl(Unknown Source)
            at java.awt.Window.dispatchEventImpl(Unknown Source)
            at java.awt.Component.dispatchEvent(Unknown Source)
            at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
            at java.awt.EventQueue.access$200(Unknown Source)
            at java.awt.EventQueue$3.run(Unknown Source)
            at java.awt.EventQueue$3.run(Unknown Source)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Sour
    ce)
            at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Sour
    ce)
            at java.awt.EventQueue$4.run(Unknown Source)
            at java.awt.EventQueue$4.run(Unknown Source)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Sour
    ce)
            at java.awt.EventQueue.dispatchEvent(Unknown Source)
            at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
            at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
            at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
            at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
            at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
            at java.awt.EventDispatchThread.run(Unknown Source)
    Caused by: java.lang.ClassNotFoundException: com.rapid_i.Launcher
            at java.net.URLClassLoader$1.run(Unknown Source)
            at java.net.URLClassLoader$1.run(Unknown Source)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.net.URLClassLoader.findClass(Unknown Source)
            at java.lang.ClassLoader.loadClass(Unknown Source)
            at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
            at java.lang.ClassLoader.loadClass(Unknown Source)
            ... 41 more
  • Options
    Marco_BoeckMarco_Boeck Administrator, Moderator, Employee, Member, University Professor Posts: 1,993 RM Engineering
    Hi,

    seems you are not having all the .jar files RapidMiner needs in your own .jar, in this particular case the launcher.jar is missing. You will notice when looking at a RapidMiner installation that the lib folder of it contains quite a few .jar files, depending on what you do with RapidMiner they are all needed for RM to function correctly.

    Regards,
    Marco
Sign In or Register to comment.