测试mina的承受能力时抛出错误:Could not initialize class.sun.nio.ch.FileDispatcher

125 views
Skip to first unread message

gon...@qq.com

unread,
Oct 10, 2010, 10:47:40 PM10/10/10
to Apache Mina高性能通信框架研究邮件列表
大家好,
我是一个刚接触mina的新手,我使用的版本是1.1.7
我在测试mina的承受能力时,客户端的定义如下:
for(int i=0;i<size;i++) {
new Thread(new Runnable () {
..... // code is same as Client.java
}
}.start();

}
当size为100时,mina能正常工作,但是改为200时,则抛出如下错误
Exception in thread "Thread-420" java.lang.NoClassDefFoundError: Could
not initialize class sun.nio.ch.FileDispatcher
at sun.nio.ch.SocketDispatcher.preClose(SocketDispatcher.java:
41)
at
sun.nio.ch.SocketChannelImpl.implCloseSelectableChannel(SocketChannelImpl.java:
684)
at
java.nio.channels.spi.AbstractSelectableChannel.implCloseChannel(AbstractSelectableChannel.java:
201)
at
java.nio.channels.spi.AbstractInterruptibleChannel.close(AbstractInterruptibleChannel.java:
97)
at
org.apache.mina.transport.socket.nio.SocketConnector.processSessions(SocketConnector.java:
304)
at org.apache.mina.transport.socket.nio.SocketConnector.access
$800(SocketConnector.java:53)
at org.apache.mina.transport.socket.nio.SocketConnector
$Worker.run(SocketConnector.java:383)
at
org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:
51)
at java.lang.Thread.run(Thread.java:619)

请各位大侠帮帮忙。到底是什么出问题了...
另外请问测试mina性能的时候这样写代码对吗?
Reply all
Reply to author
Forward
0 new messages