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

Savon fails initialize logging properly while running on jruby on windows when the log option is set to false #2

Closed
rumblinthebronx opened this issue Jan 4, 2013 · 6 comments
Labels

Comments

@rumblinthebronx
Copy link

Errno::ENOENT: No such file or directory - c:/dev/null
    from org/jruby/RubyFile.java:333:in `initialize'
    from org/jruby/RubyIO.java:1179:in `open'
    from org/jruby/RubyKernel.java:333:in `open'
    from C:/jruby-1.7.1/lib/ruby/1.9/open-uri.rb:35:in `open'
    from C:/jruby-1.7.1/lib/ruby/1.9/logger.rb:599:in `create_logfile'
    from C:/jruby-1.7.1/lib/ruby/1.9/logger.rb:594:in `open_logfile'
    from C:/jruby-1.7.1/lib/ruby/1.9/logger.rb:549:in `initialize'
    from C:/jruby-1.7.1/lib/ruby/1.9/logger.rb:314:in `initialize'
    from C:/jruby-1.7.1/lib/ruby/gems/shared/gems/savon-2.0.2/lib/savon/options.rb:147:in `log'
    from C:/jruby-1.7.1/lib/ruby/gems/shared/gems/savon-2.0.2/lib/savon/options.rb:58:in `initialize'
    from C:/jruby-1.7.1/lib/ruby/gems/shared/gems/savon-2.0.2/lib/savon/client.rb:10:in `initialize'
    from C:/jruby-1.7.1/lib/ruby/gems/shared/gems/savon-2.0.2/lib/savon.rb:8:in `client'

#This is the code thats calling it
    def initialize(options={})
      @mutex = Mutex.new
      options[:namespace_identifier] = :n1
      options[:log] = false
      @client = Savon.client(options)
    end
$ ./jruby --version 
jruby 1.7.1 (1.9.3p327) 2012-12-03 30a153b on Java HotSpot(TM) Client VM 1.6.0_1 
1-b03 [Windows Vista-x86] 
@rubiii
Copy link
Owner

rubiii commented Jan 4, 2013

thanks for reporting. please post the output of RUBY_PLATFORM on your system.

you should be able to work around this problem by creating a custom logger which logs to
the "windows-version" of /dev/null. i think.

null_logger = Logger.new("NUL:")
Savon.client(logger: null_logger)

related: savonrb/savon#353

@rumblinthebronx
Copy link
Author

irb(main):006:0> RUBY_PLATFORM
"java"

@rubiii
Copy link
Owner

rubiii commented Jan 6, 2013

thanks. definitely my mistake, but i learned something new and maybe others can learn from this as well.
please read: http://www.ruby-forum.com/topic/150942

this will be fixed with the next release.

@rubiii
Copy link
Owner

rubiii commented Jan 6, 2013

@rumblinthebronx i just pushed a fix to master. could you please let me know whether this works for you?

@rumblinthebronx
Copy link
Author

Yeah it works now all good.

@rubiii
Copy link
Owner

rubiii commented Jan 7, 2013

great. expect this to be fixed with the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants