getting error on trying to receive data from excel sheet

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

getting error on trying to receive data from excel sheet

Rohit Srivastava
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

--
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 [hidden email].
To post to this group, send email to [hidden email].
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.
Reply | Threaded
Open this post in threaded view
|

Re: getting error on trying to receive data from excel sheet

Sahil Chaudhary
Use fillo jar its easy to use and u can retrieve data frm excel as DB.


On Thu, 17 May 2018 at 1:21 PM, Rohit Srivastava <[hidden email]> wrote:
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

--
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 [hidden email].
To post to this group, send email to [hidden email].
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.

--
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 [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CAA2NVpNzXJ7Co8t6hxbxXdJdV%2BN8pU0Hyjpq1ToC54L8Sx31nQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: getting error on trying to receive data from excel sheet

Rohit Srivastava
Great....fillo has solved the issue

Thanks Sahil

On Thu, May 17, 2018, 2:02 PM Sahil Chaudhary <[hidden email]> wrote:
Use fillo jar its easy to use and u can retrieve data frm excel as DB.


On Thu, 17 May 2018 at 1:21 PM, Rohit Srivastava <[hidden email]> wrote:
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

--
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 [hidden email].
To post to this group, send email to [hidden email].
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.

--
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 [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CAA2NVpNzXJ7Co8t6hxbxXdJdV%2BN8pU0Hyjpq1ToC54L8Sx31nQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

--
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 [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CAHJpR8ojKKS7pwhrJKB70%3Dhdpa3VvO3q08410gxcmh9WKfhrig%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: getting error on trying to receive data from excel sheet

Sindhu Jvs
   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

On Thu, May 17, 2018 at 5:37 PM, Rohit Srivastava <[hidden email]> wrote:
Great....fillo has solved the issue

Thanks Sahil


On Thu, May 17, 2018, 2:02 PM Sahil Chaudhary <[hidden email]> wrote:
Use fillo jar its easy to use and u can retrieve data frm excel as DB.


On Thu, 17 May 2018 at 1:21 PM, Rohit Srivastava <[hidden email]> wrote:
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

--
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 [hidden email].
To post to this group, send email to [hidden email].
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.

--
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 [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CAA2NVpNzXJ7Co8t6hxbxXdJdV%2BN8pU0Hyjpq1ToC54L8Sx31nQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

--
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 [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CAHJpR8ojKKS7pwhrJKB70%3Dhdpa3VvO3q08410gxcmh9WKfhrig%40mail.gmail.com.

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

--
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 [hidden email].
To post to this group, send email to [hidden email].
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.
Reply | Threaded
Open this post in threaded view
|

Re: getting error on trying to receive data from excel sheet

Krishnan Mahadevan
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. 



On Tue 22 May, 2018, 15:12 Sindhu Jvs, <[hidden email]> wrote:
   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

On Thu, May 17, 2018 at 5:37 PM, Rohit Srivastava <[hidden email]> wrote:
Great....fillo has solved the issue

Thanks Sahil


On Thu, May 17, 2018, 2:02 PM Sahil Chaudhary <[hidden email]> wrote:
Use fillo jar its easy to use and u can retrieve data frm excel as DB.


On Thu, 17 May 2018 at 1:21 PM, Rohit Srivastava <[hidden email]> wrote:
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

--
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 [hidden email].
To post to this group, send email to [hidden email].
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.

--
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 [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CAA2NVpNzXJ7Co8t6hxbxXdJdV%2BN8pU0Hyjpq1ToC54L8Sx31nQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

--
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 [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CAHJpR8ojKKS7pwhrJKB70%3Dhdpa3VvO3q08410gxcmh9WKfhrig%40mail.gmail.com.

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

--
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 [hidden email].
To post to this group, send email to [hidden email].
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/

--
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 [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CANikZLkszNqgWfZFngN2s6G8E0O_LZ%3Dp%3D0QsRhRGqLAKyM3%2BNw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.