Argv

Sorry about jumping in on the other thread with this. What I started
looking at and ran into the issue.
After a while this appeared to become sort of intermittent so I’m
assuming some sort of threading issue? Not sure if that makes it my
problem or JRuby’s?

Back to this at the moment…
NameError: uninitialized constant #Class:0x10026e166::ARGV
const_missing at org/jruby/RubyModule.java:2528
java.lang.NullPointerException
at
org.jruby.embed.jsr223.JRubyEngine.wrapException(JRubyEngine.java:110)
at org.jruby.embed.jsr223.JRubyEngine.eval(JRubyEngine.java:133)
at org.jruby.embed.jsr223.JRubyEngine.eval(JRubyEngine.java:158)
at org.cmdline.cmds.rbs.main(rbs.java:62)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.cmdline.psuedoGestalt.Runner.invoke(Runner.java:183)
at org.cmdline.psuedoGestalt.Runner.runStatic(Runner.java:210)
at org.cmdline.psuedoGestalt.Runner.runMain(Runner.java:202)
at org.cmdline.psuedoGestalt.Runner.run(Runner.java:124)

What I ended up with for the original post, again newbie so I’m sure
could be better
fwiw

class String
def is_integer?
self.to_i.to_s == self
end
end

shell = HP.new
puts shell
pids = shell.hp(‘exec jps’)
for s in pids
if s.is_integer?
pid = s
else
if s == ‘CommandLine’
break
end
end
end
puts s+’ '+pid
jmap_str = 'jmap -dump:live,format=b,file=heap.bin '+pid
result = shell.hp('exec '+jmap_str)
puts result
result = shell.hp(‘exec jhat -J-Xmx200M heap.bin’)
puts result
shell.hp(‘jnp2.SimpleWebBrowser http://localhost:7000’)

Works anyhow.
I found the post useful.
Thanks.