[Pljava-dev] Help in Installing PLjava

From: chap at anastigmatix(dot)net (Chapman Flack)
To:
Subject: [Pljava-dev] Help in Installing PLjava
Date: 2015-07-20 01:05:33
Message-ID: 55AC495D.2010809@anastigmatix.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pljava-dev

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

Browse pljava-dev by date

  From Date Subject
Next Message Craig Ringer 2015-07-20 02:10:02 [Pljava-dev] The pljava Project is dead (LONG but I hope interesting)
Previous Message Bear Giles 2015-07-20 00:42:33 [Pljava-dev] The pljava Project is dead (LONG but I hope interesting)