Uploaded image for project: 'Derby'
  1. Derby
  2. DERBY-5951

Missing method exception raised when using Clobs with territory based collation

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 10.10.1.1
    • Fix Version/s: 10.8.3.0, 10.9.2.2, 10.10.1.1
    • Component/s: SQL
    • Labels:
      None
    • Urgency:
      Normal
    • Issue & fix info:
      Repro attached

      Description

      When using territory-based collation with Clobs, Derby raises an error trying to invoke a missing method. The following script shows this problem:

      connect 'jdbc:derby:memory:db;create=true;collation=TERRITORY_BASED';

      create function makeClob( contents varchar( 32672 ) ) returns clob
      language java parameter style java no sql deterministic
      external name 'org.apache.derbyTesting.functionTests.tests.lang.UserDefinedAggregatesTest.makeClob';

      create table clobTable( a clob );

      – fails with a java.lang.NoSuchMethodError exception
      insert into clobTable( a ) values ( makeClob( 'a' ) );

      connect 'jdbc:derby:memory:db1;create=true';

      create function makeClob( contents varchar( 32672 ) ) returns clob
      language java parameter style java no sql deterministic
      external name 'org.apache.derbyTesting.functionTests.tests.lang.UserDefinedAggregatesTest.makeClob';

      create table clobTable( a clob );

      – succeeds
      insert into clobTable( a ) values ( makeClob( 'a' ) );

      Here is the error:

      ERROR 38000: The exception 'java.lang.NoSuchMethodError: org.apache.derby.iapi.types.DataValueFactory.getClobDataValue(Ljava/sql/Clob;Lorg/apache/derby/iapi/types/StringDataValue;I)Lorg/apache/derby/iapi/types/StringDataValue;' was thrown while evaluating an expression.
      ERROR XJ001: Java exception: 'org.apache.derby.iapi.types.DataValueFactory.getClobDataValue(Ljava/sql/Clob;Lorg/apache/derby/iapi/types/StringDataValue;I)Lorg/apache/derby/iapi/types/StringDataValue;: java.lang.NoSuchMethodError'.

      ...and here is the stack trace:

      Tue Oct 16 08:27:23 PDT 2012 Thread[main,5,main] (XID = 172), (SESSIONID = 1), (DATABASE = memory:db), (DRDAID = null), Failed Statement is: – fails with a java.lang.NoSuchMethodError exception
      insert into clobTable( a ) values ( makeClob( 'a' ) )
      ERROR 38000: The exception 'java.lang.NoSuchMethodError: org.apache.derby.iapi.types.DataValueFactory.getClobDataValue(Ljava/sql/Clob;Lorg/apache/derby/iapi/types/StringDataValue;I)Lorg/apache/derby/iapi/types/StringDataValue;' was thrown while evaluating an expression.
      at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
      at org.apache.derby.iapi.error.StandardException.unexpectedUserException(Unknown Source)
      at org.apache.derby.impl.services.reflect.DirectCall.invoke(Unknown Source)
      at org.apache.derby.impl.sql.execute.RowResultSet.getNextRowCore(Unknown Source)
      at org.apache.derby.impl.sql.execute.DMLWriteResultSet.getNextRowCore(Unknown Source)
      at org.apache.derby.impl.sql.execute.InsertResultSet.open(Unknown Source)
      at org.apache.derby.impl.sql.GenericPreparedStatement.executeStmt(Unknown Source)
      at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown Source)
      at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown Source)
      at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source)
      at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source)
      at org.apache.derby.impl.tools.ij.ij.executeImmediate(Unknown Source)
      at org.apache.derby.impl.tools.ij.utilMain.doCatch(Unknown Source)
      at org.apache.derby.impl.tools.ij.utilMain.runScriptGuts(Unknown Source)
      at org.apache.derby.impl.tools.ij.utilMain.go(Unknown Source)
      at org.apache.derby.impl.tools.ij.Main.go(Unknown Source)
      at org.apache.derby.impl.tools.ij.Main.mainCore(Unknown Source)
      at org.apache.derby.impl.tools.ij.Main.main(Unknown Source)
      at org.apache.derby.tools.ij.main(Unknown Source)
      Caused by: java.lang.NoSuchMethodError: org.apache.derby.iapi.types.DataValueFactory.getClobDataValue(Ljava/sql/Clob;Lorg/apache/derby/iapi/types/StringDataValue;I)Lorg/apache/derby/iapi/types/StringDataValue;
      at org.apache.derby.exe.ace50d80a4x013ax6a2fxb54bx00000467ed600.e0(Unknown Source)
      ... 17 more

        Attachments

        1. enable-test.diff
          10 kB
          Knut Anders Hatlen
        2. derby-5951-01-aa-addMissingMethod.diff
          6 kB
          Rick Hillegas

          Activity

            People

            • Assignee:
              rhillegas Rick Hillegas
              Reporter:
              rhillegas Rick Hillegas
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: