[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-28 10:01:30
Message-ID: CALChyfpDhuh8YznBgrrU0W3WZfoF4_w5bfpOAY8VLfsDm=EnHA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pljava-dev

Thank you! It was a runtime dependency on a jar I had to add.
I guess the root ClassNotFound is swallowed somewhere when the error comes
out.
Kind of a pain to find the runtime depndencies separately.
I had to make a command line version.

Thanks again for the help!!!

On Sun, Aug 19, 2012 at 9:29 PM, Adam <work.asr at gmail.com> wrote:

> 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/20120828/1e21b2b8/attachment.html>

In response to

Browse pljava-dev by date

  From Date Subject
Next Message Herbrand Hofker 2012-09-05 06:05:41 [Pljava-dev] Problem with formatting pgsql functions
Previous Message Thomas Hallgren 2012-08-20 10:38:45 [Pljava-dev] Can't figure out: "ERROR: Unable to find static method test.AccessFunctions.echoTest with signature (Ljava/lang/String; )Ljava/lang/String; "