Hi Samir,
to narrow down the issue. Place a simple image in the root of server hosting your java app. Now try accessing the image from Amazon server, if you are able to access/view the image on Amazon server then you can eliminate accessibility issue. Also if you are making cross domain request, then before going into CORS I would suggest you try a making request using esri.request with useProxy flag true. This will take care of cross domain issue.
Once this is resolved you can move on to CORS.
I hope this helps.
Rahul