簡體   English   中英

套接字:: open = 11004中的J2ME IOError

[英]J2ME IOError in socket::open = 11004

我正在為任務分配開發一個小型J2ME應用程序,每當我嘗試連接到任何網站時, IOError in socket::open = 11004都會出現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上了解更多信息

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM