"FAILING TO LOAD EXCEL DATA"

amogha_ec
amogha_ec New Altair Community Member
edited November 5 in Community Q&A
Hello Everyone,

                        I am trying to create ExampleSet from an Excel sheet and wants to iterate through each row..but getting an exception.Please help...
MY Java Code is:

                    RapidMiner.init();
                    String fileName="C:\\Excel\\excelexamplesource.xml";
    File file=new File(fileName);
    String xml = com.rapidminer.tools.Tools.readTextFile(file);
                    Process process = new Process(xml);
                    IOContainer ioResult = process.run();  // Getting Exception at this line
if (ioResult.getElementAt(0) instanceof ExampleSet)
                                {
ExampleSet resultSet = (ExampleSet)ioResult.getElementAt(0);

}

And My excelexamplesource.xml looks like:


<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<process version="5.1.008">
  <context>
    <input/>
    <output/>
    <macros/>
  </context>
  <operator activated="true" class="process" compatibility="5.1.008" expanded="true" name="Process">
    <process expanded="true" height="100" width="212">
      <operator activated="true" class="read_excel" compatibility="5.1.008" expanded="true" height="60" name="Read Excel" width="90" x="45" y="30">
        <parameter key="excel_file" value="C:\Excel\Employee1.xls"/>
        <list key="annotations"/>
        <list key="data_set_meta_data_information"/>
      </operator>
      <connect from_op="Read Excel" from_port="output" to_port="result 1"/>
      <portSpacing port="source_input 1" spacing="0"/>
      <portSpacing port="sink_result 1" spacing="0"/>
      <portSpacing port="sink_result 2" spacing="0"/>
    </process>
  </operator>
</process>

And the Exception is:

2011-05-31 14:21:57 INFO: No filename given for result file, using stdout for logging results! (WrapperLoggingHandler.log())
2011-05-31 14:21:57 INFO: Process C:\Excel\pichart1.rmp starts (Process.run())
2011-05-31 14:21:58 SEVERE: Servlet.service() for servlet ExcelLoader threw exception (StandardWrapperValve.invoke())
  java.lang.ArrayIndexOutOfBoundsException: -1
      jxl.read.biff.SheetImpl.getCell(SheetImpl.java:325)
      com.rapidminer.operator.nio.model.ExcelResultSet.<init>(ExcelResultSet.java:120)
      com.rapidminer.operator.nio.model.ExcelResultSetConfiguration.makeDataResultSet(ExcelResultSetConfiguration.java:184)
      com.rapidminer.operator.nio.model.AbstractDataResultSetReader.createExampleSet(AbstractDataResultSetReader.java:103)
      com.rapidminer.operator.io.AbstractExampleSource.read(AbstractExampleSource.java:52)
      com.rapidminer.operator.io.AbstractExampleSource.read(AbstractExampleSource.java:36)
      com.rapidminer.operator.io.AbstractReader.doWork(AbstractReader.java:123)
      com.rapidminer.operator.Operator.execute(Operator.java:829)
      com.rapidminer.operator.execution.SimpleUnitExecutor.execute(SimpleUnitExecutor.java:51)
      com.rapidminer.operator.ExecutionUnit.execute(ExecutionUnit.java:709)
      com.rapidminer.operator.OperatorChain.doWork(OperatorChain.java:369)
      com.rapidminer.operator.Operator.execute(Operator.java:829)
      com.rapidminer.Process.run(Process.java:901)
      com.rapidminer.Process.run(Process.java:797)
      com.rapidminer.Process.run(Process.java:792)
      com.rapidminer.Process.run(Process.java:782)
      ExcelLoader.process(ExcelLoader.java:101)
      ExcelLoader.doGet(ExcelLoader.java:41)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:627)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
      org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
      org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
      org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
      org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172)
      org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
      org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
      org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
      org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
      org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:843)
      org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:679)
      org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1293)
      java.lang.Thread.run(Thread.java:619)
2011-05-31 14:37:33 INFO: Reloading this Context has started (StandardContext.reload())

Please help
Tagged:

Answers