I have created an application using py4j that makes it possible to save data from python in to SQL database using a java application,everything works so fine when i run the JVM as an application and it actually saves the data. But when i run the code in a server it gives me back an exception.Therfore i thought maybe my server(Wildfly) and Py4j are using the same port so i changed the default py4j port as the turotial suggested and this is how the python sides looks like after modification:
from py4j.java_gateway import JavaGateway, GatewayParameters
gateway = JavaGateway(GatewayParameters(port=25335))
testBD = gateway.entry_point
DBin = gateway.jvm.com.packtpub.wflydevelopment.ch.Application(10,3) #calling constructor
testBD.create(DBin)
but i m still having an exception:
Traceback (most recent call last):
File "C:\Users\user\Desktop\test.py", line 4, in
DBin = gateway.jvm.com.packtpub.wflydevelopment.ch.Application(10,3)
File "C:\Users\user\AppData\Local\Programs\Python\Python35-32\lib\site-packages\py4j-0.9-py3.5.egg\py4j\java_gateway.py", line 1185, in getattr
answer = self._gateway_client.send_command(
AttributeError: 'GatewayParameters' object has no attribute 'send_command'
Any suggestions would be very much appreciated.