warbler icon indicating copy to clipboard operation
warbler copied to clipboard

Redirecting output of terminal application causes null errors

Open btrepp opened this issue 12 years ago • 0 comments

I have a ruby app i've written that runs on the commandline. It works perfectly when running via jruby -S

 jruby -S bin/myapp --args > outputfile

However when run via java via warbler

java -jar myapp.jar --args -vv > out

It dies with

LoadError: load error: META-INF/main -- java.lang.NullPointerException: null
  require at org/jruby/RubyKernel.java:1083
  require at jar:file:/C:/Users/BEAU~1.TRE/AppData/Local/Temp/jruby912549673603083274extract/jruby-stdlib-   complete-1.7.9
.jar!/META-INF/jruby.home/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:55
   (root) at <script>:3
error: org.jruby.embed.EvalFailedException: (LoadError) load error: META-INF/main --    java.lang.NullPointerException: null

Whats unique is that this only happens when trying to redirect stdout or stderr.

java -jar myapp.jar --args -vv

Works perfectly.

Also dropping the -vv flags (which sets rubys built-in logger to DEBUG level) also works fine eg.

 java -jar myapp.jar --args > output.csv

Even more specific is that this is windows cmd/powershell only. When run from a cgywin environment it works perfectly.


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

btrepp avatar Dec 12 '13 01:12 btrepp