Subject: [Pljava-dev] Unable to load class org/postgresql/pljava/internal/Backend

From: ambulimama at gmail.com (Nelli Vanan)
Date: Mon, 20 Oct 2008 16:19:46 -0400

Hi there,

I am having some problem when trying to experiment with a hello world
example.  When I run the following command I am getting this error
message.
I am not sure what I am doing wrong.
The class path seems to be correct.  I have the pljava.jar file in /root/mydir
How can I resolve this.  Thanks,

SELECT sqlj.install_jar('file:///root/mydir/hello.jar',
'helloworld_jar',  false);
WARNING:  java.lang.NoClassDefFoundError: org/postgresql/pljava/internal/Backend
ERROR:  Unable to load class org/postgresql/pljava/internal/Backend
using CLASSPATH '-Djava.class.path=/root/mydir/pljava.jar'

---

From: ambulimama at gmail.com (Nelli Vanan)
Date: Tue, 21 Oct 2008 10:05:51 -0400

Hi there,

I have read through some of the mail threads, and noticed that people
had the same problem before.  I am using postgres 8.1.11 and plJava
1.4.0 and am running in a variant of CentOS.  e-smith server. I am not
sure if I have the same problem that was mentioned in other threads(
about zlib conflict).  Please let me know.  Thank you very much.

---

From: ambulimama at gmail.com (Nelli Vanan)
Date: Tue, 21 Oct 2008 11:00:40 -0400

Here are the info I got in the server logs.

LOCATION:  SetTransactionIdLimit, varsup.c:234
DEBUG:  00000: Not using integer_datetimes
LOCATION:  checkIntTimeType,
/home/jurka/pg/pljava/pljava/src/C/pljava/Backend.c:538
DEBUG:  00000: Added JVM option string
"-Djava.class.path=/root/thanesh/pljava.jar"
LOCATION:  JVMOptList_add,
/home/jurka/pg/pljava/pljava/src/C/pljava/Backend.c:436
DEBUG:  00000: Added JVM option string
"-Dsqlj.defaultconnection=jdbc:default:connection"
LOCATION:  JVMOptList_add,
/home/jurka/pg/pljava/pljava/src/C/pljava/Backend.c:436
DEBUG:  00000: Added JVM option string "vfprintf"
LOCATION:  JVMOptList_add,
/home/jurka/pg/pljava/pljava/src/C/pljava/Backend.c:436
DEBUG:  00000: Added JVM option string "-Xrs"
LOCATION:  JVMOptList_add,
/home/jurka/pg/pljava/pljava/src/C/pljava/Backend.c:436
DEBUG:  00000: Creating JavaVM
LOCATION:  initializeJavaVM,
/home/jurka/pg/pljava/pljava/src/C/pljava/Backend.c:640
DEBUG:  00000: JavaVM created
LOCATION:  initializeJavaVM,
/home/jurka/pg/pljava/pljava/src/C/pljava/Backend.c:660
DEBUG:  00000: Getting Backend class pljava.jar
LOCATION:  initPLJavaClasses,
/home/jurka/pg/pljava/pljava/src/C/pljava/Backend.c:124
java.lang.NoClassDefFoundError: org/postgresql/pljava/internal/Backend
WARNING:  XX000: java.lang.NoClassDefFoundError:
org/postgresql/pljava/internal/Backend
LOCATION:  elogExceptionMessage,
/home/jurka/pg/pljava/pljava/src/C/pljava/JNICalls.c:74
DEBUG:  00000: Destroying JavaVM...
LOCATION:  _destroyJavaVM,
/home/jurka/pg/pljava/pljava/src/C/pljava/Backend.c:374
c DEBUG:  00000: JavaVM destroyed
LOCATION:  _destroyJavaVM,
/home/jurka/pg/pljava/pljava/src/C/pljava/Backend.c:383
ERROR:  XX000: Unable to load class
org/postgresql/pljava/internal/Backend using CLASSPATH
'-Djava.class.path=/root/thanesh/pljava.jar'
 LOCATION:  PgObject_getJavaClass,
/home/jurka/pg/pljava/pljava/src/C/pljava/PgObject.c:116

---

From: ambulimama at gmail.com (Nelli Vanan)
Date: Tue, 21 Oct 2008 11:02:45 -0400

Actually my classpath is set to /root/thanesh/pljava.jar and not
/root/mydir/pljava.jar as in the first mail.

---

From: ambulimama at gmail.com (Nelli Vanan)
Date: Tue, 21 Oct 2008 12:45:23 -0400

Sorry to be spamming your mailbox.  I am struggling to get this
resolved.  I am using  jdk1.5.0_11 so the zlib conflict might not be
the problem.

---

From: jurka at ejurka.com (Kris Jurka)
Date: Tue, 21 Oct 2008 09:47:36 -0700

Is /root accessible by the user the postgresql server is running as?

Nelli Vanan wrote:
> _______________________________________________
> Pljava-dev mailing list
> Pljava-dev at pgfoundry.org
> http://pgfoundry.org/mailman/listinfo/pljava-dev

---

From: ambulimama at gmail.com (Nelli Vanan)
Date: Tue, 21 Oct 2008 13:01:44 -0400

Hi Kris,

I am not sure.  But, I tried to move the files over to /usr/lib/pgsql
which should be accessible and tried again.
Still I am getting the same error.  I believe I am missing something
fundamental.
Thanks for the response, here are the new logs.

DEBUG:  00000: JavaVM destroyed
'-Djava.class.path=/usr/lib/pgsql/pljava.jar'

---

From: ambulimama at gmail.com (Nelli Vanan)
Date: Tue, 21 Oct 2008 13:13:04 -0400

My bad.  Sorry, your last hint solved the problem Kris.  Thanks a lot.
 When I was doing the last test, I did not have pljava.jar in
/usr/lib/pgsql.
Thanks a lot.