Results 1 to 4 of 4
  1. #1
    luoluo is offline Member
    Join Date
    Apr 2010
    Posts
    12
    Rep Power
    0

    Default java.nio.channels.cancelledkeyexception

    Hi everyone,

    I use java to connect memecached, I have encountered a problem for

    2012-06-27 09:03:03 [net.rubyeye.xmemcached.impl.MemcachedHandler]-[ERROR] XMemcached network layout exception
    java.nio.channels.CancelledKeyException
    at sun.nio.ch.SelectionKeyImpl.ensureValid(SelectionK eyImpl.java:55)
    at sun.nio.ch.SelectionKeyImpl.readyOps(SelectionKeyI mpl.java:69)
    at com.google.code.yanf4j.nio.impl.Reactor.dispatchEv ent(Reactor.java:300)
    at com.google.code.yanf4j.nio.impl.Reactor.run(Reacto r.java:140)

    I searched it in google, but no suggestion to do it.
    My code:
    Java Code:
          try{
      	MemcachedClientBuilder builder = new XMemcachedClientBuilder(AddrUtil.getAddresses("127.0.0.1"));
    		MemcachedClient mcc = null;
    		try {
    			mcc = builder.build();
    			mcc.setConnectTimeout(10 * 1000);
    			mcc.setOpTimeout(10 * 1000);		
    		} catch (IOException e) {
    			logger.error("Connect memcache to error", e);
    		}
           	mcc.set("key", 0, mapClient);
            }finally{
              if(mcc != null){
    					mcc.shutdown();
    				} 
           }
    please help me?

  2. #2
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,446
    Rep Power
    25

    Default Re: java.nio.channels.cancelledkeyexception

    What line of code in your class caused the exception?
    What is the name of your class? Does the stack trace refer to lines in your class?
    If you don't understand my response, don't ignore it, ask a question.

  3. #3
    luoluo is offline Member
    Join Date
    Apr 2010
    Posts
    12
    Rep Power
    0

    Default Re: java.nio.channels.cancelledkeyexception

    No exception for my class,My class name:SynMemFeedback

    2012-06-27 09:03:03 [net.rubyeye.xmemcached.impl.MemcachedHandler]-[ERROR] XMemcached network layout exception
    java.nio.channels.CancelledKeyException
    at sun.nio.ch.SelectionKeyImpl.ensureValid(SelectionK eyImpl.java:55)
    at sun.nio.ch.SelectionKeyImpl.readyOps(SelectionKeyI mpl.java:69)
    at com.google.code.yanf4j.nio.impl.Reactor.dispatchEv ent(Reactor.java:300)
    at com.google.code.yanf4j.nio.impl.Reactor.run(Reacto r.java:140)
    2012-06-27 09:03:03 [remoting]-[ERROR] Reactor dispatch events error
    java.nio.channels.CancelledKeyException
    at sun.nio.ch.SelectionKeyImpl.ensureValid(SelectionK eyImpl.java:55)
    at sun.nio.ch.SelectionKeyImpl.readyOps(SelectionKeyI mpl.java:69)
    at com.google.code.yanf4j.nio.impl.Reactor.dispatchEv ent(Reactor.java:300)
    at com.google.code.yanf4j.nio.impl.Reactor.run(Reacto r.java:140)
    2012-06-27 09:03:03 [com.google.code.yanf4j.core.impl.AbstractControlle r]-[WARN] add session: /127.0.0.1:11213
    2012-06-27 09:03:03 [com.google.code.yanf4j.core.impl.AbstractControlle r]-[WARN] remove session /127.0.0.1:11213
    2012-06-27 09:03:03 [com.google.code.yanf4j.core.impl.AbstractControlle r]-[INFO] Controller has been stopped.
    2012-06-27 09:03:03 [com.ctfo.syn.oracle2memcache.SynMemFeedback]-[INFO]300 S
    2012-06-27 09:03:03 [net.rubyeye.xmemcached.impl.MemcachedHandler]-[ERROR] XMemcached network layout exception
    java.nio.channels.CancelledKeyException
    at sun.nio.ch.SelectionKeyImpl.ensureValid(SelectionK eyImpl.java:55)
    at sun.nio.ch.SelectionKeyImpl.readyOps(SelectionKeyI mpl.java:69)
    at com.google.code.yanf4j.nio.impl.Reactor.dispatchEv ent(Reactor.java:300)
    at com.google.code.yanf4j.nio.impl.Reactor.run(Reacto r.java:140)
    2012-06-27 09:03:03 [remoting]-[ERROR] Reactor dispatch events error
    java.nio.channels.CancelledKeyException
    at sun.nio.ch.SelectionKeyImpl.ensureValid(SelectionK eyImpl.java:55)
    at sun.nio.ch.SelectionKeyImpl.readyOps(SelectionKeyI mpl.java:69)
    at com.google.code.yanf4j.nio.impl.Reactor.dispatchEv ent(Reactor.java:300)
    at com.google.code.yanf4j.nio.impl.Reactor.run(Reacto r.java:140)
    2012-06-27 09:03:03 [com.google.code.yanf4j.core.impl.AbstractControlle r]-[WARN] add session: /127.0.0.1:11213
    2012-06-27 09:03:03 [com.ctfo.syn.kcpt.httservice.HttpSynServiceTask]-[INFO] 3.
    2012-06-27 09:03:03 [com.google.code.yanf4j.core.impl.AbstractControlle r]-[WARN] remove session /127.0.0.1:11213
    2012-06-27 09:03:03 [com.google.code.yanf4j.core.impl.AbstractControlle r]-[INFO] Controller has been stopped.
    2012-06-27 09:03:03 [net.rubyeye.xmemcached.XMemcachedClient]-[WARN] XMemcachedClient use Text protocol
    2012-06-27 09:03:03 [com.google.code.yanf4j.nio.impl.SelectorManager]-[INFO] Creating 1 rectors...
    2012-06-27 09:03:03 [com.google.code.yanf4j.core.impl.AbstractControlle r]-[WARN] remove session /127.0.0.1:11213
    2012-06-27 09:03:03 [com.google.code.yanf4j.core.impl.AbstractControlle r]-[WARN] remove session /127.0.0.1:11213
    2012-06-27 09:03:03 [com.google.code.yanf4j.core.impl.AbstractControlle r]-[WARN] The Controller started at localhost/127.0.0.1:0 ...
    2012-06-27 09:03:03 [com.google.code.yanf4j.core.impl.AbstractControlle r]-[INFO] Controller has been stopped.
    2012-06-27 09:03:03 [com.ctfo.syn.kcpt.httservice.JdbcManager]-[INFO] -------------------Dis connection is success!--------------------
    2012-06-27 09:03:03 [com.google.code.yanf4j.core.impl.AbstractControlle r]-[WARN] add session: /127.0.0.1:11213
    2012-06-27 09:03:03 [net.rubyeye.xmemcached.impl.MemcachedHandler]-[ERROR] XMemcached network layout exception
    java.nio.channels.CancelledKeyException
    at sun.nio.ch.SelectionKeyImpl.ensureValid(SelectionK eyImpl.java:55)
    at sun.nio.ch.SelectionKeyImpl.readyOps(SelectionKeyI mpl.java:69)
    at com.google.code.yanf4j.nio.impl.Reactor.dispatchEv ent(Reactor.java:300)
    at com.google.code.yanf4j.nio.impl.Reactor.run(Reacto r.java:140)
    2012-06-27 09:03:03 [remoting]-[ERROR] Reactor dispatch events error
    java.nio.channels.CancelledKeyException
    at sun.nio.ch.SelectionKeyImpl.ensureValid(SelectionK eyImpl.java:55)
    at sun.nio.ch.SelectionKeyImpl.readyOps(SelectionKeyI mpl.java:69)
    at com.google.code.yanf4j.nio.impl.Reactor.dispatchEv ent(Reactor.java:300)
    at com.google.code.yanf4j.nio.impl.Reactor.run(Reacto r.java:140)
    2012-06-27 09:03:03 [com.google.code.yanf4j.core.impl.AbstractControlle r]-[WARN] remove session /127.0.0.1:11213
    2012-06-27 09:03:03 [com.google.code.yanf4j.core.impl.AbstractControlle r]-[INFO] Controller has been stopped.
    2012-06-27 09:03:03 [net.rubyeye.xmemcached.XMemcachedClient]-[WARN] XMemcachedClient use Text protocol
    2012-06-27 09:03:03 [com.google.code.yanf4j.nio.impl.SelectorManager]-[INFO] Creating 1 rectors...
    2012-06-27 09:03:03 [com.google.code.yanf4j.core.impl.AbstractControlle r]-[WARN] The Controller started at localhost/127.0.0.1:0 ...
    2012-06-27 09:03:03 [net.rubyeye.xmemcached.impl.MemcachedHandler]-[ERROR] XMemcached network layout exception
    java.nio.channels.CancelledKeyException
    at sun.nio.ch.SelectionKeyImpl.ensureValid(SelectionK eyImpl.java:55)
    at sun.nio.ch.SelectionKeyImpl.readyOps(SelectionKeyI mpl.java:69)
    at com.google.code.yanf4j.nio.impl.Reactor.dispatchEv ent(Reactor.java:300)
    at com.google.code.yanf4j.nio.impl.Reactor.run(Reacto r.java:140)
    2012-06-27 09:03:03 [remoting]-[ERROR] Reactor dispatch events error
    java.nio.channels.CancelledKeyException
    at sun.nio.ch.SelectionKeyImpl.ensureValid(SelectionK eyImpl.java:55)
    at sun.nio.ch.SelectionKeyImpl.readyOps(SelectionKeyI mpl.java:69)
    at com.google.code.yanf4j.nio.impl.Reactor.dispatchEv ent(Reactor.java:300)
    at com.google.code.yanf4j.nio.impl.Reactor.run(Reacto r.java:140)
    2012-06-27 09:03:03 [com.google.code.yanf4j.core.impl.AbstractControlle r]-[WARN] add session: /127.0.0.1:11213
    2012-06-27 09:03:03 [com.google.code.yanf4j.core.impl.AbstractControlle r]-[WARN] remove session /127.0.0.1:11213
    2012-06-27 09:03:03 [com.google.code.yanf4j.core.impl.AbstractControlle r]-[INFO] Controller has been stopped.
    2012-06-27 09:03:03 [net.rubyeye.xmemcached.XMemcachedClient]-[WARN] XMemcachedClient use Text protocol
    2012-06-27 09:03:03 [com.google.code.yanf4j.nio.impl.SelectorManager]-[INFO] Creating 1 rectors...
    2012-06-27 09:03:03 [com.google.code.yanf4j.core.impl.AbstractControlle r]-[WARN] The Controller started at localhost/127.0.0.1:0 ...
    2012-06-27 09:03:03 [com.google.code.yanf4j.core.impl.AbstractControlle r]-[WARN] add session: /127.0.0.1:11213
    2012-06-27 09:03:03 [com.google.code.yanf4j.core.impl.AbstractControlle r]-[WARN] remove session /127.0.0.1:11213
    2012-06-27 09:03:03 [com.google.code.yanf4j.core.impl.AbstractControlle r]-[INFO] Controller has been stopped.
    2012-06-27 09:03:03 [com.ctfo.syn.oracle2memcache.SynMemVehicleSta]-[INFO] 45 S
    2012-06-27 09:03:03 [net.rubyeye.xmemcached.impl.MemcachedHandler]-[ERROR] XMemcached network layout exception
    java.nio.channels.CancelledKeyException
    at sun.nio.ch.SelectionKeyImpl.ensureValid(SelectionK eyImpl.java:55)
    at sun.nio.ch.SelectionKeyImpl.readyOps(SelectionKeyI mpl.java:69)
    at com.google.code.yanf4j.nio.impl.Reactor.dispatchEv ent(Reactor.java:300)
    at com.google.code.yanf4j.nio.impl.Reactor.run(Reacto r.java:140)
    2012-06-27 09:03:03 [remoting]-[ERROR] Reactor dispatch events error
    java.nio.channels.CancelledKeyException
    at sun.nio.ch.SelectionKeyImpl.ensureValid(SelectionK eyImpl.java:55)
    at sun.nio.ch.SelectionKeyImpl.readyOps(SelectionKeyI mpl.java:69)
    at com.google.code.yanf4j.nio.impl.Reactor.dispatchEv ent(Reactor.java:300)
    at com.google.code.yanf4j.nio.impl.Reactor.run(Reacto r.java:140)
    2012-06-27 09:03:03 [com.google.code.yanf4j.core.impl.AbstractControlle r]-[WARN] remove session /127.0.0.1:11213

  4. #4
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,014
    Rep Power
    20

    Default Re: java.nio.channels.cancelledkeyexception

    And which line in your code is mentioned in those stack traces?
    We cannot see your monitor from here...
    Please do not ask for code as refusal often offends.

    ** This space for rent **

Similar Threads

  1. Replies: 2
    Last Post: 07-26-2011, 04:53 PM
  2. SWT ImageData -- How to obtain number of channels
    By jiapei100 in forum SWT / JFace
    Replies: 0
    Last Post: 04-17-2010, 09:22 AM
  3. Watch TV on PC - 12,000 TV Channels and Movies, save money Get $10 rebate.
    By arturmoniswork in forum Reviews / Advertising
    Replies: 0
    Last Post: 12-30-2008, 05:56 AM
  4. Reading Web Pages with Nonblocking Channels
    By Java Tip in forum java.net
    Replies: 0
    Last Post: 04-07-2008, 08:01 PM
  5. Reading Web Pages with Socket Channels
    By Java Tip in forum java.net
    Replies: 0
    Last Post: 04-07-2008, 08:00 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •