Problem while initializing RM

FireholderFireholder Member Posts: 26 Maven
edited November 2018 in Help
Hello everybody,
I'm facing very irritating problem.))And I simply can't get rid of it on my own.
I have wrote some code which get the output from RM.(Let's call first or normal Java project) So now I have created a web project in Eclipse to use the output data and post it on my web page.I haven't created Servlet just simple JSP page. So I added classes as a packages to my web project.And also I have added rapidminer.jar to a library.Those classes have logic for getting the output from RM. Then I have posted the code, which gets the output data, to a script on my JSP. But it didn't work out. Then I have tried simply initialize RM in one of the classes.(RapidMiner.init();,everything worked in a normal Java project) But this is what I get in respond:
exception

org.apache.jasper.JasperException: javax.servlet.ServletException: java.lang.NoClassDefFoundError: com/rapidminer/RapidMiner
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:500)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:410)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

root cause

javax.servlet.ServletException: java.lang.NoClassDefFoundError: com/rapidminer/RapidMiner
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:865)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:794)
org.apache.jsp.index_jsp._jspService(index_jsp.java:128)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:386)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

root cause

java.lang.NoClassDefFoundError: com/rapidminer/RapidMiner
classes.Tester.doit(Tester.java:51)
classes.Tester.getData(Tester.java:34)
org.apache.jsp.index_jsp._jspService(index_jsp.java:83)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:386)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

note The full stack trace of the root cause is available in the Apache Tomcat/6.0.32 logs.
I have checked and compared content of libraries in my first Java project with my new web Java project,the packages of RM are same. But in my web project  multiple errors occurred.May be initializing in this case should  be made in a different way? 
Tagged:

Answers

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

    use
    RapidMiner.setExecutionMode(ExecutionMode.APPSERVER);
    RapidMiner.init();
    or
    RapidMiner.setExecutionMode(ExecutionMode.APPLET);
    RapidMiner.init();
    , whichever fits your needs.

    Apart from that, you need to add all the required libraries to your server's lib folder. I think it is "lib/apps" in case of Tomcat, however I'm not 100% sure.
    RapidMiner.jar alone is not sufficient! To be on the safe side, copy all .jar files from the RapidMiner lib folder (look in your Eclipse workspace). You can remove unused ones later.

    Regards,
    Marco
Sign In or Register to comment.