[J2MEQ&A]WTK初始化WMAClient报错XXX has no IP address的解释

 

[J2ME]WTK初始化WMAClient报错XXX has no IP address的解释

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

 

[现象]

当通过WTK运行一个J2ME程序时,KToolbar显示这样的错误:

错误形态一

WMAClient: localhost has no IP address: java.net.UnknownHostException: xxxx: xxxx
Warning: Failed to initialize WMA message routing support
ClientConnector: localhost has no IP address: java.net.UnknownHostException: xxxx: xxxx
Warning: Failed to initialize Bluetooth (JSR 82) support

(xxxx指的是机器名字)

或者看到

错误形态二

Running with storage root DefaultColorPhone
WMAClient: localhost has no IP address: java.net.UnknownHostException:
梅花
Warning: Failed to initialize WMA message routing support
ClientConnector: localhost has no IP address: java.net.UnknownHostException:
梅花

 

[原因]

如果你第一次运行WTK之后,就改变了本机的IP地址,那么可能会导致WTK误认为你没有IP地址。或者你需要检查是否有网卡。

  

或者检查你的机器名,不能为中文。

[解决]

把你的IP地址改回第一次运行WTK时的那个。

或装一个网卡。

  

或将机器名改为英文名称。

[详细解释]

可能WTK初始化WMAClientClientConnector时,必须先运行InetAddress.getLocalHost()来寻找localhostIP地址。

但是你看

http://www.vf.utwente.nl/~vriesajk/j2me/java/net/InetAddress.html#getLocalHost()

它说了

Throws:

UnknownHostException - if no IP address for the host could be found.

所以,如果它没有能够找到IP地址的话,它就报告localhost has no IP address

转载于:https://www.cnblogs.com/zhengyun_ustc/archive/2006/03/02/localhost_has_no_IP_address.html

  • 0
    点赞
  • 0
    评论
  • 0
    收藏
  • 扫一扫,分享海报

表情包
插入表情
评论将由博主筛选后显示,对所有人可见 | 还能输入1000个字符
©️2022 CSDN 皮肤主题:编程工作室 设计师:CSDN官方博客 返回首页
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、C币套餐、付费专栏及课程。

余额充值