Error: Process finished with exit code -1073741819 (0xC0000005)
Im getting following error while trying the sample code provided in pyCharm CE. Plz advise how to resolve this.
Process finished with exit code -1073741819 (0xC0000005)
during debug i found that execution stucks at init.py at line 13
InputSource = jpype.JClass('org.xml.sax.InputSource')
Im using the following sample code:
from boilerpipe.extract import Extractor
extractor = Extractor(extractor='ArticleExtractor', url='http://edition.cnn.com/2017/05/31/asia/kabul-explosion-hits-diplomatic-area/index.html')
extractor = Extractor(extractor='KeepEverythingWithMinKWordsExtractor', url=your_url, kMin=20)
extracted_text = extractor.getText()
extracted_html = extractor.getHTML()
Thanks.
@mansoorfayyaz This issue looks specific to PyCharm setup. Can you create a python script that reproduces the same issue from command line ?
@tuxdna yes tried the same thru command line and got the following windows msg.
"Python has stopped working. A problem caused the program to stop working correctly. Windows will close the program and notify you if s solution is available."
and then no solution was suggested.
@mansoorfayyaz Can you share the script ?
@tuxdna Im using the same sample usage script provided in the package description. Here it is.
from boilerpipe.extract import Extractor
#url = 'http://edition.cnn.com/2017/05/31/asia/kabul-explosion-hits-diplomatic-area/index.html'
extractor = Extractor(extractor='ArticleExtractor', url='http://edition.cnn.com/2017/05/31/asia/kabul-explosion-hits-diplomatic-area/index.html')
extracted_text = extractor.getText()
extracted_html = extractor.getHTML()
print("extracted text: " + extracted_text)
print("extracted html: " + extracted_html)
Did some digging into this error and i think it has to do with the java virtual machine installed but cant figure out the exact cause n remedy. I confirmed that python 3.6 and java runtime installed in windows 10 are 32 bit . Ive also tried the following script found at #https://stackoverflow.com/questions/23430466/jpype-class-not-found This script again generated the same error - Process finished with exit code -1073741819 (0xC0000005).
import jpype
#jpype.startJVM("C:\Program Files (x86)\Java\jre1.8.0_121\bin\client\jvm.dll",'-ea' )
jpype.startJVM(jpype.getDefaultJVMPath(), "-ea")
util = jpype.JPackage("java.util")
al = util.ArrayList()
al.add(1)
al.add(2)
print(al.size())
jpype.shutdownJVM()
In the following snippet, at which line does the process finish?
import jpype
#jpype.startJVM("C:\Program Files (x86)\Java\jre1.8.0_121\bin\client\jvm.dll",'-ea' )
jpype.startJVM(jpype.getDefaultJVMPath(), "-ea")
util = jpype.JPackage("java.util")
al = util.ArrayList()
al.add(1)
al.add(2)
print(al.size())
jpype.shutdownJVM()
Based on your earlier report I guess it is at util = jpype.JPackage("java.util"). Can you confirm ?
If that is the case then surely there is something breaking between jpype and JVM
error occurs at jpype.startJVM()
jpype.startJVM(jpype.getDefaultJVMPath(), "-ea")
Error: Process finished with exit code -1073741819 (0xC0000005)