That looks more like a stack overflow question: https://stackoverflow.com/questions/18838229/java-net-protocolexception-server-redirected-too-many-times-20
Regards,
Ronald
Are you able to try making a REST call from a Call REST action in a microflow to the endpoint you are having trouble with. Does it work then?
If this works, you could refactor your Java action to generate the body content as a String and return this to a calling microflow. You could then pass this String into the Call REST action.
Just an idea, but it may work. Good luck!