Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java.lang.UnsatisfiedLinkError: _getStatementCacheSize #20

Closed
vmaroli opened this issue Aug 2, 2013 · 3 comments
Closed

java.lang.UnsatisfiedLinkError: _getStatementCacheSize #20

vmaroli opened this issue Aug 2, 2013 · 3 comments

Comments

@vmaroli
Copy link

vmaroli commented Aug 2, 2013

While trying to run the example provided along with installation, got below error.

DEBUG: Using integer_datetimes
DEBUG: Added JVM option string "-Djava.class.path=/opt/PostgreSQL/9.1/lib/postgresql/pljava.jar:/usr/share/java/postgresql-jdbc-8.1.407.jar"
DEBUG: Added JVM option string "-Dsqlj.defaultconnection=jdbc:default:connection"
DEBUG: Added JVM option string "vfprintf"
DEBUG: Creating JavaVM
DEBUG: JavaVM created
DEBUG: Getting Backend class pljava.jar
DEBUG: Backend class was there
java.lang.UnsatisfiedLinkError: _getStatementCacheSize
at org.postgresql.pljava.internal.Backend._getStatementCacheSize(Native Method)
at org.postgresql.pljava.internal.Backend.getStatementCacheSize(Backend.java:65)
at org.postgresql.pljava.internal.ExecutionPlan.(ExecutionPlan.java:108)
WARNING: java.lang.UnsatisfiedLinkError: _getStatementCacheSize
DEBUG: Destroying JavaVM...
DEBUG: JavaVM destroyed
ERROR: Unable to load class org/postgresql/pljava/internal/ExecutionPlan using CLASSPATH '-Djava.class.path=/opt/PostgreSQL/9.1/lib/postgresql/pljava.jar:/usr/share/java/postgresql-jdbc-8.1.407.jar'
STATEMENT: SELECT sqlj.install_jar('file://opt/PostgreSQL/9.1/pl/pljava-1.4.3/build/examples.jar', 'samples', true);

-bash-3.2$ java -version
java version "1.5.0_22"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_22-b03)
Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_22-b03, mixed mode)
-bash-3.2$ uname -a
Linux 2.6.18-194.el5 #1 SMP Tue Mar 16 21:52:39 EDT 2010 x86_64 x86_64 x86_64 GNU/Linux

@elena-lebeda
Copy link

I have the same problem with in our installation of PL/Java. Segmentation fault received.

SELECT sqlj.install_jar(:triggersJar, 'triggers', false);
psql:triggers/install_triggers.sql:1: WARNING: java.lang.UnsatisfiedLinkError: org.postgresql.pljava.internal.Backend._getStatementCacheSize()I
psql:triggers/install_triggers.sql:1: ERROR: Unable to load class org/postgresql/pljava/internal/ExecutionPlan using CLASSPATH '-Djava.class.path=/usr/local/pgsql-9.1/lib/activemq-all.jar:/usr/local/pgsql-9.1/lib/postgresql.jar:/usr/local/pgsql-9.1/lib/pljava.jar:/usr/local/pgsql-9.1/lib/pljava.so:/usr/local/pgsql-9.1/lib/slf4j-log4j12-1.6.4.jar:/usr/local/pgsql-9.1/lib/log4j-1.2.15.jar:/usr/local/pgsql-9.1/lib/commons-logging-1.1.1.jar:/opt/jetty/resources'
SELECT sqlj.set_classpath('public', 'triggers');

Looks rather like incompatibility of the PL/Java and version 9.1

@jcflack
Copy link
Contributor

jcflack commented Oct 5, 2015

Hi @elena-lebeda

I am a bit perplexed by this bug report - are you still in a position where you could give more details, or did you get it working eventually?

From the information above, I don't think this can involve an incompatibility with a PostgreSQL version. The _getStatementCacheSize function is not part of PostgreSQL, it's part of PL/Java itself, so somehow PL/Java got built in a way that left it with problems finding its own function symbols. What's more strange is that the line that registers that function with JNI and the function definition itself don't appear to have changed in the source code at all in eleven years.

To figure this out, it might take more details on the exact environment where you built PL/Java, maybe a log from the build ... if you are still able to provide that.

Thanks!

@jcflack
Copy link
Contributor

jcflack commented Dec 23, 2015

Nothing heard from the original reporter in a couple of months, the report is old, and 1.5.0-SNAPSHOT is testing well on several platforms and PG versions up to 9.5. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants