[Pljava-dev] NoClassDefFoundError - Postgres Trigger invoking RMI

From: trkess at gmail(dot)com (Tom Kessler)
To:
Subject: [Pljava-dev] NoClassDefFoundError - Postgres Trigger invoking RMI
Date: 2010-12-24 00:09:07
Message-ID: AANLkTimU1U3-3f0bsdiOVB4L6GGw3C+8-aad3YSGWLk-@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pljava-dev

I need help resolving a classloader problem, I've a postgres trigger
invoking a PL/Java method making
a RMI client call to a server running on the same machine. The
method invokes fine from postgres, but
crashes:

LocateRegistry.getRegistry("127.0.0.1", 1140);
java.lang.NoClassDefFoundError: Could not initialize class
java.rmi.server.ObjID

- Am running Postgresql 8.2.17 on Debian Lenny - postgres built from
source at pgconfig= /usr/local/pgsql.
- Java version 1.6.0.20
- I have added {jdk-path}/jre/lib:{jdk-path}/jre/lib/i386/client to
LB_LIBRARY_PATH, CLASSPATH, PATH system environment vars
- JAVA_HOME is defined.
- Only one jdk is used.
- The RMI server runs fine PL/Java examples run fine. A standalone
RMI client class that calls the server runs fine.
- Both client and server run fine on Windows SP2 machine.

The problem seems exclusively in the RMI client initialization from PL/Java.

Any help much appreciated.

Tom

I created method which should invoke server through RMI.
method is invoked fine from postgres, but crashed at
LocateRegistry.getRegistry("127.0.0.1", 1140);
java.lang.NoClassDefFoundError: Could not initialize class
java.rmi.server.ObjID

it happened on Debian GNU\Linux 5.0
Standalone RMI test application works fine on this machine with this server.
I have added {jdk-path}/jre/lib:{jdk-path}/jre/lib/i386/client to
LB_LIBRARY_PATH, CLASSPATH, PATH system environment
vars, JAVA_HOME is defined.
Only one jdk is used.

pl/java tests work fine, so problem is with RMI only.

It is interesting, but ObjID.class.getDeclaredMethods()[0].toString()
returns right method definition string
sucessfully.

On Windows XP sp2, all work fine. So code is valid.

Browse pljava-dev by date

  From Date Subject
Next Message Anantha 2010-12-27 11:58:17 [Pljava-dev] Java VM stalls during
Previous Message Johann 'Myrkraverk' Oskarsson 2010-12-21 20:17:42 [Pljava-dev] Returning complex complex objects