Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Developer
Posts: 152
Registered: ‎07-17-2009
My Device: Not Specified

java.io.IOException: Bad DNS address - in opening a HttpConnection

[ Edited ]

Hi,

 

I m opening a HttpConnection to a URL. Its working in simulator but when i try it in device, it gives "java.io.IOException: Bad DNS address" while opening the HttpConnection. I serached the forums but havent got the solution yet.

 

That URL is opening in Blackberry device Internet Browser but not getting the HttpConnection (HttpConnection is coming NULL) when i try through my code.

Developer
Posts: 905
Registered: ‎02-07-2009
My Device: BlackBerry Torch 9800
My Carrier: Globe Telecom

Re: java.io.IOException: Bad DNS address - in opening a HttpConnection

I also experienced this when trying to connect via wifi for some URLs. can you post some code snippet?

Developer
Posts: 152
Registered: ‎07-17-2009
My Device: Not Specified

Re: java.io.IOException: Bad DNS address - in opening a HttpConnection

[ Edited ]

Have u got the solution for it?

 

I tried by entering the IP address instead of url (for eg. instead of www.google.com I had entered IP address) & its working for it without making any change in code.

 

I made one more change. in Options->Security Options->TLS-> Allow HTPS Redirections : Yes

Developer
Posts: 159
Registered: ‎08-19-2008
My Device: Not Specified

Re: java.io.IOException: Bad DNS address - in opening a HttpConnection

On which device u r facing this issue & which connection mode u r using ?.................Which carrier this issue is coming..........?.................Are you able to open the url other than device BIS browser ?..............Please refer to this post

 

http://supportforums.blackberry.com/t5/Java-Development/Connecting-your-BlackBerry-http-and-socket-c...

 

 

Highlighted
Developer
Posts: 152
Registered: ‎07-17-2009
My Device: Not Specified

Re: java.io.IOException: Bad DNS address - in opening a HttpConnection

Thx. I ll refer to this url. I m using Blackberry Curve 8520, Pearl 8800 & carrier is Vodafone. i m opening the connection using POST method

 

& other than device BIS browser means? I accessed using device Internet browser only.