[Pljava-dev] Building / installing for CentOS or Fedora

Lists: pljava-dev
From: eggyknap at gmail(dot)com (eggyknap)
To:
Subject: [Pljava-dev] Building / installing for CentOS or Fedora
Date: 2013-02-15 15:26:01
Message-ID: 511e538b.4553420a.51be.1fa8@mx.google.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pljava-dev

Having just read the recent mailing list archives, I'm guessing this isn't a
resolved problem. I'm trying to install PL/Java on Postgres 9.2 with, ideally,
Java 1.5 or 1.6 (though 1.7 might not cause anyone heartburn either). Server
is Linux, x64.

I've tried building from source on my own similar box (Fedora, not CentOS, but
otherwise equivalent software) to no avail:

[josh at eddie ~/devel/pljava]$ export USE_LD_RPATH=4
[josh at eddie ~/devel/pljava]$ make
make[1]: Entering directory `/home/josh/devel/pljava/build/classes/pljava'
make[1]: /home/josh/devel/pljava/src/java/pljava/Makefile: No such file or
directory
make[1]: *** No rule to make target
`/home/josh/devel/pljava/src/java/pljava/Makefile'. Stop.
make[1]: Leaving directory `/home/josh/devel/pljava/build/classes/pljava'
make: *** [pljava_all] Error 2

It looks like that's already been seen on this list, but I didn't find
sufficient detail in the lists to understand how to get past it. Help?

I'm not wedded to the idea of buiding from source; I just want it installed
and working. If there's a package somewhere, that would be lovely, but I
gather that's unlikely.

--
Joshua Tolley / eggyknap
End Point Corporation
http://www.endpoint.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://lists.pgfoundry.org/pipermail/pljava-dev/attachments/20130215/a01b7627/attachment.bin>


From: ch at lathspell(dot)de (Christian Hammers)
To:
Subject: [Pljava-dev] Building / installing for CentOS or Fedora
Date: 2013-02-15 17:24:57
Message-ID: 20130215182457.455342b1@sys-251.netcologne.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: PostgreSQL : PostgreSQL 메일 링리스트 : 2013-02-15 이후 스포츠 토토 17:24

Hello

One quick way to get it running is using https://github.com/lathspell/pljava.git
which builds everything with just "mvn install".

The official GIT repository has IIRC not yet applied the patches for Java 1.7
and the hellblazer repository works with Java 1.7 but does not compile the C
sources automatically.

bye,

-christian-

On Fri, 15 Feb 2013 08:26:01 -0700
eggyknap <eggyknap at gmail.com> wrote:

> Having just read the recent mailing list archives, I'm guessing this isn't a
> resolved problem. I'm trying to install PL/Java on Postgres 9.2 with, ideally,
> Java 1.5 or 1.6 (though 1.7 might not cause anyone heartburn either). Server
> is Linux, x64.
>
> I've tried building from source on my own similar box (Fedora, not CentOS, but
> otherwise equivalent software) to no avail:
>
> [josh at eddie ~/devel/pljava]$ export USE_LD_RPATH=4
> [josh at eddie ~/devel/pljava]$ make
> make[1]: Entering directory `/home/josh/devel/pljava/build/classes/pljava'
> make[1]: /home/josh/devel/pljava/src/java/pljava/Makefile: No such file or
> directory
> make[1]: *** No rule to make target
> `/home/josh/devel/pljava/src/java/pljava/Makefile'. Stop.
> make[1]: Leaving directory `/home/josh/devel/pljava/build/classes/pljava'
> make: *** [pljava_all] Error 2
>
> It looks like that's already been seen on this list, but I didn't find
> sufficient detail in the lists to understand how to get past it. Help?
>
> I'm not wedded to the idea of buiding from source; I just want it installed
> and working. If there's a package somewhere, that would be lovely, but I
> gather that's unlikely.
>
> --
> Joshua Tolley / eggyknap
> End Point Corporation
> http://www.endpoint.com

--
Network Engineering & Design; Content Delivery Platform & IP

NETCOLOGNE Gesellschaft f?r Telekommunikation mbH
Am Coloneum 9 | 50829 K?ln
Tel: 0221 2222-8711 | Fax: 0221 2222-78711
www.netcologne.de

Gesch?ftsf?hrer:
Dr. Hans Konle (Sprecher)
Dipl.-Ing. Karl-Heinz Zankel
HRB 25580, AG K?ln

Diese Nachricht (inklusive aller Anh?nge) ist vertraulich. Sollten Sie diese
Nachricht versehentlich erhalten haben, bitten wir, den Absender (durch
Antwort-E-Mail) hiervon unverz?glich zu informieren und die Nachricht zu
l?schen. Die E-Mail darf in diesem Fall weder vervielf?ltigt noch in anderer
Weise verwendet werden.


From: eggyknap at gmail(dot)com (eggyknap)
To:
Subject: [Pljava-dev] Building / installing for CentOS or Fedora
Date: 2013-02-15 18:00:51
Message-ID: 511e77d5.c1fb440a.4c4a.ffff87cc@mx.google.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pljava-dev

On Fri, Feb 15, 2013 at 06:24:57PM +0100, Christian Hammers wrote:
> One quick way to get it running is using https://github.com/lathspell/pljava.git
> which builds everything with just "mvn install".

Awesome... except that I get this:

[WARNING] The POM for
org.apache.maven.plugins:maven-nar-plugin:jar:2.1-SNAPSHOT is missing, no
dependency information available
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project org.postgresql:pljava-so:0.0.1-SNAPSHOT
(/home/josh/devel/pljava-build/pljava-so/pom.xml) has 2 errors
[ERROR] Unresolveable build extension: Plugin
org.apache.maven.plugins:maven-nar-plugin:2.1-SNAPSHOT or one of its
dependencies could not be resolved: Could not find artifact
org.apache.maven.plugins:maven-nar-plugin:jar:2.1-SNAPSHOT -> [Help 2]
[ERROR] Unknown packaging: nar @ line 14, column 16

I don't speak Maven very well, but it seems I need a special maven-nar-plugin
version including some of your own changes, and I'm guessing the problem
involves getting that version. How do I get around that? #begging-for-help

Thanks.

--
Joshua Tolley / eggyknap
End Point Corporation
http://www.endpoint.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://lists.pgfoundry.org/pipermail/pljava-dev/attachments/20130215/a8cf6e90/attachment.bin>


From: eggyknap at gmail(dot)com (eggyknap)
To:
Subject: [Pljava-dev] Building / installing for CentOS or Fedora
Date: 2013-02-15 18:21:18
Message-ID: 511e7ca1.444b420a.4533.7851@mx.google.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pljava-dev

On Fri, Feb 15, 2013 at 06:24:57PM +0100, Christian Hammers wrote:
> One quick way to get it running is using https://github.com/lathspell/pljava.git
> which builds everything with just "mvn install".
>
> The official GIT repository has IIRC not yet applied the patches for Java 1.7
> and the hellblazer repository works with Java 1.7 but does not compile the C
> sources automatically.

Perhaps by installing your version of the nar plugin from github, I've
succeeded. I'll test this out. Thanks.

--
Joshua Tolley / eggyknap
End Point Corporation
http://www.endpoint.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://lists.pgfoundry.org/pipermail/pljava-dev/attachments/20130215/eab43763/attachment.bin>


From: eggyknap at gmail(dot)com (eggyknap)
To:
Subject: [Pljava-dev] Building / installing for CentOS or Fedora
Date: 2013-02-15 18:55:44
Message-ID: 511e84bb.a2e8440a.3a40.ffff89f0@mx.google.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pljava-dev

On Fri, Feb 15, 2013 at 11:21:18AM -0700, eggyknap wrote:
> Perhaps by installing your version of the nar plugin from github, I've
> succeeded. I'll test this out. Thanks.

Well, it's a qualified success. After running maven, I couldn't find any
pljava.so or pljava.jar files anywhere, so I went into various subdirectories
and ran ant manually, which created some files named similarly to what I was
looking for. I put them manually into the PostgreSQL $libdir, because I liked
that method better than fiddling with dynamic_library_path, and after changing
LD_LIBRARY_PATH so postgres could find libjvm.so, was able to create the
language successfully.

Now I'm loading the examples, and get this:

pljava=# select
sqlj.install_jar('file:///home/josh/devel/pljava-build/pljava-examples/target/pljava-examples-0.0.1-SNAPSHOT.jar',
'samples', true);
WARNING: java.lang.NoClassDefFoundError:
org/postgresql/pljava/internal/Backend
ERROR: Unable to load class org/postgresql/pljava/internal/Backend using
CLASSPATH
'-Djava.class.path=target/lib//pljava.jar:/etc/alternatives/java_sdk/lib/management-agent.jar:/etc/alternatives/java_sdk/lib/tools.jar'

I'll see if I can figure out how to make that target/lib/pljava.jar classpath
absolute, and ... something meaninful. I expected maven to create nicely
packaged .so and .jar files for me, and it didn't, which suggests I'm doing
something else wrong.

--
Joshua Tolley / eggyknap
End Point Corporation
http://www.endpoint.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://lists.pgfoundry.org/pipermail/pljava-dev/attachments/20130215/18c561cc/attachment.bin>


From: ch at lathspell(dot)de (Christian Hammers)
To:
Subject: [Pljava-dev] Building / installing for CentOS or Fedora
Date: 2013-02-15 19:11:48
Message-ID: 20130215201148.32266079@james.intern
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pljava-dev

Am Fri, 15 Feb 2013 11:55:44 -0700
schrieb eggyknap <eggyknap at gmail.com>:

> On Fri, Feb 15, 2013 at 11:21:18AM -0700, eggyknap wrote:
> > Perhaps by installing your version of the nar plugin from github,
> > I've succeeded. I'll test this out. Thanks.
>
> Well, it's a qualified success. After running maven, I couldn't find
> any pljava.so or pljava.jar files anywhere

Maven calls the file slightly different:
pljava-so/target/nar/pljava-so-0.0.1-SNAPSHOT-amd64-Linux-gpp-shared/lib/amd64-Linux-gpp/shared/libpljava-so-0.0.1-SNAPSHOT.so

Running "mvn deploy" as root inside the pljava-so directory will
automatically copy it to /usr/lib/postgresql/9.2/main/pljava.so (or
whereever it belongs). Has still to be documented though :)

> so I went into various
> subdirectories and ran ant manually, which created some files named
> similarly to what I was looking for. I put them manually into the
> PostgreSQL $libdir, because I liked that method better than fiddling
> with dynamic_library_path, and after changing LD_LIBRARY_PATH so
> postgres could find libjvm.so, was able to create the language
> successfully.
>
> Now I'm loading the examples, and get this:
>
> pljava=# select
> sqlj.install_jar('file:///home/josh/devel/pljava-build/pljava-examples/target/pljava-examples-0.0.1-SNAPSHOT.jar',
> 'samples', true);
> WARNING: java.lang.NoClassDefFoundError:
> org/postgresql/pljava/internal/Backend
> ERROR: Unable to load class org/postgresql/pljava/internal/Backend
> using CLASSPATH
> '-Djava.class.path=target/lib//pljava.jar:/etc/alternatives/java_sdk/lib/management-agent.jar:/etc/alternatives/java_sdk/lib/tools.jar'
>
> I'll see if I can figure out how to make that target/lib/pljava.jar
> classpath absolute, and ... something meaninful. I expected maven to
> create nicely packaged .so and .jar files for me, and it didn't,
> which suggests I'm doing something else wrong.

The Backend class is part of pljava-jdbc so I assume that you did not
add the following lines (paths adjusted!) to your
/etc/postgresql/9.2/main/postgresql.conf:

pljava.classpath =
'.../pljava-api/target/pljava-api-0.0.1-SNAPSHOT.jar:.../pljava-jdbc/target/pljava-jdbc-0.0.1-SNAPSHOT.jar'
pljava.statement_cache_size = 10 pljava.release_lingering_savepoints =
true pljava.vmoptions = '-Xmx64M'
pljava.debug = false

More about this can be read in docs/userguide.html.

bye,

-christian-

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.pgfoundry.org/pipermail/pljava-dev/attachments/20130215/5dd9b994/attachment-0001.bin>


From: eggyknap at gmail(dot)com (eggyknap)
To:
Subject: [Pljava-dev] Building / installing for CentOS or Fedora
Date: 2013-02-15 21:00:36
Message-ID: 511ea1f6.c440440a.1cf5.ffff9f4f@mx.google.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pljava-dev

On Fri, Feb 15, 2013 at 08:11:48PM +0100, Christian Hammers wrote:
> > Well, it's a qualified success. After running maven, I couldn't find
> > any pljava.so or pljava.jar files anywhere
>
> Maven calls the file slightly different:
> pljava-so/target/nar/pljava-so-0.0.1-SNAPSHOT-amd64-Linux-gpp-shared/lib/amd64-Linux-gpp/shared/libpljava-so-0.0.1-SNAPSHOT.so
>
> Running "mvn deploy" as root inside the pljava-so directory will
> automatically copy it to /usr/lib/postgresql/9.2/main/pljava.so (or
> whereever it belongs). Has still to be documented though :)

Cool, that worked.

> The Backend class is part of pljava-jdbc so I assume that you did not
> add the following lines (paths adjusted!) to your
> /etc/postgresql/9.2/main/postgresql.conf:
>
> pljava.classpath =
> '.../pljava-api/target/pljava-api-0.0.1-SNAPSHOT.jar:.../pljava-jdbc/target/pljava-jdbc-0.0.1-SNAPSHOT.jar'
> pljava.statement_cache_size = 10 pljava.release_lingering_savepoints =
> true pljava.vmoptions = '-Xmx64M'
> pljava.debug = false
>
> More about this can be read in docs/userguide.html.

Ok, I admit not having read the documentation closely before asking. Thanks
for putting up with it. It works now, though I still don't have a single
pljava.jar file (another undocumented "mvn deploy" somewhere?) so I copied the
.jar files from pljava-*/ to some other directory, added each to the
pljava.classpath, and then found I got Java SecurityErrors. Mailing list
archives said only pljava.jar should be in the classpath, so I removed all but
"pljava-jdbc-0.0.1-SNAPSHOT.jar". That got me exceptions with classes not
being found, but adding "pljava-api-0.0.1-SNAPSHOT.jar" fixed those, and now
the tests finish.

Now to figure out what to do with it... thanks.

--
Joshua Tolley / eggyknap
End Point Corporation
http://www.endpoint.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://lists.pgfoundry.org/pipermail/pljava-dev/attachments/20130215/e385f042/attachment.bin>