db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rick Hillegas <Richard.Hille...@Sun.COM>
Subject Re: Unable to use Table function due to java.lang.ClassNotFoundException while class is clearly reachable..
Date Tue, 31 Mar 2009 13:40:18 GMT
Hi Krzysztof,

It is interesting that you are getting ClassNotFoundException when 
executing the vti as a scalar function. Previously, that experiment 
succeeded for you. One thing I notice from your previous, successful 
resolution of the scalar function is that Derby loaded the class from 
your "VariFramework" jar. The following snippet comes from the piece of 
the Derby log which you posted on March 25:

    Loaded gaia.cu7.dal.DerbyBlobTableFunction from database jar 
"APP"."VariFramework"

But now your code is expecting to find the class in a different jar 
file, viz., "kn". Are you confident that the class is in the correct jar 
file and that the database classpath is correct? What happens when you 
invoke the MYFUNC scalar function which you have bound to 
gaia.cu7.dal.DerbyBlobTableFunction.returnSth?

Thanks,
-Rick



Krzysztof N wrote:
> Hello Rick,
> Thank you for fast response. Still have some issues though - I am using
> trunk version, repeated installation of jars - same way as before.
> Both scalar 'values' and table function call give ClassNotFoundException
> originating from ReflectClassesJava2:loadClassNotInDatabaseJar now:
>
> <log>
> ERROR 42X51: The class 'gaia.cu7.dal.DerbyBlobTableFunction' does not exist
> or is inaccessible. This can happen if the class is not public.
>         at
> org.apache.derby.iapi.error.StandardException.newException(StandardException.java:296)
>         at
> org.apache.derby.impl.sql.compile.QueryTreeNode.verifyClassExist(QueryTreeNode.java:1445)
>         at
> org.apache.derby.impl.sql.compile.StaticMethodCallNode.bindExpression(StaticMethodCallNode.java:256)
>         at
> org.apache.derby.impl.sql.compile.FromVTI.bindVTITables(FromVTI.java:541)
>         at
> org.apache.derby.impl.sql.compile.FromList.bindTables(FromList.java:322)
>         at
> org.apache.derby.impl.sql.compile.SelectNode.bindNonVTITables(SelectNode.java:390)
>         at
> org.apache.derby.impl.sql.compile.DMLStatementNode.bindTables(DMLStatementNode.java:199)
>         at
> org.apache.derby.impl.sql.compile.DMLStatementNode.bind(DMLStatementNode.java:137)
>         at
> org.apache.derby.impl.sql.compile.CursorNode.bindStatement(CursorNode.java:245)
>         at
> org.apache.derby.impl.sql.GenericStatement.prepMinion(GenericStatement.java:316)
>         at
> org.apache.derby.impl.sql.GenericStatement.prepare(GenericStatement.java:88)
>         at
> org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareInternalStatement(GenericLanguageConnectionContext.java:802)
>         at
> org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:606)
>         at
> org.apache.derby.impl.jdbc.EmbedStatement.executeQuery(EmbedStatement.java:152)
> ...
> Caused by: java.lang.ClassNotFoundException:
> gaia.cu7.dal.DerbyBlobTableFunction
>         at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
>         at java.security.AccessController.doPrivileged(Native Method)
>         at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
>         at java.lang.ClassLoader.loadClass(ClassLoader.java:316)
>         at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
>         at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:374)
>         at java.lang.Class.forName0(Native Method)
>         at java.lang.Class.forName(Class.java:169)
>         at
> org.apache.derby.impl.services.reflect.ReflectClassesJava2.loadClassNotInDatabaseJar(ReflectClassesJava2.java:108)
>         at
> org.apache.derby.impl.services.reflect.DatabaseClasses.loadApplicationClass(DatabaseClasses.java:232)
>         at
> org.apache.derby.iapi.services.loader.ClassInspector.getClass(ClassInspector.java:832)
>         at
> org.apache.derby.iapi.services.loader.ClassInspector.accessible(ClassInspector.java:134)
>         at
> org.apache.derby.impl.sql.compile.QueryTreeNode.verifyClassExist(QueryTreeNode.java:1437)
>         ... 17 more
> ============= begin nested exception, level (1) ===========
> java.lang.ClassNotFoundException: gaia.cu7.dal.DerbyBlobTableFunction
>         at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
>         at java.security.AccessController.doPrivileged(Native Method)
>         at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
>         at java.lang.ClassLoader.loadClass(ClassLoader.java:316)
>         at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
>         at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:374)
>         at java.lang.Class.forName0(Native Method)
>         at java.lang.Class.forName(Class.java:169)
>         at
> org.apache.derby.impl.services.reflect.ReflectClassesJava2.loadClassNotInDatabaseJar(ReflectClassesJava2.java:108)
>         at
> org.apache.derby.impl.services.reflect.DatabaseClasses.loadApplicationClass(DatabaseClasses.java:232)
>         at
> org.apache.derby.iapi.services.loader.ClassInspector.getClass(ClassInspector.java:832)
>         at
> org.apache.derby.iapi.services.loader.ClassInspector.accessible(ClassInspector.java:134)
>         at
> org.apache.derby.impl.sql.compile.QueryTreeNode.verifyClassExist(QueryTreeNode.java:1437)
>         at
> org.apache.derby.impl.sql.compile.StaticMethodCallNode.bindExpression(StaticMethodCallNode.java:256)
>         at
> org.apache.derby.impl.sql.compile.FromVTI.bindVTITables(FromVTI.java:541)
>         at
> org.apache.derby.impl.sql.compile.FromList.bindTables(FromList.java:322)
>         at
> org.apache.derby.impl.sql.compile.SelectNode.bindNonVTITables(SelectNode.java:390)
>         at
> org.apache.derby.impl.sql.compile.DMLStatementNode.bindTables(DMLStatementNode.java:199)
>         at
> org.apache.derby.impl.sql.compile.DMLStatementNode.bind(DMLStatementNode.java:137)
>         at
> org.apache.derby.impl.sql.compile.CursorNode.bindStatement(CursorNode.java:245)
>         at
> org.apache.derby.impl.sql.GenericStatement.prepMinion(GenericStatement.java:316)
>         at
> org.apache.derby.impl.sql.GenericStatement.prepare(GenericStatement.java:88)
>         at
> org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareInternalStatement(GenericLanguageConnectionContext.java:802)
>         at
> org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:606)
>         at
> org.apache.derby.impl.jdbc.EmbedStatement.executeQuery(EmbedStatement.java:152)
> ...
> ============= end nested exception, level (1) ===========
> </log>
>
> Seems internal classpath is set properly:
>
> <log>
> Executing prepared statement: CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY
> ('derby.database.classpath', 'APP.kn') :End prepared statement
> Database Class Loader started - derby.database.classpath='APP.kn'
> 2009-03-31 11:03:39.148 GMT Thread[SQL Execution Thread 1,6,main] (XID =
> 194), (SESSIONID = 1), CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY
> ('derby.database.classpath', 'APP.kn') ******* null
> </log>
>
> Best regards,
> Krzysztof
>   


Mime
View raw message