getting error on trying to receive data from excel sheet

瀏覽次數:281 次
跳到第一則未讀訊息

Rohit Srivastava

未讀,
2018年5月17日 凌晨3:51:522018/5/17
收件者:seleniu...@googlegroups.com
Hi,
I am new to this. I have created the following code.

package package_read;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;

import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;

public class data_read {
public static void main(String[] args) throws IOException  {
String data1;
FileInputStream fis;
 XSSFWorkbook wb;
 XSSFSheet sheet1;
File src = new File("C:\\Excel\\Read_data.xlsx");
    fis = new FileInputStream(src);
    wb=new XSSFWorkbook(fis);
    sheet1= wb.getSheetAt(0);
 
    int rowcount=sheet1.getLastRowNum();
    System.out.println("The row count is" + rowcount);
    for(int i=0;i<rowcount;i++)
    {
   data1=sheet1.getRow(i).getCell(0).getStringCellValue(); 
    
    System.out.println("The final value is"+data1);
    wb.close();
}
}

}


I am trying to fetch some values from the excel sheet at location, but I am getting the following issue.

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/collections4/ListValuedMap
at package_read.data_read.main(data_read.java:18)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.collections4.ListValuedMap
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)
... 1 more
Picked up _JAVA_OPTIONS: -Xmx512M


The program is getting terminated. Please help me understand the issue.

-Regards:
Rohit

Sahil Chaudhary

未讀,
2018年5月17日 凌晨4:32:072018/5/17
收件者:seleniu...@googlegroups.com
Use fillo jar its easy to use and u can retrieve data frm excel as DB.


--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CAHJpR8ri1dxXY5ZnJmQV9%2BYkDt89Nd3AaJrnOUFbRXH_JreW7Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Rohit Srivastava

未讀,
2018年5月17日 上午8:08:052018/5/17
收件者:seleniu...@googlegroups.com
Great....fillo has solved the issue

Thanks Sahil

Sindhu Jvs

未讀,
2018年5月22日 清晨5:42:502018/5/22
收件者:seleniu...@googlegroups.com
   I have a doubt in if-else condition in selenium, When we are verifying login of gmail how to put a condition login success or not.Please can you help me out in this scenario

Thanks Sahil


To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+unsubscribe@googlegroups.com.
To post to this group, send email to selenium-users@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+unsubscribe@googlegroups.com.
To post to this group, send email to selenium-users@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+unsubscribe@googlegroups.com.
To post to this group, send email to selenium-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CAHJpR8ojKKS7pwhrJKB70%3Dhdpa3VvO3q08410gxcmh9WKfhrig%40mail.gmail.com.

⇜Krishnan Mahadevan⇝

未讀,
2018年5月22日 清晨6:21:232018/5/22
收件者:seleniu...@googlegroups.com
Please refrain from hijacking other threads. 

Request you to please start a new thread for your question which includes the following (as applicable)

1. Selenium version 
2. Browser flavour and version. 
3. Source code. 
4. Html page source or link to a public site. 
5. Error details. 



Thanks Sahil


To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CABMvyndo0hwV%2BLdKO%3D%2BM5n70E47DLSzY_J7hcKCEuOBT6kOAog%40mail.gmail.com.

For more options, visit https://groups.google.com/d/optout.
--

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/

My Technical Scribbings @ http://rationaleemotions.wordpress.com/

回覆所有人
回覆作者
轉寄
0 則新訊息