# CancelledKeyException

**URL:** <https://www.ruby-forum.com/t/cancelledkeyexception/228940>\
**Category:** JRuby\
**Created:** [May 13, 2013, 8:25pm UTC](https://www.ruby-forum.com/t/cancelledkeyexception/228940 "2013-05-13T20:25:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![islepilot](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/ac8455/32.png) [@islepilot](https://www.ruby-forum.com/u/islepilot)\
**Post date:** [May 13, 2013, 8:25pm UTC](https://www.ruby-forum.com/t/cancelledkeyexception/228940/1 "2013-05-13T20:25:08Z")

</div>

Hi, all. I’m writing a JRuby gem that wraps a Java library that does  
some  
networking stuff. When I run rspec, after the tests all pass and I get  
the  
success output, I see the exception output I pasted into  
[Output of JRuby RSpec test, after tests all pass. I'm calling a networking library during the tests, but don't know if that is connected with this problem. · GitHub](https://gist.github.com/keithrbennett/5570290).

Anyone know what’s up with this?

Also, it says “RubyThread-14”. I’m only running in 1 thread. The Java  
library may be creating additional threads – would they be named  
“RubyThread”?

Thanks,  
Keith

---

<div class="post-metadata">

**Author:** ![islepilot](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/ac8455/32.png) [@islepilot](https://www.ruby-forum.com/u/islepilot)\
**Post date:** [June 3, 2013, 8:56am UTC](https://www.ruby-forum.com/t/cancelledkeyexception/228940/2 "2013-06-03T08:56:05Z")

</div>

looks like you’re using the “logging” gem and have some kind of  
networked  
log appender which is raising the error (it’s a java error because jruby  
is  
using the java libraries for implementing the IO and friends). the extra  
ruby thread was probably created by the appender, and either the  
appender  
doesn’t clean up after itself, or the shutdown causes a situation which  
the  
appender didn’t expect.

T#
