Skip to content

Redirecting output of terminal application causes null errors #227

Description

@btrepp

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions