db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rick Hillegas (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (DERBY-5366) ClassNotFoundException when invoking a table function stored in a jar file in the database which extends or implements one of the classes/interfaces in org.apache.derby.vti
Date Mon, 01 Aug 2011 20:31:09 GMT

     [ https://issues.apache.org/jira/browse/DERBY-5366?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Rick Hillegas updated DERBY-5366:
---------------------------------

    Attachment: derby-5366.sql
                DummyVTI.java

Attaching a repro:

1) Compile DummyVTI

2) Put it in a jar file called z/z.jar

3) Then run the derby-5366 script under ij.

You will see the following output:

ij version 10.9
ij> connect 'jdbc:derby:memory:db;create=true';
ij> create function dummyVTI() returns
table
(
    a int
)
language java parameter style derby_jdbc_result_set no sql
external name 'DummyVTI.dummyVTI';
0 rows inserted/updated/deleted
ij> call sqlj.install_jar('z/z.jar', 'APP.DUMMY_JAR', 0);
0 rows inserted/updated/deleted
ij> call syscs_util.syscs_set_database_property( 'derby.database.classpath', 'APP.DUMMY_JAR');
0 rows inserted/updated/deleted
ij> select * from table( dummyVTI() ) s;
ERROR 42X51: The class 'DummyVTI' does not exist or is inaccessible. This can happen if the
class is not public.
ERROR XJ001: Java exception: 'DummyVTI : org/apache/derby/vti/RestrictedVTI: java.lang.ClassNotFoundException'.
ij> mainline (1.6) > runsql derby-5366
ij version 10.9
ij> connect 'jdbc:derby:memory:db;create=true';
ij> create function dummyVTI() returns
table
(
    a int
)
language java parameter style derby_jdbc_result_set no sql
external name 'DummyVTI.dummyVTI';
0 rows inserted/updated/deleted
ij> call sqlj.install_jar('z/z.jar', 'APP.DUMMY_JAR', 0);
0 rows inserted/updated/deleted
ij> call syscs_util.syscs_set_database_property( 'derby.database.classpath', 'APP.DUMMY_JAR');
0 rows inserted/updated/deleted
ij> select * from table( dummyVTI() ) s;
ERROR 42X51: The class 'DummyVTI' does not exist or is inaccessible. This can happen if the
class is not public.
ERROR XJ001: Java exception: 'DummyVTI : org/apache/derby/vti/RestrictedVTI: java.lang.ClassNotFoundException'.

> ClassNotFoundException when invoking a table function stored in a jar file in the database
which extends or implements one of the classes/interfaces in org.apache.derby.vti 
> -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-5366
>                 URL: https://issues.apache.org/jira/browse/DERBY-5366
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.8.1.6
>            Reporter: Rick Hillegas
>         Attachments: DummyVTI.java, derby-5366.sql
>
>
> The class loader created by setting the derby.database.classpath does not see the Derby
classes. This means that you can't use table functions which implement VTITemplate if you
store those functions in a jar file in the database and then wire that jar file into the database-specific
classpath. I will attach a repro. This problem was reported by Brett Berqquist in an email
thread titled "Problem in trying to get a Restricted Table Function loaded".

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message