[Pljava-dev] Problems compiling under Mac OS X

From: thhal at mailblocks(dot)com (Thomas Hallgren)
To:
Subject: [Pljava-dev] Problems compiling under Mac OS X
Date: 2004-05-18 13:51:46
Message-ID: thhal-0N66FAeMGZhI925S3mAc7oiyKKowv8B@mailblocks.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pljava-dev

What is the setting of your current "dynamic_library_path" configuration option and the LD_LIBRARY_PATH?

The pljava.jar is not the problem. The Oid class is found. The error comes when the Oid class initializer performs a System.loadLibrary("pljava") in order to let the JVM register all JNI methods (it will require to find the libpljava.so although it's loaded already). My guess is that this fails.

The JVM will use the system property "java.library.path" in order to find the libpljava.so. Currently, I'm setting this property to the union of paths defined in the config option "dynamic_library_path" (defined in postgresql.conf) and the environment LD_LIBRARY_PATH. Perhaps this should be done differently using Mac OS X?

In any case, try and set the LD_LIBRARY_PATH seen by your postmaster to include the directory where libpljava.so resides and see if this helps.

- thomas
----- Original Message -----
From: p3consulting
To: Thomas Hallgren
Sent: Tuesday, May 18, 2004 3:18 PM
Subject: Re: [Pljava-dev] Problems compiling under Mac OS X

Latest news:

still have problem make it run even after restarting postmaster with classpath set

In psql

SELECT sqlj.install_jar('samples','file:///Volumes/Data2/download_osx/PostgreSQL/org.postgresql.pljava/bin/examples.jar',true);

outputs

ERROR: Unable to load class org/postgresql/pljava/internal/Oid using CLASSPATH '/Library/Java/Extensions/pljava.jar'

(Path to examples.jar is correct since drag and dropped from Finder, no typo possible)
(Note that trying this twice leads to
server closed the connection unexpectedly
This probably means the server terminated abnormally
before or while processing the request.
The connection to the server was lost. Attempting reset: Failed.
)

At least classpath is correct and the setup of previous mail works...

In shell

ls -l /Library/Java/Extensions/pljava.jar

outputs

-rw-r--r-- 1 pascal admin 54841 14 May 16:44 /Library/Java/Extensions/pljava.jar

so pljava.jar is there (along with postgresql.jar)
and

ls /usr/local/pgsql/lib/libplj*

outputs

/usr/local/pgsql/lib/libpljava.a /usr/local/pgsql/lib/libpljava.so.1
/usr/local/pgsql/lib/libpljava.so /usr/local/pgsql/lib/libpljava.so.1.0

and in psql

\d sqlj.*

outputs:

Table "sqlj.classpath_entry"
Column | Type | Modifiers
------------+-----------------------+-----------
schemaname | character varying(30) | not null
ordinal | smallint | not null
jarid | integer | not null
Indexes:
"classpath_entry_pkey" primary key, btree (schemaname, ordinal)
Foreign-key constraints:
"$1" FOREIGN KEY (jarid) REFERENCES sqlj.jar_repository(jarid) ON DELETE CASCADE

Index "sqlj.classpath_entry_pkey"
Column | Type
------------+-----------------------
schemaname | character varying(30)
ordinal | smallint
primary key, btree, for table "sqlj.classpath_entry"

Table "sqlj.jar_entry"
Column | Type | Modifiers
------------+------------------------+--------------------------------------------------------------
entryid | integer | not null default nextval('sqlj.jar_entry_entryid_seq'::text)
entryname | character varying(200) | not null
jarid | integer | not null
entryimage | bytea | not null
Indexes:
"jar_entry_pkey" primary key, btree (entryid)
"jar_entry_jarid_key" unique, btree (jarid, entryname)
Foreign-key constraints:
"$1" FOREIGN KEY (jarid) REFERENCES sqlj.jar_repository(jarid) ON DELETE CASCADE

Sequence "sqlj.jar_entry_entryid_seq"
Column | Type
---------------+---------
sequence_name | name
last_value | bigint
increment_by | bigint
max_value | bigint
min_value | bigint
cache_value | bigint
log_cnt | bigint
is_cycled | boolean
is_called | boolean

Index "sqlj.jar_entry_jarid_key"
Column | Type
-----------+------------------------
jarid | integer
entryname | character varying(200)
unique, btree, for table "sqlj.jar_entry"

Index "sqlj.jar_entry_pkey"
Column | Type
---------+---------
entryid | integer
primary key, btree, for table "sqlj.jar_entry"

Table "sqlj.jar_repository"
Column | Type | Modifiers
----------------+------------------------+-----------------------------------------------------------------
jarid | integer | not null default nextval('sqlj.jar_repository_jarid_seq'::text)
jarname | character varying(100) | not null
jarorigin | character varying(500) | not null
deploymentdesc | integer |
Indexes:
"jar_repository_pkey" primary key, btree (jarid)
"jar_repository_jarname_key" unique, btree (jarname)
Foreign-key constraints:
"$1" FOREIGN KEY (deploymentdesc) REFERENCES sqlj.jar_entry(entryid) ON DELETE SET NULL

Sequence "sqlj.jar_repository_jarid_seq"
Column | Type
---------------+---------
sequence_name | name
last_value | bigint
increment_by | bigint
max_value | bigint
min_value | bigint
cache_value | bigint
log_cnt | bigint
is_cycled | boolean
is_called | boolean

Index "sqlj.jar_repository_jarname_key"
Column | Type
---------+------------------------
jarname | character varying(100)
unique, btree, for table "sqlj.jar_repository"

Index "sqlj.jar_repository_pkey"
Column | Type
--------+---------
jarid | integer
primary key, btree, for table "sqlj.jar_repository"

So deploy seems to have done its work.

What info more do you need to help me solve the problem ?

Regards,
Pascal
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pgfoundry.org/pipermail/pljava-dev/attachments/20040518/9de47ee8/attachment.html>

In response to

Browse pljava-dev by date

  From Date Subject
Next Message Arul Shaji 2004-06-18 07:44:47 [Pljava-dev] Debugging application
Previous Message Thomas Hallgren 2004-05-17 07:52:39 [Pljava-dev] Problems compiling under Mac OS X