agora inbox for pljava-dev@postgresql.org
help / color / mirror / Atom feed[Pljava-dev] Can't figure out: "ERROR: Unable to find static method test.AccessFunctions.echoTest with signature (Ljava/lang/String; )Ljava/lang/String; "
4+ messages / 0 participants
[nested] [flat]
* [Pljava-dev] Can't figure out: "ERROR: Unable to find static method test.AccessFunctions.echoTest with signature (Ljava/lang/String; )Ljava/lang/String; "
@ 2012-08-20 01:29
0 siblings, 3 replies; 4+ messages in thread
From: @ 2012-08-20 01:29 UTC (permalink / raw)
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;
^ permalink raw reply [nested|flat] 4+ messages in thread
* [Pljava-dev] Can't figure out: "ERROR: Unable to find static method test.AccessFunctions.echoTest with signature (Ljava/lang/String; )Ljava/lang/String; "
@ 2012-08-20 03:18
parent:
2 siblings, 0 replies; 4+ messages in thread
From: @ 2012-08-20 03:18 UTC (permalink / raw)
An HTML attachment was scrubbed...
URL: <http://lists.pgfoundry.org/pipermail/pljava-dev/attachments/20120820/2244056c/attachment.html;
^ permalink raw reply [nested|flat] 4+ messages in thread
* [Pljava-dev] Can't figure out: "ERROR: Unable to find static method test.AccessFunctions.echoTest with signature (Ljava/lang/String; )Ljava/lang/String; "
@ 2012-08-20 10:38
parent:
2 siblings, 0 replies; 4+ messages in thread
From: @ 2012-08-20 10:38 UTC (permalink / raw)
An HTML attachment was scrubbed...
URL: <http://lists.pgfoundry.org/pipermail/pljava-dev/attachments/20120820/39c9d272/attachment.html;
^ permalink raw reply [nested|flat] 4+ messages in thread
* [Pljava-dev] Can't figure out: "ERROR: Unable to find static method test.AccessFunctions.echoTest with signature (Ljava/lang/String; )Ljava/lang/String; "
@ 2012-08-28 10:01
parent:
2 siblings, 0 replies; 4+ messages in thread
From: @ 2012-08-28 10:01 UTC (permalink / raw)
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;
^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2012-08-28 10:01 UTC | newest]
Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2012-08-20 01:29 [Pljava-dev] Can't figure out: "ERROR: Unable to find static method test.AccessFunctions.echoTest with signature (Ljava/lang/String; )Ljava/lang/String; "
2012-08-20 03:18 `
2012-08-20 10:38 `
2012-08-28 10:01 `
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox