J2ME IOError in socket::open = 11004



我正在为一项任务开发一个小型J2ME应用程序,每当我尝试连接到任何网站时,我都会得到IOError in socket::open = 11004

示例代码:
/* I am using a local XML server, but the error I get is similar to when
connecting to the url below. */
conn = (HttpConnection)Connector.open("http://svn.apache.org/repos/asf/lucene/dev/trunk/solr/example/solr/collection1/conf/solrconfig.xml");
if(conn.getResponseCode() == HttpConnection.HTTP_OK) { // The error is here
  // Some code
}

编辑:我使用Oracle模拟器。

oracle模拟器意味着Java ME平台SDK?我用的是3.0版,你的代码在上面很有魅力

尝试向应用程序描述符- JAD文件添加以下权限:

javax.microedition.io.Connector.http

中阅读更多关于http://docs.oracle.com/javame/config/cldc/ref-impl/midp2.0/jsr118/javax/microedition/io/package-summary.html的信息

最新更新