Fixing Java-based connectors

This commit is contained in:
Miroslav Štampar 2026-06-04 20:47:10 +02:00
parent 46ba1d1bf1
commit 4f425792e3
4 changed files with 10 additions and 8 deletions

View file

@ -37,8 +37,9 @@ class Connector(GenericConnector):
jar = readInput(msg)
checkFile(jar)
args = "-Djava.class.path=%s" % jar
jvm_path = jpype.getDefaultJVMPath()
jpype.startJVM(jvm_path, args)
if not jpype.isJVMStarted():
jvm_path = jpype.getDefaultJVMPath()
jpype.startJVM(jvm_path, args)
except Exception as ex:
raise SqlmapConnectionException(getSafeExString(ex))

View file

@ -37,8 +37,9 @@ class Connector(GenericConnector):
jar = readInput(msg)
checkFile(jar)
args = "-Djava.class.path=%s" % jar
jvm_path = jpype.getDefaultJVMPath()
jpype.startJVM(jvm_path, args)
if not jpype.isJVMStarted():
jvm_path = jpype.getDefaultJVMPath()
jpype.startJVM(jvm_path, args)
except Exception as ex:
raise SqlmapConnectionException(getSafeExString(ex))