public inbox for [email protected]
help / color / mirror / Atom feedSubject: [Pljava-dev] Help in Installing PLjava
Date: Sun, 19 Jul 2015 21:05:33 -0400
Message-ID: <[email protected]> (raw)
In-Reply-To: <6528B12EF4BBFE4DA8BD67F5F8D610D31084EA@VS1-Exchange.blr-zenithsoft., net>
References: <6528B12EF4BBFE4DA8BD67F5F8D610D31084EA@VS1-Exchange.blr-zenithsoft., net>
Anil K Krishna wrote:
> I have installed PostgresSQL on Linux and also followed the steps as
> mentioned in the link below to install PLJava.
> http://www.javacodegeeks.com/2012/10/introduction-to-postgresql-pljava.html
>
> I have created a sample Java function as mentioned below
>
> CREATE FUNCTION getsysprop(VARCHAR) RETURNS VARCHAR AS
> 'java.lang.System.getProperty' LANGUAGE java;
>
> and when I execute this function [SELECT getsysprop('user.home');]
> I am getting the error "Do you want to attempt to reconnect to the
> database" with option yes or no.
Ouch! That indicates that in trying to run your function, the backend
crashed. That's outside of the set of Things That Ought to Happen, and
generally won't, in a Java Virtual Machine, so normally an event like
that would point into the relatively small portion of PL/Java that runs
as native code.
But ... I skimmed the article you were following, and I see that it
suggested a distribution of PL/Java built with gcj instead of a normal
Java runtime, and gcj makes _everything_ into native code. Also, while
I haven't used it myself, I have seen unflattering notes about its
stability. Also, I noticed that article claimed that PL/Java can be
used as a 'trusted' language, and indeed the docs on the PL/Java site
say it can be, *but only when not built with gcj*.
Your test in my environment (with a vanilla Oracle JRE) does what you'd
expect:
SELECT getsysprop('user.home');
getsysprop
---------------------
/var/lib/postgresql
So (if you haven't already solved your problem or gone another way),
I would suggest as a very first test, try a vanilla installation with
a conventional JRE, and see if that works better.
Regards,
-Chap
view thread (2+ messages)
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Subject: Re: [Pljava-dev] Help in Installing PLjava
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox