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

java.lang.StringIndexOfBoundsException: String index out of range: 2 thrown by Connector.open()

by Retired ‎02-16-2010 11:32 AM - edited ‎09-16-2010 02:31 PM (1,310 Views)



This article applies to the following:

  • BlackBerry® Device Software 4.3






Opening a port on the BlackBerry smartphone to listen for incoming connections may throw the following exception:


    java.lang.StringIndexOfBoundsException: String index out of range: 2


The following are examples of calls to Connector.open(String url):






The BlackBerry smartphone firewall check is failing because it is trying to check the hostname, which does not exist in such URLs.



To work around this issue, change the application permission for Connections to Allow so that the firewall does not attempt to check the hostname. Application permissions can be set in one of the following ways:

  • Programmatically — For more information see this article
  • By setting Application Control Policy — Refer to this article for more information

This issue was resolved in BlackBerry Device Software 4.5 and later.





Users Online
Currently online: 36 members 2,130 guests
Please welcome our newest community members: