Getting "java.lang.NoClassDefFoundError" for Testng Dataprovider with Excel

getting synonym thesaurus
getting ready
getting over it
getting over it free
getting sentence
obtaining
getting in hindi
define obtain

I am not able to get past the error "java.lang.NoClassDefFoundError"

Tried: 1- Cleaning the project 2- Updating testng xml 3- Verified the package/class structure

Nothing seems to work:

Note: I am not using Maven and all jar files are latest (Testng, Apache, Selenium)

Test Class code :

@DataProvider(name ="calldata")
public Object[][] getData() {

    ExcelUtility util = new ExcelUtility("excel path");

    int rows = util.getRowCount(0);

    Object data [][] = new Object[rows] [6];

    for(int i=1; i<rows; i++)
    {
        data[i][0]=util.getData(0, i, 0);
        data[i][1]=util.getData(0, i, 1);
        data[i][1]=util.getData(0, i, 2);
        data[i][1]=util.getData(0, i, 3);
        data[i][1]=util.getData(0, i, 4);
        data[i][1]=util.getData(0, i, 5);
    }

    return data;
}

@Test(dataProvider ="calldata")
 public void AddaDependent(String url, String client, String eliggrp, String empnumber, String firstname, String SSN) 
    {

Excel Utility code:

package AllExcel;

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

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

public class ExcelUtility {

XSSFWorkbook wb;
XSSFSheet sheet1;

public ExcelUtility(String excelPath)
{
    try
    {
        File src = new File(excelPath);

        FileInputStream fis= new FileInputStream(src);
        wb = new XSSFWorkbook(fis);

    }
    catch (Exception e) {
        System.out.println(e.getMessage());

    }
}

public String getData(int sheetNumber, int row, int column)
{
    sheet1 = wb.getSheetAt(0);

    String data = sheet1.getRow(row).getCell(column).getStringCellValue();

    return data;
}

public int getRowCount(int sheetIndex)
{
    int row = wb.getSheetAt(sheetIndex).getLastRowNum();

    row = row+1;

    return row;
}

}

Error:

[RemoteTestNG] detected TestNG version 6.14.3 [Utils] [ERROR] [Error] java.lang.NoClassDefFoundError: org/apache/commons/compress/archivers/zip/ZipFile at org.apache.poi.openxml4j.opc.OPCPackage.open(OPCPackage.java:298) at org.apache.poi.ooxml.util.PackageHelper.open(PackageHelper.java:37) at org.apache.poi.xssf.usermodel.XSSFWorkbook.<init>(XSSFWorkbook.java:307) at AllExcel.ExcelUtility.<init>(ExcelUtility.java:22) at AutFramework.AddDependent.getData(AddDependent.java:36) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source)

As long as you are not using Maven, you can download the jar from here. Add it to your class path and it should work: https://mvnrepository.com/artifact/org.apache.commons/commons-collections4/4.2

Reason being, Apache has removed the Interface ListValuedMap from commons-Collections4-4.0.

getting, EXAMPLES FROM THE WEB FOR GETTING. He's getting old, and he's come along into his second childhood. "And you're getting it so  get: [verb] to gain possession of. to receive as a return : earn.

Basically as per Axel's link, I copied "common compress jar" and the mentioned error went away, now I am getting another error and that needs to be handled in another question. closing this one for now

Getting Synonyms, Getting Antonyms, 261 synonyms of getting from the Merriam-Webster Thesaurus, plus 366 related words, definitions, and antonyms. Find another word for getting. getting definition: 1. present participle of get 2. present participle of get . Learn more.

Download the apache compress jars and add to library , I tried this and it worked fine.

GETTING, getting meaning: 1. present participle of get 2. present participle of get . Learn more. Getting definition: Getting is the present participle of → get 1 . | Meaning, pronunciation, translations and examples

Getting definition and meaning, Getting definition: Getting is the present participle of → get 1 . | Meaning, pronunciation, translations and examples. getting (plural gettings) The act of obtaining or acquiring; acquisition. Bible, Proverbs iv. 7 With all thy getting, get understanding.

GET (verb) definition and synonyms, It's getting late – I have to go. If that spot gets any bigger you should go to the doctor. get wet/cold/tired/ill etc: It was raining and we all got wet. get angry/upset etc  Synonyms for getting in Free Thesaurus. Antonyms for getting. 1 synonym for getting: acquiring. What are synonyms for getting?

getting, Cowsep streams League of Legends every day on Facebook! Check it out: https:/​/fb.gg/cowsep Duration: 11:52 Posted: 24 minutes ago Created by Mark V. Olsen. With Laurie Metcalf, Alex Borstein, Niecy Nash, Mel Rodriguez. Set in a geriatric extended care wing of a down-at-the-heels hospital, Getting On follows put-upon nurses, anxious doctors and administrators as they struggle with the darkly comic, brutally honest and quietly compassionate realities of caring for the elderly.

Comments
  • See stackoverflow.com/questions/52381075/…
  • I already have the jar "commons-collections4-4.2.jar" added in build path, did you mean anything else to do ?
  • I added common compress jar and now I am getting the following error: [Utils] [ERROR] [Error] java.lang.IllegalStateException: Cannot get a STRING value from a NUMERIC cell at org.apache.poi.xssf.usermodel.XSSFCell.typeMismatch(XSSFCell.java:1075) at org.apache.poi.xssf.usermodel.XSSFCell.getRichStringCellValue(XSSFCell.java:396) at org.apache.poi.xssf.usermodel.XSSFCell.getStringCellValue(XSSFCell.java:348) at AllExcel.ExcelUtility.getData(ExcelUtility.java:35) at AutFramework.AddDependent.getData(AddDependent.java:47)
  • you are calling getStringCellValue() on a numeric cell - that's why you get the exception java.lang.IllegalStateException: Cannot get a STRING value from a NUMERIC cell - there are lots of examples of how to read poi cells properly - you need to use cell.getCellType() and depending on its type, call the getStringCellValue or getNumericCellValue or getBooleanCellValue etc
  • That error is pretty straightforward. You are reading a number from your excel but you attempting to assign the value read as a STRING instead of INTEGER, DECIMAL, LONG..