Hello,
I am trying to get py4j working and am getting the error "py4j.Py4JException: Method testConnection([]) does not exist" when I try to call a simple test function. Interestingly I can call "gateway.entry_point.getClass().getName()" and it will tell me the correct class name. I can also call "gateway.entry_point.getClass().getDeclaredMethods()" and I can see that the method does exist. But when I try to call the method using "ateway.entry_point.testConnection()" I get the "does not exist" error.
This is using version 0.10.9.7 and I have tried it on two different computers, one Mac and one Windows.
My test code and the full error is below. Any idea why this is happening?
Thanks
Cameron
Here is the main class:
package org.testPy4J;
import py4j.GatewayServer;
public class testPy4J {
public static void main(String[] args) {
GatewayServer gatewayServer = new GatewayServer(new testGateway());
gatewayServer.start();
System.out.println("Gateway Server Started");
}
}
Here is the test gateway class:
package org.testPy4J;
public class testGateway {
public void testConnection() {
System.out.println("Connection Works");
}
}
Here is the python I am executing and the error: