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-6511) java.lang.NoSuchMethodError chaining a function and procedure
Date Fri, 14 Mar 2014 18:04:45 GMT

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

Rick Hillegas updated DERBY-6511:
---------------------------------

    Description: java.lang.NoSuchMethodError is raised when calling a procedure which takes
an Integer argument and passing it the result of a function which returns an int. The error
is raised in generated code.  (was: I will attach a script showing this problem: a java.lang.NoSuchMethodError
while running an after delete trigger involving a user-defined function and procedure. The
error comes from generated code. My initial analysis of the problem is this:

1) The function returns an int.

2) Which is then passed to the procedure, which takes an Integer.

3) But no code is generated to convert the int to Integer.

Here is the stack trace:

ERROR XJ001: Java exception: 'org.apache.derbyTesting.functionTests.tests.lang.MergeStatementTest.addHistoryRow(Ljava/lang/String;I)V:
java.lang.NoSuchMethodError'.
java.sql.SQLException: Java exception: 'org.apache.derbyTesting.functionTests.tests.lang.MergeStatementTest.addHistoryRow(Ljava/lang/String;I)V:
java.lang.NoSuchMethodError'.
	at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:107)
	at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:133)
	at org.apache.derby.impl.jdbc.Util.seeNextException(Util.java:255)
	at org.apache.derby.impl.jdbc.Util.javaException(Util.java:277)
	at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(TransactionResourceImpl.java:437)
	at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(TransactionResourceImpl.java:432)
	at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(TransactionResourceImpl.java:353)
	at org.apache.derby.impl.jdbc.EmbedConnection.handleException(EmbedConnection.java:2396)
	at org.apache.derby.impl.jdbc.ConnectionChild.handleException(ConnectionChild.java:82)
	at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1430)
	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:704)
	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:631)
	at org.apache.derby.impl.tools.ij.ij.executeImmediate(ij.java:367)
	at org.apache.derby.impl.tools.ij.utilMain.doCatch(utilMain.java:527)
	at org.apache.derby.impl.tools.ij.utilMain.runScriptGuts(utilMain.java:369)
	at org.apache.derby.impl.tools.ij.utilMain.go(utilMain.java:245)
	at org.apache.derby.impl.tools.ij.Main.go(Main.java:229)
	at org.apache.derby.impl.tools.ij.Main.mainCore(Main.java:184)
	at org.apache.derby.impl.tools.ij.Main.main(Main.java:75)
	at org.apache.derby.tools.ij.main(ij.java:59)
Caused by: ERROR XJ001: Java exception: 'org.apache.derbyTesting.functionTests.tests.lang.MergeStatementTest.addHistoryRow(Ljava/lang/String;I)V:
java.lang.NoSuchMethodError'.
	at org.apache.derby.iapi.error.StandardException.newException(StandardException.java:290)
	at org.apache.derby.impl.jdbc.SQLExceptionFactory.wrapArgsForTransportAcrossDRDA(SQLExceptionFactory.java:162)
	at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:74)
	... 19 more
Caused by: java.lang.NoSuchMethodError: org.apache.derbyTesting.functionTests.tests.lang.MergeStatementTest.addHistoryRow(Ljava/lang/String;I)V
	at org.apache.derby.exe.ac4d3680a5x0144xc1b2x5cafx00000436ffe80.g0(Unknown Source)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:483)
	at org.apache.derby.impl.services.reflect.ReflectMethod.invoke(ReflectMethod.java:46)
	at org.apache.derby.impl.sql.execute.CallStatementResultSet.open(CallStatementResultSet.java:75)
	at org.apache.derby.impl.sql.GenericPreparedStatement.executeStmt(GenericPreparedStatement.java:470)
	at org.apache.derby.impl.sql.GenericPreparedStatement.executeSubStatement(GenericPreparedStatement.java:336)
	at org.apache.derby.impl.sql.execute.GenericTriggerExecutor.executeSPS(GenericTriggerExecutor.java:216)
	at org.apache.derby.impl.sql.execute.GenericTriggerExecutor.executeWhenClauseAndAction(GenericTriggerExecutor.java:346)
	at org.apache.derby.impl.sql.execute.RowTriggerExecutor.fireTrigger(RowTriggerExecutor.java:113)
	at org.apache.derby.impl.sql.execute.TriggerEventActivator.notifyEvent(TriggerEventActivator.java:272)
	at org.apache.derby.impl.sql.execute.DeleteResultSet.fireAfterTriggers(DeleteResultSet.java:464)
	at org.apache.derby.impl.sql.execute.DeleteResultSet.open(DeleteResultSet.java:157)
	at org.apache.derby.impl.sql.GenericPreparedStatement.executeStmt(GenericPreparedStatement.java:470)
	at org.apache.derby.impl.sql.GenericPreparedStatement.execute(GenericPreparedStatement.java:349)
	at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1338)
	... 10 more
============= begin nested exception, level (1) ===========
ERROR XJ001: Java exception: 'org.apache.derbyTesting.functionTests.tests.lang.MergeStatementTest.addHistoryRow(Ljava/lang/String;I)V:
java.lang.NoSuchMethodError'.
	at org.apache.derby.iapi.error.StandardException.newException(StandardException.java:290)
	at org.apache.derby.impl.jdbc.SQLExceptionFactory.wrapArgsForTransportAcrossDRDA(SQLExceptionFactory.java:162)
	at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:74)
	at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:133)
	at org.apache.derby.impl.jdbc.Util.seeNextException(Util.java:255)
	at org.apache.derby.impl.jdbc.Util.javaException(Util.java:277)
	at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(TransactionResourceImpl.java:437)
	at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(TransactionResourceImpl.java:432)
	at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(TransactionResourceImpl.java:353)
	at org.apache.derby.impl.jdbc.EmbedConnection.handleException(EmbedConnection.java:2396)
	at org.apache.derby.impl.jdbc.ConnectionChild.handleException(ConnectionChild.java:82)
	at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1430)
	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:704)
	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:631)
	at org.apache.derby.impl.tools.ij.ij.executeImmediate(ij.java:367)
	at org.apache.derby.impl.tools.ij.utilMain.doCatch(utilMain.java:527)
	at org.apache.derby.impl.tools.ij.utilMain.runScriptGuts(utilMain.java:369)
	at org.apache.derby.impl.tools.ij.utilMain.go(utilMain.java:245)
	at org.apache.derby.impl.tools.ij.Main.go(Main.java:229)
	at org.apache.derby.impl.tools.ij.Main.mainCore(Main.java:184)
	at org.apache.derby.impl.tools.ij.Main.main(Main.java:75)
	at org.apache.derby.tools.ij.main(ij.java:59)
Caused by: java.lang.NoSuchMethodError: org.apache.derbyTesting.functionTests.tests.lang.MergeStatementTest.addHistoryRow(Ljava/lang/String;I)V
	at org.apache.derby.exe.ac4d3680a5x0144xc1b2x5cafx00000436ffe80.g0(Unknown Source)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:483)
	at org.apache.derby.impl.services.reflect.ReflectMethod.invoke(ReflectMethod.java:46)
	at org.apache.derby.impl.sql.execute.CallStatementResultSet.open(CallStatementResultSet.java:75)
	at org.apache.derby.impl.sql.GenericPreparedStatement.executeStmt(GenericPreparedStatement.java:470)
	at org.apache.derby.impl.sql.GenericPreparedStatement.executeSubStatement(GenericPreparedStatement.java:336)
	at org.apache.derby.impl.sql.execute.GenericTriggerExecutor.executeSPS(GenericTriggerExecutor.java:216)
	at org.apache.derby.impl.sql.execute.GenericTriggerExecutor.executeWhenClauseAndAction(GenericTriggerExecutor.java:346)
	at org.apache.derby.impl.sql.execute.RowTriggerExecutor.fireTrigger(RowTriggerExecutor.java:113)
	at org.apache.derby.impl.sql.execute.TriggerEventActivator.notifyEvent(TriggerEventActivator.java:272)
	at org.apache.derby.impl.sql.execute.DeleteResultSet.fireAfterTriggers(DeleteResultSet.java:464)
	at org.apache.derby.impl.sql.execute.DeleteResultSet.open(DeleteResultSet.java:157)
	at org.apache.derby.impl.sql.GenericPreparedStatement.executeStmt(GenericPreparedStatement.java:470)
	at org.apache.derby.impl.sql.GenericPreparedStatement.execute(GenericPreparedStatement.java:349)
	at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1338)
	... 10 more
