Android FileNotFoundException getting thrown from URL.openStream()
Asked Answered
L

0

6

I have an application that is connecting to a webservice. I have one user with an LG Optimus T that is getting a FileNotFoundException whenever the app tries to connect to the web service on his device. I know that the device is connected to the internet because he sent me some of the log output of this happening, and I can see that my application has successfully connected to other webservices. I went to a local T mobile store and tested my application on both 3g and wifi and it is working fine for me (The user is only on wifi btw, he does not have access to 3g) Has anyone else had an issue with the URL.openStream() call throwing FileNotFound even though the url is valid and the device is connected to the internet? If so how did you resolve it?

Loganiaceous answered 24/3, 2011 at 13:7 Comment(6)
may be he's working through proxy or firewall which block the ip?Buhler
@Tim is the webservice under your control? Most times I've seen URL.openStream() throw a FileNotFoundException it has been down to a server side issue. If you do run the server, check your logs for the times the user has reported the error.Orpah
@Orpah Unfortunately no, its Amazons price lookup server. @Vladimir he has told me that he doesn't think his phone has DroidWall or any other firewall type app on it. So is it possible that could be something installed on the network? And if so is it conceivable that it could be blocking my calls to amazon web service, but not the ones that are going to a different web service?Loganiaceous
@Tim, it could be the server is not responding correctly to the request. I know that trying to query google from code used to fail with some user agents, as google actively prevented some automatic queries based on user-agent. It could be that amazon are doing something similar? Do you explicitly set a user-agent when you perform your webservice request?Orpah
@dave I don't think I am setting that. I am using the SignedRequestHelper that amazon provides to build my request url. And it works fine for me from the same type of device (albeit on a different network) Is it possible that this could create an issue for just a specific network?Loganiaceous
@Tim it is sounding more likely to be the network, though I'm unsure how to test for that.Orpah

© 2022 - 2024 — McMap. All rights reserved.