getting error on trying to receive data from excel sheet

281 prikaz
Preskoči na prvu nepročitanu poruku

Rohit Srivastava

nepročitano,
17. svi 2018. 03:51:5217. 05. 2018.
u 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

nepročitano,
17. svi 2018. 04:32:0717. 05. 2018.
u 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

nepročitano,
17. svi 2018. 08:08:0517. 05. 2018.
u seleniu...@googlegroups.com
Great....fillo has solved the issue

Thanks Sahil

Sindhu Jvs

nepročitano,
22. svi 2018. 05:42:5022. 05. 2018.
u 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⇝

nepročitano,
22. svi 2018. 06:21:2322. 05. 2018.
u 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/

Odgovori svima
Odgovori autoru
Proslijedi
0 novih poruka