============= end nested exception, level (1) ===========
============= begin nested exception, level (2) ===========
java.lang.NoSuchMethodError: org.apache.derbyTesting.functionTests.tests.lang.MergeStatementTest.addHistoryRow(Ljava/lang/String;I)V
	at org.apache.derby.exe.ac4d3680a5x0144xc1b2x5cafx00000436ffe80.g0(Unknown Source)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:483)
	at org.apache.derby.impl.services.reflect.ReflectMethod.invoke(ReflectMethod.java:46)
	at org.apache.derby.impl.sql.execute.CallStatementResultSet.open(CallStatementResultSet.java:75)
	at org.apache.derby.impl.sql.GenericPreparedStatement.executeStmt(GenericPreparedStatement.java:470)
	at org.apache.derby.impl.sql.GenericPreparedStatement.executeSubStatement(GenericPreparedStatement.java:336)
	at org.apache.derby.impl.sql.execute.GenericTriggerExecutor.executeSPS(GenericTriggerExecutor.java:216)
	at org.apache.derby.impl.sql.execute.GenericTriggerExecutor.executeWhenClauseAndAction(GenericTriggerExecutor.java:346)
	at org.apache.derby.impl.sql.execute.RowTriggerExecutor.fireTrigger(RowTriggerExecutor.java:113)
	at org.apache.derby.impl.sql.execute.TriggerEventActivator.notifyEvent(TriggerEventActivator.java:272)
	at org.apache.derby.impl.sql.execute.DeleteResultSet.fireAfterTriggers(DeleteResultSet.java:464)
	at org.apache.derby.impl.sql.execute.DeleteResultSet.open(DeleteResultSet.java:157)
	at org.apache.derby.impl.sql.GenericPreparedStatement.executeStmt(GenericPreparedStatement.java:470)
	at org.apache.derby.impl.sql.GenericPreparedStatement.execute(GenericPreparedStatement.java:349)
	at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1338)
	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:704)
	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:631)
	at org.apache.derby.impl.tools.ij.ij.executeImmediate(ij.java:367)
	at org.apache.derby.impl.tools.ij.utilMain.doCatch(utilMain.java:527)
	at org.apache.derby.impl.tools.ij.utilMain.runScriptGuts(utilMain.java:369)
	at org.apache.derby.impl.tools.ij.utilMain.go(utilMain.java:245)
	at org.apache.derby.impl.tools.ij.Main.go(Main.java:229)
	at org.apache.derby.impl.tools.ij.Main.mainCore(Main.java:184)
	at org.apache.derby.impl.tools.ij.Main.main(Main.java:75)
	at org.apache.derby.tools.ij.main(ij.java:59)
)
        Summary: java.lang.NoSuchMethodError chaining a function and procedure  (was: java.lang.NoSuchMethodError
while executing an after delete trigger)

The trigger is a red herring. You can reproduce this problem with just a function and a procedure.

> java.lang.NoSuchMethodError chaining a function and procedure
> -------------------------------------------------------------
>
>                 Key: DERBY-6511
>                 URL: https://issues.apache.org/jira/browse/DERBY-6511
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.11.0.0
>            Reporter: Rick Hillegas
>            Assignee: Rick Hillegas
>         Attachments: derby-6511.sql
>
>
> java.lang.NoSuchMethodError is raised when calling a procedure which takes an Integer
argument and passing it the result of a function which returns an int. The error is raised
in generated code.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message