Proper jruby.home setting for an embedded app? (NPE in 1.1.6)

What is the proper value for jruby.home in an embedded runtime?

It seems that in 1.1.5, the value defaults at being HOME/.jruby. In
1.1.6, the
value ends up being null and causing a NPE.

I tried to provide a default value of NOT_AVAILABLE, which works around
the
NPE, but then I see a new directory called NOT_AVAILABLE created after
the
run.

The proximal cause that needed the jruby.home value is shelling out;
i.e.
echo hi caused NPE in my embedded 1.1.6 runtime, unless I provide a
jruby.home value (which then gets created as a directory).

What is the proper way to tell the runtime that there is no jruby.home
value
available and that it shouldn’t try to create a jruby.home directory?

Peter


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Peter K Chan wrote:

echo hi caused NPE in my embedded 1.1.6 runtime, unless I provide a
jruby.home value (which then gets created as a directory).

What is the proper way to tell the runtime that there is no jruby.home value
available and that it shouldn’t try to create a jruby.home directory?

That would be a regression; we wanted to boot the .jruby dir, since it
just caused problems, but I guess we didn’t put a reasonable default in
its place. So…we need a bug for that.

Meanwhile, you could probably set it to any existing dir, maybe a dummy
location? /tmp? Sorry for the mixup with this one, I guess it wasn’t
caught during the RC. Toss your full description into a bug and maybe
come up with a patch if you have a chance.

  • Charlie

To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Thanks for the quick reply, Charles. Incidentally, I have been tracking
1.1.6 as it progresses through the RC process on my Windows box, but the
problem only manifested itself on my Mac, because the Mac branch of the
code shells out and triggers the NPE.

I am going to fire a bug once I deploy out my current release. So far,
setting jruby.home to java.io.tmpdir seems to work well.

Peter

The default jruby.home is supposed to point into the jar itself for
the 1.1.6 release; this should work fine with the complete jar (this
is with a trunk build but you get the idea):

$ java -jar lib/jruby-complete.jar -rrbconfig -e “puts
Config::CONFIG[‘prefix’]”
file:/Users/nicksieger/Projects/jruby/trunk/jruby/lib/jruby-complete.jar!/META-INF/jruby.home

Unfortunately, if you’re embedding with the non-complete jar, the
entry in the jar probably doesn’t exist. Your strategy of setting it
to tmpdir is probably a decent workaround for now.

/Nick

On Wed, Dec 17, 2008 at 9:13 PM, Peter K Chan [email protected] wrote:

Subject: Re: [jruby-user] Proper jruby.home setting for an embedded app? (NPE in 1.1.6)

http://xircles.codehaus.org/manage_email


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs