Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zookeeper logger throws exception on Windows/JRuby #16

Closed
CootCraig opened this issue May 3, 2012 · 7 comments
Closed

Zookeeper logger throws exception on Windows/JRuby #16

CootCraig opened this issue May 3, 2012 · 7 comments
Assignees

Comments

@CootCraig
Copy link

I don't know if there is a way to set the logger, but with JRuby on windows I get an exception the following Logger.new:

lib\ruby\gems\1.8\gems\slyphon-zookeeper-0.9.2-java\lib\zookeeper.rb
class Zookeeper < ZookeeperBase
unless defined?(@@logger)
@@logger = Logger.new('/dev/null').tap { |l| l.level = Logger::FATAL } # UNIX: FOR GREAT JUSTICE !!
end

$ jruby -v
jruby 1.6.7 (ruby-1.9.2-p312) (2012-02-22 3e82bc8) (Java HotSpot(TM) Client VM 1.6.0_31) [Windows Server 2008 R2-x86-java]

Exception outpout:

Errno::ENOENT: No such file or directory - c:/dev/null
initialize at org/jruby/RubyFile.java:465
open at org/jruby/RubyIO.java:1135
open at org/jruby/RubyKernel.java:287
open at org/jruby/RubyKernel.java:297
create_logfile at c:/jruby/jruby-1.6.7/lib/ruby/1.9/logger.rb:549
open_logfile at c:/jruby/jruby-1.6.7/lib/ruby/1.9/logger.rb:544
initialize at c:/jruby/jruby-1.6.7/lib/ruby/1.9/logger.rb:499
initialize at c:/jruby/jruby-1.6.7/lib/ruby/1.9/logger.rb:275
Zookeeper at c:/jruby/jruby-1.6.7/lib/ruby/gems/1.8/gems/slyphon-zookeepe
r-0.9.2-java/lib/zookeeper.rb:26
(root) at c:/jruby/jruby-1.6.7/lib/ruby/gems/1.8/gems/slyphon-zookeepe
r-0.9.2-java/lib/zookeeper.rb:24
require at org/jruby/RubyKernel.java:1042
(root) at c:/jruby/jruby-1.6.7/lib/ruby/gems/1.8/gems/slyphon-zookeepe
r-0.9.2-java/lib/zookeeper.rb:7

@slyphon
Copy link
Contributor

slyphon commented May 3, 2012

D'oh, i knew this day would come. I do zero windows testing, so YMMV. I'll fix this to use stderr instead and push a new build.

@ghost ghost assigned slyphon May 3, 2012
@slyphon
Copy link
Contributor

slyphon commented May 3, 2012

BTW, if you are using zookeeper for application development, you might want to look at ZK which is a higher-level wrapper around this library, and provides a much nicer API for registering for events, cluster-wide locks, and so forth.

@CootCraig
Copy link
Author

I will be looking at ZK for coding. This was instigated by my first attempt at DCell, had no idea what dependencies would be pulled in :-) Thanks for the quick response.

@slyphon
Copy link
Contributor

slyphon commented May 3, 2012

Hey, I've pushed a release of zookeeper-0.9.3 which ZK won't see. I'll push a slyphon-zookeeper-0.9.3 so ZK will pick up on it, and in the 1.2.0 release of ZK we'll use the zookeeper gem.

It's a little confusing, as twitter just gave me this repo, but we should have it all worked out soon :)

@slyphon
Copy link
Contributor

slyphon commented May 3, 2012

ok, pushed

Have a look and let me know if that fixes it for you :)

@CootCraig
Copy link
Author

Sorry I haven't tried this out yet, busy at home and work. I'm using Jruby,Sinatra,Celluloid and thought I'd be using the DCell extension of Celluloid. Anyway the current task is handled by Ruby/0mq binding support in Celluloid. When the current work project is in delivered I'll try this out. I have plans for using Zookeeper with DCell in the future.

@slyphon
Copy link
Contributor

slyphon commented May 11, 2012

Cool, sounds good :)

@slyphon slyphon closed this as completed May 11, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants