06-25-2009 04:42 AM
A seemingly benign URLEncodedPostData.toString() call is throwing a java.lang.illegalstateexception error at the final line in the following code extract, though only sometimes:
URLEncodedPostData urlPost = new URLEncodedPostData(URLEncodedPostData.DEFAULT_CHAR
String networkName = getNetworkName();
networkName = "none";
urlPost.append("mins", new Integer((int)(getOptions().getTotalOutboundCallDur
urlPost.append("reason", originalReason + "/" + _reason);
String appendThis = urlPost.toString();// sometimes throws java.lang.illegalstateexception error
I have around 25 devices running this code though only two exhibit this behaviour (and then, only sometimes). The two affected devices are both Bolds and both are on BES (different BES accounts/customers) on different UK mobile networks. One is running 184.108.40.206, the other 220.127.116.11 (note: 162 not 126!).
The API documentation doesn't even show that a java.lang.illegalstateexception is possible with a URLEncodedPostData.toString() call. As the problem is intermittent and does not present on the majority of devices, is this perhaps an example of a bug in the 18.104.22.168 and 22.214.171.124 APIs which only occurs in certain "states"?
With my thanks in advance to anyone who can contribute to resolving this.
06-25-2009 07:13 AM
06-25-2009 08:07 AM
I'm not aware that I've "fiddled" with event thread. Bear in mind that this problem is intermittent yet - so far as I know - I never fiddle with the event thread in my application. I confess to not knowing what "fiddling" might be though I certainly don't use setText anywhere in my code since you ask about that specifically.
Sadly, I can't debug on the live device as it belongs to a client/user, not me.
And forgive me if this question's dumb, but how do I get the "detail message" on the exception? I suspect you're alluding to e.getMessage() (where e is the exception) which I haven't tried as it happens and will now. FYI, e.toString() is returning java.lang.illegalStateException as I think you will have gathered from my original description of the problem.
06-25-2009 08:20 AM
06-25-2009 08:34 AM
Thanks again, Simon.
Well I'm definitely not trying to modify the event thread in any way so I think that can be ruled out.
The offending line of code is already in a try/catch block which is how I know which line is the culprit. I didn't include that detail in the code sample so you wouldn't have known that, of course.
Are you suggesting using the event log as a means of enabling the user to report to me what's going on? I ask because the device already automatically sends error reports (such as this one) to my server over the web which is how I know about the illegalStateException as it is. Or is there some other benefit from using the event logger that I'm missing?
And once again, would you please confirm what you mean by "detail message" - is it e.getMessage() as I suspect?
06-25-2009 08:48 AM