My droplet has debian os. I have a java application running which tries to exchange data with remote similar applications. This data exchange has previously worked across remote environments where each node has been a...
It sounds like that your Java app is binding to 127.0.0.1:4000 rather than 0.0.0.0:4000 so that's why you can only access it locally from the server itself.
To check if this is true you can run:
DigitalOcean Cloud Firewalls