Reputation: 71
Here is the context, a java project running on eclipse on my host. Virtual Box is installed on this host and run a vm which is a private bitcoin node.
The java appli is trying to connect to the bitcoin node using parameters like :
port=18444 ip=..***.58 rpcuser=bitcoinrpc rpcpassword=MotDePasse blockchain=bitcoin chainname=regtest
If I try a telnet connect from my host to the bitcoin node ip on port 184444 it works.
netstat command on the bitcoin node is giving the follwing :
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.0.1:18443 0.0.0.0:* LISTEN 1154/bitcoind
tcp 0 0 0.0.0.0:18444 0.0.0.0:* LISTEN 1154/bitcoind
tcp 0 0 127.0.0.53:53 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN -
tcp 0 576 ...:22 ...:38772 ESTABLISHED -
tcp6 0 0 ::1:18443 :::* LISTEN 1154/bitcoind
tcp6 0 0 :::18444 :::* LISTEN 1154/bitcoind
tcp6 0 0 :::22 :::* LISTEN -
Java error from console :
eb 27, 2019 4:58:40 PM org.apache.http.impl.client.DefaultRequestDirector execute INFO: Retrying request The target server failed to respond org.apache.http.NoHttpResponseException: The target server failed to respond
Any idea ??
Thanks
Upvotes: 0
Views: 355
Reputation: 7
Regarding the informations you provide in 1th and 2th posts, I'll tried to provide you some technicals informations that I hope, you will able to find a issue for this troubleshooting.
First you use RPC protocol (Remote Procedure Call)
Technical view of RPC
This protocol provides a mechanism that allows a client (eg, program) to request the server to perform a specific procedure that is provided to it by the parameters sent by the client.
RPC is a request-reponse protocol.
Since you are trying to authenticate, you must to know :
For client-to-server authentication, RPC only defines authentication in itself and not an access control of a service. Each service must implement its own access policy. There is different form of authenfication that can be associated with RPC clients.
Java Remote Method Invocation (Java RMI) is API that provide some usefull method and implementation for RPC protocol.
Check a complete tuto HERE
In conclusion:
Your problem is that you are trying to communicate with a RPC protocol using the Http protocol which does not provide the same implementations procedures. Since Telnet supports communications with the RPC protocol, you get the expected answers.
You should implement some classes in your code in both side for support RPC communication.
Upvotes: -1