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

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
9ff4ad7c2fd1fc0fce18cb59f5649658?d=identicon&s=25 Peter K Chan (Guest)
on 2008-12-18 03:28
(Received via mailing list)
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
Ede2aa10c6462f1d825143879be59e38?d=identicon&s=25 Charles Oliver Nutter (Guest)
on 2008-12-18 03:38
(Received via mailing list)
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
9ff4ad7c2fd1fc0fce18cb59f5649658?d=identicon&s=25 Peter K Chan (Guest)
on 2008-12-18 04:13
(Received via mailing list)
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
526d60de6472502bb570a9df2842b33b?d=identicon&s=25 Nick Sieger (Guest)
on 2008-12-18 05:05
(Received via mailing list)
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 <peter@oaktop.com> 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 topic is locked and can not be replied to.