python-ldap-test icon indicating copy to clipboard operation
python-ldap-test copied to clipboard

Error running on windows 10 - 'exec' is not recognized

Open whatalokation opened this issue 6 years ago • 1 comments

Tried running the example in windows 10 and 7 and it threw the following error

INFO:ldap_test:Starting the JavaGateway on python_proxy_port 25334
'exec' is not recognized as an internal or external command,
operable program or batch file.

As a workaround, I had to edit run_jvm_server in ldap_test\server.py

def run_jvm_server(gateway_port=DEFAULT_GATEWAY_PORT):
    if not os.path.isfile(JVM_SERVER_BIN):
        raise Exception("%s is missing!" % (JVM_SERVER_BIN,))

    jre_executable = find_executable("java")

    if jre_executable is None:
        raise Exception("'java' executable not found in system path!")

    try:
        cmd='java -jar "{}" --port {}'.format(JVM_SERVER_BIN, gateway_port)
        return subprocess.Popen(cmd, shell=True)
    except OSError as e:
        log.error("Failed to run JVM server because: %s" % (e,))
        raise

whatalokation avatar Aug 16 '18 16:08 whatalokation

I hit the same problem, thanks for the workaround !

vbo75 avatar Nov 04 '20 11:11 vbo75