2

I am trying to access the existing Excel sheet and trying to create a new sheet and update the sheet with some values,On executing i am getting the below error for line "rowHeader.createCell((short) count ).setCellValue("test1");" Java.lang.NoClassDefFoundError :org/openxmlformats/schemas/spreadsheetml/x2006/main/ctextensionlist error on executing the below code

Foll are the list of jars i used

commons-codec-1.9

commons-logging-1.1.3

commons-net-3.3-ftp

junit-4.12,

jxl-2.6.6-sources,

jxl-2.6,

log4j-1.2.17,

MasterExcelReport,

ojdbc6,

poi-3.13-20150929,

poi-3.15-beta1,

poi-examples-3.13-20150929,

poi-examples-3.15-beta1,

poi-excelant-3.13-20150929,

poi-excelant-3.15-beta1,

poi-ooxml-3.5-beta5,

poi-ooxml-3.13-20150929,

poi-ooxml-3.15-beta1,

poi-ooxml-schemas-3.13-20150929,

poi-ooxml-schemas-3.15-beta1,

poi-scratchpad-3.13-20150929,

poi-scratchpad-3.15-beta1,

postgresql-9.3-1102.jdbc41,

sqljdbc42, xmlbeans-2.6.0

import java.io.*;
import java.util.*;
import java.util.List;
import javax.xml.parsers.*;
import javax.xml.xpath.*;
import javax.xml.datatype.*;
import javax.xml.*;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import org.w3c.dom.*;
import org.apache.poi.ss.usermodel.*;
import java.util.Iterator;
import java.lang.*;
import org.apache.poi.xssf.usermodel.XSSFCell;
import org.apache.poi.xssf.usermodel.XSSFRow;
import org.apache.poi.xssf.usermodel.XSSFSheet;
  import org.apache.poi.xssf.usermodel.XSSFWorkbook;



def fname = new Date().format("MM-dd-YYYY-HH-mm-a-z")
def TimeStamp = context.expand('${General_Properties#Current_Date}')
def destination_path_File = context.expand('${General_Properties#Destination_path}')
def destination_path = destination_path_File + "_" + TimeStamp
def Request = testRunner.testCase.getTestStepByName("Alliance_Ser")
//def FileName = "Individual Coverages Premium Result"
def Vehical = context.expand('${General_Properties#Alliance_Vehicals}')
def Driver = context.expand('${General_Properties#Alliance_Drivers}')
def FolderName = context.expand('${General_Properties#StateCode}')
def FileName = FolderName + "_Result_Status and Total Premiums_" + Vehical + "_Vehicals_" + Driver + "_Drivers"
def ResultPath = destination_path + "\\" + FolderName + "\\" + FileName + "_" + TimeStamp + ".xls"
log.info ResultPath


FileInputStream fileIn = new  FileInputStream(new File(ResultPath))
 XSSFWorkbook workbook = new XSSFWorkbook(fileIn);

 XSSFSheet sheet = workbook.createSheet("Coverage_Resp_report");
short count = 0;
Row rowHeader = sheet.createRow((short)count);
rowHeader.createCell((short) count ).setCellValue("test1");
//rowHeader.createCell((short) count ).setCellValue("Test2");

FileOutputStream fileOut =new FileOutputStream(new File(ResultPath));  //Open FileOutputStream to write updates
workbook.write(fileOut); //write changes
fileOut.close();  
Naveen.c14
  • 23
  • 1
  • 6
  • What is your classpath? – Rao Sep 22 '17 at 06:53
  • I am doing this in soapUI tool .I don't define a class path ,I just import – Naveen.c14 Sep 22 '17 at 07:08
  • Other can't image that unless you specify that. Any ways, what libraries have you copied under soapui? – Rao Sep 22 '17 at 08:57
  • poi-ooxml-3.5-beta5 – Naveen.c14 Sep 22 '17 at 09:49
  • Just that one file? Can you list all the jar files which are available under the `SOAPUI_HOME/bin/ext` directory. – Rao Sep 22 '17 at 09:57
  • commons-codec-1.9, commons-logging-1.1.3, commons-net-3.3-ftp, junit-4.12, jxl-2.6.6-sources, jxl-2.6, log4j-1.2.17, MasterExcelReport, ojdbc6, poi-3.13-20150929, poi-3.15-beta1, poi-examples-3.13-20150929, poi-examples-3.15-beta1, poi-excelant-3.13-20150929, poi-excelant-3.15-beta1, poi-ooxml-3.5-beta5, poi-ooxml-3.13-20150929, poi-ooxml-3.15-beta1, poi-ooxml-schemas-3.13-20150929, poi-ooxml-schemas-3.15-beta1, poi-scratchpad-3.13-20150929, poi-scratchpad-3.15-beta1, postgresql-9.3-1102.jdbc41, sqljdbc42, xmlbeans-2.6.0 – Naveen.c14 Sep 22 '17 at 10:33
  • Would you mind updating the same in the question as this is not readable. – Rao Sep 22 '17 at 10:37
  • I have updated the same in the question – Naveen.c14 Sep 25 '17 at 04:50

1 Answers1

2

After copying 'ooxml-schemas-1.3.jar' file in lib folder, issue was resolved