← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #698733]: xlrd.open_workbook throws back java.lang.ClassNotFoundException ( org.apache.xerces.parsers.SAXParser )

 

Question #698733 on SikuliX changed:
https://answers.launchpad.net/sikuli/+question/698733

Description changed to:
hello.
i'm on a sikuli 2.0.5, openJDK 8, windows 7 64.
i'm running the following function that is supposed to do a .xlsx file comparaison.
__________________________________________________________________________________________________________________

def compare_xls1(xls1, xls2):
    rb1 = xlrd.open_workbook(xls1)
    rb2 = xlrd.open_workbook(xls2)
    i = 1
    sheet1 = rb1.sheet_by_index(0)
    sheet2 = rb2.sheet_by_index(0)

    for rownum in range(max(sheet1.nrows, sheet2.nrows)):
        if rownum < sheet1.nrows:
            row_rb1 = sheet1.row_values(rownum)
            row_rb2 = sheet2.row_values(rownum)

            for colnum, (c1, c2) in enumerate(izip_longest(row_rb1, row_rb2)):
                if c1 != c2:
                    Debug.user("[ERROR] Row {} Col {} - {} != {}".format(rownum+1, colnum+1, c1.encode('utf-8'), c2.encode('utf-8')))
                    i = 0
        else:
            Debug.user("[ERROR] Row {} missing".format(rownum+1))
            i = 0
    return i
__________________________________________________________________________________________________________________

the thing is, when i call for that function on a sikuli 2.0.5, the
compiler throws back the following errors:

[error] script [ xlsx_test ] stopped with error in line 5
[error] java.lang.ClassNotFoundException ( org.apache.xerces.parsers.SAXParser )
[error] --- Traceback --- error source first
line: module ( function ) statement 
91: expat (  __init__ )     self._reader = XMLReaderFactory.createXMLReader(_xerces_parser_name)
59: expat (  ParserCreate )     return XMLParser(encoding, namespace_separator)
1480: ElementTree (  __init__ )     parser = expat.ParserCreate(encoding, "}")
1205: ElementTree (  iterparse )     parser = XMLParser(target=TreeBuilder())
55: xlsx (  ensure_elementtree_imported )     ET.iterparse(_dummy_stream)
55: xlsx (  ensure_elementtree_imported )     ET.iterparse(_dummy_stream)
792: xlsx (  open_workbook_2007_xml )     ensure_elementtree_imported(verbosity, logfile)
130: __init__ (  open_workbook )     bk = xlsx.open_workbook_2007_xml(
8412: fct (  compare_xls1 )     rb1 = xlrd.open_workbook(xls1)
5: main (  <module> )     if fct.compare_xls1("C:\\Users\\W7_64_EN\\Desktop\\ATS_eZ\\Configurat
ions\\conf_***\\*******\\****-export.xlsx" , "C:\\Users\\W7_64_EN\\Desktop\\ATS_eZ\\Configurations\\conf_***\\*******_With_CI_Enabled\\****-export.xlsx") == 1:
[error] --- Traceback --- end --------------


but weirdly enough sikuli  1.1.2 seems to run it without any issues.
please, could it be a potential bug for 2.0.5 that induces such behaviour ? or there might be something in the function code that needs adjustment for 2.0.5?
looking forward to a reply , thank you in advance.
PS: i also tried upgrading OpenJDK to version 16 just in case, but it didn't seem to help much

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for SikuliX.