【问题标题】:J2ME IOError in socket::open = 11004套接字中的 J2ME IOError::open = 11004
【发布时间】:2014-05-23 03:00:12
【问题描述】:

我正在为一项任务开发一个小型 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 模拟器。

【问题讨论】:

    标签: java sockets java-me


    【解决方案1】:

    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的信息

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2014-01-23
      • 2018-02-15
      • 2017-02-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多