默认
发表评论 5
想开发IM:买成品怕坑?租第3方怕贵?找开源自已撸?尽量别走弯路了... 找站长给点建议
[已回复] MobileIMSDK服务端demo 源码 启动 报错
阅读(40985) | 评论(5 收藏 淘帖
源码 MobileIMSDKServerDemo
在eclipse中启动时,报错

Exception in thread "main" org.apache.mina.core.RuntimeIoException: Failed to initialize.
        at org.apache.mina.core.polling.AbstractPollingConnectionlessIoAcceptor.<init>(AbstractPollingConnectionlessIoAcceptor.java:123)
        at org.apache.mina.core.polling.AbstractPollingConnectionlessIoAcceptor.<init>(AbstractPollingConnectionlessIoAcceptor.java:101)
        at org.apache.mina.transport.socket.nio.NioDatagramAcceptor.<init>(NioDatagramAcceptor.java:57)
        at net.openmob.mobileimsdk.server.ServerLauncher.initAcceptor(ServerLauncher.java:91)
        at net.openmob.mobileimsdk.server.ServerLauncher.startup(ServerLauncher.java:71)
        at net.openmob.mobileimsdk.server.demo.ServerLauncherImpl.main(ServerLauncherImpl.java:56)
Caused by: java.io.IOException: Unable to establish loopback connection
        at sun.nio.ch.PipeImpl$Initializer.run(Unknown Source)
        at sun.nio.ch.PipeImpl$Initializer.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at sun.nio.ch.PipeImpl.<init>(Unknown Source)
        at sun.nio.ch.SelectorProviderImpl.openPipe(Unknown Source)
        at java.nio.channels.Pipe.open(Unknown Source)
        at sun.nio.ch.WindowsSelectorImpl.<init>(Unknown Source)
        at sun.nio.ch.WindowsSelectorProvider.openSelector(Unknown Source)
        at java.nio.channels.Selector.open(Unknown Source)
        at org.apache.mina.transport.socket.nio.NioDatagramAcceptor.init(NioDatagramAcceptor.java:69)
        at org.apache.mina.core.polling.AbstractPollingConnectionlessIoAcceptor.<init>(AbstractPollingConnectionlessIoAcceptor.java:114)
        ... 5 more
Caused by: java.net.ConnectException: Connection timed out: connect
        at sun.nio.ch.Net.connect0(Native Method)
        at sun.nio.ch.Net.connect(Unknown Source)
        at sun.nio.ch.Net.connect(Unknown Source)
        at sun.nio.ch.SocketChannelImpl.connect(Unknown Source)
        at java.nio.channels.SocketChannel.open(Unknown Source)
        at sun.nio.ch.PipeImpl$Initializer$LoopbackConnector.run(Unknown Source)
        ... 16 more



at net.openmob.mobileimsdk.server.ServerLauncher.initAcceptor(ServerLauncher.java:91)
是这一句
NioDatagramAcceptor acceptor = new NioDatagramAcceptor();

这是什么问题?

即时通讯网 - 即时通讯开发者社区! 来源: - 即时通讯开发者社区!

标签:MobileIMSDK
上一篇:[已回复] MobileIMSDK 支持哪些协议的封装下一篇:[已回复] 如何正确地理解MobileIMSDK服务器分配的唯一ID?
推荐方案
评论 5
你的错误出的倒是奇怪,你的java版本是多少?
jdk6
装的是 JDK8,eclipse 的 java build path 中 选择的 是jre1.6
Exception in thread "main" org.apache.mina.core.RuntimeIoException: Failed to initialize.
        at org.apache.mina.core.polling.AbstractPollingConnectionlessIoAcceptor.<init>(AbstractPollingConnectionlessIoAcceptor.java:123)
        at org.apache.mina.core.polling.AbstractPollingConnectionlessIoAcceptor.<init>(AbstractPollingConnectionlessIoAcceptor.java:101)
        at org.apache.mina.transport.socket.nio.NioDatagramAcceptor.<init>(NioDatagramAcceptor.java:57)
        at net.openmob.mobileimsdk.server.ServerLauncher.initAcceptor(ServerLauncher.java:91)
        at net.openmob.mobileimsdk.server.ServerLauncher.startup(ServerLauncher.java:71)
        at net.openmob.mobileimsdk.server.demo.ServerLauncherImpl.main(ServerLauncherImpl.java:56)

奇怪 mina的问题?怎么搞?
引用:xuexxd 发表于 2016-09-01 16:55
Exception in thread "main" org.apache.mina.core.RuntimeIoException: Failed to initialize.
        at org.a ...

是的,奇怪的是为何MINA库出错。我建议你云下载MINA官方的demo,看看会不会出错,因为demo简单,出现问题容易找,估计还是跟你的jdk版本或是环境有关。这是MINA2.0.7的下载地址:http://archive.apache.org/dist/mina/2.0.7/
打赏楼主 ×
使用微信打赏! 使用支付宝打赏!

返回顶部