Module 21- core_Hybrid | Selenium Forum
M
Posted on 28/11/2015
Hi Guys,
i am getting the below error after copying files from core-hybrid and giving a dry run. The excel files gets corrupted and becomes unable to open after each execution.
Any help on is this much appreciated.

Exception in thread "main" java.lang.NoClassDefFoundError: net/sf/saxon/om/Name
at net.sf.saxon.dom.DOMSender.outputElement(DOMSender.java:183)
at net.sf.saxon.dom.DOMSender.walkNode(DOMSender.java:138)
at net.sf.saxon.dom.DOMSender.send(DOMSender.java:92)
at net.sf.saxon.dom.DOMObjectModel.sendSource(DOMObjectModel.java:100)
at net.sf.saxon.event.Sender.send(Sender.java:176)
at net.sf.saxon.IdentityTransformer.transform(IdentityTransformer.java:28)
at org.apache.poi.openxml4j.opc.StreamHelper.saveXmlInStream(StreamHelper.java:80)
at org.apache.poi.openxml4j.opc.internal.marshallers.ZipPartMarshaller.marshallRelationshipPart(ZipPartMarshaller.java:174)
at org.apache.poi.openxml4j.opc.ZipPackage.saveImpl(ZipPackage.java:468)
at org.apache.poi.openxml4j.opc.OPCPackage.save(OPCPackage.java:1441)
at org.apache.poi.POIXMLDocument.write(POIXMLDocument.java:202)
at com.qtpselenium.xls.read.Xls_Reader.setCellData(Xls_Reader.java:224)
at com.qtpselenium.test.DriverScript.createXLSReport(DriverScript.java:155)
at com.qtpselenium.test.DriverScript.start(DriverScript.java:92)
at com.qtpselenium.test.DriverScript.main(DriverScript.java:39)
Caused by: java.lang.ClassNotFoundException: net.sf.saxon.om.Name
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)
... 15 more

M
Replied on 28/11/2015

download this jar and add to library

http://www.java2s.com/Code/Jar/s/Downloadsaxon9108jar.htm


M
Replied on 28/11/2015

I have downloaded the jar Saxon 9.4.0.7 to the Project. The error remains the same. I tried to write to a file separately, That is failing. But both have same error. Open the excel file says "Excel error "cannot open file because the file format or file extension is not valid." I am using using pirated version of Microsoft office Professional 2013 . could this be a problem?

File src = new File("C:\\Users\\xxx\\Documents\\Selenium Excels\\writeToExcel.xlsx");
FileInputStream fis = new FileInputStream(src);
XSSFWorkbook wb = new XSSFWorkbook(fis);
XSSFSheet Sheet1 = wb.getSheetAt(0);
Sheet1.getRow(0).createCell(2).setCellValue("Pass");

FileOutputStream out = new FileOutputStream(src);
wb.write(out);
wb.close();

Error for above lies ------
Exception in thread "main" java.io.EOFException: Unexpected end of ZLIB input stream
at java.util.zip.InflaterInputStream.fill(Unknown Source)
at java.util.zip.InflaterInputStream.read(Unknown Source)
at java.util.zip.ZipInputStream.read(Unknown Source)
at org.apache.poi.openxml4j.util.ZipSecureFile$ThresholdInputStream.read(ZipSecureFile.java:143)
at java.io.FilterInputStream.read(Unknown Source)
at org.apache.poi.openxml4j.util.ZipInputStreamZipEntrySource$FakeZipEntry.<init>(ZipInputStreamZipEntrySource.java:130)
at org.apache.poi.openxml4j.util.ZipInputStreamZipEntrySource.<init>(ZipInputStreamZipEntrySource.java:57)
at org.apache.poi.openxml4j.opc.ZipPackage.<init>(ZipPackage.java:92)
at org.apache.poi.openxml4j.opc.OPCPackage.open(OPCPackage.java:273)
at org.apache.poi.util.PackageHelper.open(PackageHelper.java:37)
at org.apache.poi.xssf.usermodel.XSSFWorkbook.<init>(XSSFWorkbook.java:274)
at writeToExcel.riteToExcel.main(riteToExcel.java:17)

Core Hybrid Project Error-----------------

java.io.EOFException: Unexpected end of ZLIB input stream
at java.util.zip.InflaterInputStream.fill(Unknown Source)
at java.util.zip.InflaterInputStream.read(Unknown Source)
at java.util.zip.ZipInputStream.read(Unknown Source)
at org.apache.poi.openxml4j.util.ZipSecureFile$ThresholdInputStream.read(ZipSecureFile.java:143)
at java.io.FilterInputStream.read(Unknown Source)
at org.apache.poi.openxml4j.util.ZipInputStreamZipEntrySource$FakeZipEntry.<init>(ZipInputStreamZipEntrySource.java:130)
at org.apache.poi.openxml4j.util.ZipInputStreamZipEntrySource.<init>(ZipInputStreamZipEntrySource.java:57)
at org.apache.poi.openxml4j.opc.ZipPackage.<init>(ZipPackage.java:92)
at org.apache.poi.openxml4j.opc.OPCPackage.open(OPCPackage.java:273)
at org.apache.poi.util.PackageHelper.open(PackageHelper.java:37)
at org.apache.poi.xssf.usermodel.XSSFWorkbook.<init>(XSSFWorkbook.java:274)
at com.qtpselenium.xls.read.Xls_Reader.<init>(Xls_Reader.java:35)
at com.qtpselenium.test.DriverScript.start(DriverScript.java:65)
at com.qtpselenium.test.DriverScript.main(DriverScript.java:39)
Exception in thread "main" java.lang.NullPointerException
at com.qtpselenium.xls.read.Xls_Reader.getRowCount(Xls_Reader.java:46)
at com.qtpselenium.test.DriverScript.start(DriverScript.java:68)
at com.qtpselenium.test.DriverScript.main(DriverScript.java:39)

I will run the script in a different machine and post the comments.

Thanks again


M
Replied on 28/11/2015

Responsive image
Open browser openBrowser PASS
Navigate to website navigate PASS
CheckTitle verifyTitle PASS

Finally worked in my own machine after including the jars as you suggested.

Thanks so much for your help.