Bug #4859
closedJet Runtime Has detected Unrecoverable Error-libsaxonhec.dll transformToString not found
0%
Description
When trying to run the following code, i am getting this error:
Error: C:\Program Files\Saxonica\SaxonHEC1.2.1\libsaxonhec.dlltransformToString not found
12072020
JET RUNTIME HAS DETECTED UNRECOVERABLE ERROR: system exception at 0x00007fffed7d0a68
print(fcfilename)
proc=saxonc.PySaxonProcessor(license=False)
print('Test Saxon/C on Python')
print(proc.version)
xslt30_processor = proc.new_xslt30_processor()
xslt30_processor.set_cwd(".")
transform=xslt30_processor.transform_to_string(source_file="S:/QA/Projects2/SBE/schematron/NJFC_0814_22000040437.xml",stylesheet_file='S:/QA/Projects2/SBE/schematron/AccountTransfer-runtime-compiled.xsl',output_file='S:/QA/Projects2/SBE/schematron/testresults.xml')
msg=xslt30_processor.get_xsl_messages()
print(fcfilename)
printed=[]
if msg is not None:
i=0
while i <msg.size:
if str(msg.item_at(i)) not in printed:
print('\t'+msg.item_at(i))
printed.append(str(msg.item_at(i)))
Files
Related issues
Updated by Michael Kay almost 4 years ago
- Project changed from Saxon to SaxonC
- Assignee set to O'Neil Delpratt
Updated by O'Neil Delpratt almost 4 years ago
- Is duplicate of Bug #4847: sotransformToString - Python added
Updated by O'Neil Delpratt almost 4 years ago
- Category set to Python
- Status changed from New to Duplicate
- Found in version set to 1.2.1
Hi,
Thanks for reporting this issue. This looks like the same bug issue as #4847. In comment #2 we describe the issue and solution. In summary the get_xsl_messages
function has incorrect JNI code in the underlying C++ code. A fix is available for the next release of Saxon/C
As a workaround there is a patched file Xslt30Processor.cpp
attached in the same bug issue #4847 please download it, replace the file you have and rebuild the Saxon/C product for python.
Updated by Brian Higashide almost 4 years ago
The fix from #4847 has been applied and the module rebuilt but I am still seeing the same error message.
Updated by O'Neil Delpratt almost 4 years ago
- Status changed from Duplicate to In Progress
Updated by O'Neil Delpratt almost 4 years ago
- Status changed from In Progress to AwaitingInfo
Hi,
you are missing a set property for xsl:message:
xslt30_processor.set_property('m', '')
The bug issue #4847 also mentions:
What actually happens to the xsl:messages by default is to output messages to the standard output console,
but this does not find its way to python. As mentioned in the bug issue #4147 to capture the messages you
will have to call xslt30_processor.set_property('m', '') before you do the transformation.
The culprit of the exception thrown is the size
property. For some reason we create a PyXdmValue object over an empty sequence. We probably should return None
for when get_xsl_message
has no xsl:message to return.
Updated by Brian Higashide almost 4 years ago
- File jet_err_14200.txt jet_err_14200.txt added
- File jet_dump_14200.dmp jet_dump_14200.dmp added
I have updated the code as follows, but still receiving the same error
for fcfilename in os.listdir(path):
print(fcfilename)
proc=saxonc.PySaxonProcessor(license=False)
print('Test Saxon/C on Python')
print(proc.version)
xslt30_processor = proc.new_xslt30_processor()
xslt30_processor.set_property('m','')
xslt30_processor.set_cwd(".")
transform=xslt30_processor.transform_to_string(source_file="S:/QA/Projects2/SBE/schematron/NJFC_0814_22000040437.xml",stylesheet_file='S:/QA/Projects2/SBE/schematron/AccountTransfer-runtime-compiled.xsl',output_file='S:/QA/Projects2/SBE/schematron/testresults.xml')
# dink=xslt30_processor.transform_to_string(source_file=path+'/'+fcfilename,stylesheet_file='S:/QA/Projects2/SBE/schematron/AccountTransfer-runtime-compiled.xsl',output_file='S:/QA/Projects2/SBE/schematron/testresults.xml')
msg=xslt30_processor.get_xsl_messages()
print(fcfilename)
printed=[]
if msg is not None:
i=0
while i <msg.size:
if str(msg.item_at(i)) not in printed:
print('\t'+msg.item_at(i))
printed.append(str(msg.item_at(i)))
Updated by O'Neil Delpratt almost 4 years ago
- Status changed from AwaitingInfo to In Progress
Please can you send us your stylesheet and XML document either on the bug issue or private email.
Updated by Brian Higashide almost 4 years ago
Just wanted to update, this is working fine on my home computer but I'm only having issues on my office pc so it might be difficult to duplicate.
I will try reinstalling it on Monday just in case.
Updated by O'Neil Delpratt almost 4 years ago
Thanks for sending me your files privately.
On my linux machine the stylesheet displays the xsl:messages as expected.
On your office pc please double check that you have applied the fixes described in comment #3.
Please can you describe your environment such as platform that you are using. I assume you are using a Windows machine.
Updated by Brian Higashide almost 4 years ago
Sure, I am running windows 10 64bit on my office pc.
I have the same setup at home (windows 10, 64 bit) which is running fine after the fix but not on my office machine for some reason.
Updated by O'Neil Delpratt almost 4 years ago
It looks like we have a cython caching problem when changes are made to the C++ files:
https://stackoverflow.com/questions/55836761/cython-c-cache-how-to-clear
Updated by O'Neil Delpratt almost 4 years ago
- Status changed from In Progress to AwaitingInfo
So the link I posted does not have a solution, but what is clear is that the python extension build, which uses cython is not picking up the modified Xslt30Processor.cpp file. I am not experiencing this on my windows machine, but I know this issue can happen as I once experienced it in the past on my mac platform.
There are a number options here /
-
try to deleting the object file for Xslt30Processor in the directory
../Saxon.C.APIpython-saxon/build/temp.win-amd64-3.7/Xslt30Processor.obj
(directory may be slightly different if not on the same python release) and then rebuild the python extension -
If 1. fails try reinstalling Saxon/C and apply the patch before you rebuild the python extension
Also being on the latest stable cython release could make the difference. Please can you confirm which cython version you have on your office machine?
In Powershell on my machine if I run cython --version
I get:
Cython version 0.29.14
Updated by Brian Higashide almost 4 years ago
Hi O'Neil. my cython version is 0.29.21
removing the Xslt30Processor.obj and rebuilding the extension looks to have fixed the problem. Now my code is running without errors.
Thanks for the help!
Updated by O'Neil Delpratt almost 3 years ago
- Status changed from AwaitingInfo to Closed
Please register to edit this issue