Skip to content

Error: JVM is already started #21

@FPEPOSHI

Description

@FPEPOSHI

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions