[Pljava-dev] Can't figure out: "ERROR: Unable to find static method test.AccessFunctions.echoTest with signature (Ljava/lang/String; )Ljava/lang/String; "

From: work(dot)asr at gmail(dot)com (Adam)
To:
Subject: [Pljava-dev] Can't figure out: "ERROR: Unable to find static method test.AccessFunctions.echoTest with signature (Ljava/lang/String; )Ljava/lang/String; "
Date: 2012-08-20 01:29:08
Message-ID: CALChyfp7DTuyKa4sUPshsdwsLoSNwEwXaPazLtrxrRoQXbBK=A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pljava-dev

I'm at my wits' end. Everything seems to be correct. I even log a message
from a static initializer of the class that shows the static public methods
using reflection.

Running
SELECT java_test.parseLong('1000');
works perfectly.

Running
SELECT java_test.echoTest('dummy');
gives an error even though javap and the log shows the proper listing of
the static public methods.

*Installation*
SELECT sqlj.install_jar('file:///ttt/pljava/test/test-pljava.jar',
'test_pljava', true);
SELECT sqlj.set_classpath('java_test', 'test_pljava');

*Log*
INFO: 19 Aug 12 20:46:35 test.AccessFunctions init - Public static methods
for class: test.AccessFunctions
Method: echoTest
Return: java.lang.String
Parameters:
java.lang.String

ERROR: Unable to find static method test.AccessFunctions.echoTest with
signature (Ljava/lang/String;)Ljava/lang/String;

********** Error **********

ERROR: Unable to find static method test.AccessFunctions.echoTest with
signature (Ljava/lang/String;)Ljava/lang/String;
SQL state: XX000

*pljava version:* pljava-x86_64-w64-mingw32-pg9.1-1.4.3
*postgres version:* 9.1.5 64bit

*javap*
C:\ttt\pljava>javap -classpath ./TEST-pljava.jar test.AccessFunctions
Compiled from "AccessFunctions.java"
public final class test.AccessFunctions extends java.lang.Object{
public static java.lang.String echoTest(java.lang.String);
Signature: (Ljava/lang/String;)Ljava/lang/String;
static {};
Signature: ()V
}

*test.pljava.ddr*
SQLActions[ ] = {
"BEGIN INSTALL
CREATE SCHEMA java_test;

BEGIN PostgreSQL SET search_path TO java_test,public END postgreSQL;

CREATE FUNCTION java_test.parseLong(varchar)
RETURNS int8
AS 'java.lang.Long.parseLong'
LANGUAGE java IMMUTABLE CALLED ON NULL INPUT;

CREATE FUNCTION java_test.echoTest(varchar)
RETURNS varchar
AS 'test.AccessFunctions.echoTest'
LANGUAGE java IMMUTABLE CALLED ON NULL INPUT;

END INSTALL",

"BEGIN REMOVE
DROP SCHEMA java_test CASCADE;
END REMOVE"
}

*functions from DB*
CREATE OR REPLACE FUNCTION java_test.parselong(character varying)
RETURNS bigint AS
'java.lang.Long.parseLong'
LANGUAGE java IMMUTABLE
COST 100;

CREATE OR REPLACE FUNCTION java_test.echotest(character varying)
RETURNS character varying AS
'test.AccessFunctions.echoTest'
LANGUAGE java IMMUTABLE
COST 100;

*postgresql.conf*
dynamic_library_path =
'$libdir;C:\\ttt\\pljava\\pljava-x86_64-w64-mingw32-pg9.1-1.4.3'
custom_variable_classes = 'pljava'
pljava.classpath =
'C:\\ttt\\pljava\\pljava-x86_64-w64-mingw32-pg9.1-1.4.3\\pljava.jar'

# Set the size of the prepared statement MRU cache
#
pljava.statement_cache_size = 10

# If true, lingering savepoints will be released on function exit. If false,
# the will be rolled back
#
pljava.release_lingering_savepoints = true

# Define startup options for the Java VM.
#
pljava.vmoptions = '-Xmx64M'

# Setting debug to true will cause the postgres process to go
# into a sleep(1) loop on its first call to java. This variable is
# only useful if you want to debug the PL/Java internal C code.
#
pljava.debug = false
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pgfoundry.org/pipermail/pljava-dev/attachments/20120819/6836a329/attachment.html>

Responses

Browse pljava-dev by date

  From Date Subject
Next Message Rural Hunter 2012-08-20 03:18:58 [Pljava-dev] Can't figure out: "ERROR: Unable to find static method test.AccessFunctions.echoTest with signature (Ljava/lang/String; )Ljava/lang/String; "
Previous Message Marc Firth 2012-07-12 13:46:48 [Pljava-dev] Pljava-dev Digest, Vol 96, Issue 1