Skip to content

Help demonstration example I can't use #421

Closed

Description

@exqmjmz

Demonstration example I can't use
I tried different methods
Prompt the following error
example:ResultSetTest.java

CREATE OR REPLACE FUNCTION test_pljava(query TEXT) RETURNS TEXT AS 'com.kamin.pljava.Cases.executeSelect' LANGUAGE java
> ERROR:  java.sql.SQLNonTransientException: resolving static method com.kamin.pljava.Cases.executeSelect with signature (String)String: java.lang.NoSuchMethodException: no such method: com.kamin.pljava.Cases.executeSelect(String)String/invokeStatic
CREATE OR REPLACE FUNCTION test_pljava(query TEXT) RETURNS SETOF mv_case_template AS 'com.kamin.pljava.Cases.executeSelect' LANGUAGE java
> ERROR:  java.sql.SQLNonTransientException: resolving static method com.kamin.pljava.Cases.executeSelect with signature (String)ResultSetProvider: java.lang.NoSuchMethodException: no such method: com.kamin.pljava.Cases.executeSelect(String)ResultSetProvider/invokeStatic

Activity

  1. jcflack commented on Mar 11, 2023

    @jcflack
    Contributor

    Hi,

    Can you include the output of the following?

    SELECT schemaname, jarname
      FROM sqlj.classpath_entry NATURAL JOIN sqlj.jar_repository
      ORDER BY schemaname, ordinal;
    
    SHOW pljava.classpath;
    SHOW search_path;

    Very often, an issue like what you are reporting will have an explanation among those settings.

  2. exqmjmz commented on Mar 11, 2023

    @exqmjmz
    Author
    SELECT schemaname, jarname
      FROM sqlj.classpath_entry NATURAL JOIN sqlj.jar_repository
      ORDER BY schemaname, ordinal;
    
    SHOW pljava.classpath;
    SHOW search_path;

    SELECT schemaname, jarname
    FROM sqlj.classpath_entry NATURAL JOIN sqlj.jar_repository
    ORDER BY schemaname, ordinal;

    return:

    schemaname jarname
    public pgjar

    SHOW pljava.classpath;
    return:

    ERROR: unrecognized configuration parameter "pljava.classpath"

    SHOW search_path;
    return:

    search_path
    public, "$user", public

  3. jcflack commented on Mar 11, 2023

    @jcflack
    Contributor

    Oops, sorry, I copied the show pljava.classpath from an older issue, before the variable name changed. It would be show pljava.module_path in recent versions.

    But even that might be less important here than

    SELECT sqlj.get_classpath('public');
  4. exqmjmz commented on Mar 11, 2023

    @exqmjmz
    Author

    Oops, sorry, I copied the show pljava.classpath from an older issue, before the variable name changed. It would be show pljava.module_path in recent versions.

    But even that might be less important here than

    SELECT sqlj.get_classpath('public');

    It's all right, glad you helped!
    return:

    get_classpath
    pgjar

  5. jcflack commented on Mar 11, 2023

    @jcflack
    Contributor

    This may show more:

    \c
    SET client_min_messages TO debug1;
    CREATE OR REPLACE FUNCTION test_pljava(query TEXT) RETURNS TEXT AS 'com.kamin.pljava.Cases.executeSelect' LANGUAGE java;

    Sometimes during create-time validation, another exception further down the stacktrace may end up looking like the method wasn't found.

    If you don't see more useful output at the client, also take a look in the server log afterward.

  6. jcflack commented on Jun 7, 2023

    @jcflack
    Contributor

    Was there any resolution?

  7. jcflack commented on Apr 5, 2024

    @jcflack
    Contributor

    Closed waiting on reporter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions