I'm getting an error: JVM is already started when I try to extract the text from pdf for the second time.
I can see that when PDFBox is constructed, you try to start JVM jpype.startJVM(convertStrings=False) and this gives an error when its already started. Is it better to use jpype.isJVMStarted() to check before you try to start JVM?
So, in my case, it will be better to check before starting it, because I use it for API calls and it will crash when I have 2 or more concurrent calls.
Possible fix for the constructor:
if jpype.isJVMStarted() is False:jpype.startJVM(convertStrings=False)
I'm getting an error: JVM is already started when I try to extract the text from pdf for the second time.
I can see that when PDFBox is constructed, you try to start JVM
jpype.startJVM(convertStrings=False)
and this gives an error when its already started. Is it better to usejpype.isJVMStarted()
to check before you try to start JVM?So, in my case, it will be better to check before starting it, because I use it for API calls and it will crash when I have 2 or more concurrent calls.
Possible fix for the constructor:
if jpype.isJVMStarted() is False:
jpype.startJVM(convertStrings=False)