Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 10.7.1.1, 10.8.1.2, 10.8.2.2
    • Fix Version/s: 10.8.2.2, 10.9.1.0
    • Component/s: Demos/Scripts
    • Labels:
      None
    • Bug behavior facts:
      Regression

      Description

      The toursdb that's bundled with 10.7.1.1 and 10.8.1.2 (and the 10.8.2.1 release candidate) has no rows in the MAPS table. Version 10.6.2.1 had three rows in that table:

      ij> select * from maps;
      MAP_ID |MAP_NAME |REGION |AREA |PHOTO_FORMAT |PICTURE
      --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
      1 |North Ocean |Cup Island |1776.1100 |gif |4749463839613601fe00f70000000000800000008000808000000080800080008080808080c0c0c0ff000000ff00ffff000000ffff00ff00ffffffffff00000&
      2 |Middle Ocean |Small Island |1166.7700 |gif |47494638396192008e00f70000000000800000008000808000000080800080008080808080c0c0c0ff000000ff00ffff000000ffff00ff00ffffffffff00000&
      3 |South Ocean |Witch Island |9117.9000 |gif |474946383961f602f301f70000000000800000008000808000000080800080008080808080c0c0c0ff000000ff00ffff000000ffff00ff00ffffffffff00000&

      3 rows selected

      Building it on a clean trunk and looking at generated/toursdb/toursdb.out gives the following hint:

      FAIL – unexpected exception: java.sql.SQLException: Database 'toursDB' not found.
      java.sql.SQLException: Database 'toursDB' not found.
      at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(SQLExceptionFactory40.java:98)
      at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Util.java:142)
      at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Util.java:148)
      at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Util.java:227)
      at org.apache.derby.impl.jdbc.EmbedConnection.newSQLException(EmbedConnection.java:3085)
      at org.apache.derby.impl.jdbc.EmbedConnection.handleDBNotFound(EmbedConnection.java:735)
      at org.apache.derby.impl.jdbc.EmbedConnection.<init>(EmbedConnection.java:414)
      at org.apache.derby.impl.jdbc.EmbedConnection30.<init>(EmbedConnection30.java:73)
      at org.apache.derby.impl.jdbc.EmbedConnection40.<init>(EmbedConnection40.java:51)
      at org.apache.derby.jdbc.Driver40.getNewEmbedConnection(Driver40.java:70)
      at org.apache.derby.jdbc.InternalDriver.connect(InternalDriver.java:248)
      at org.apache.derby.jdbc.AutoloadedDriver.connect(AutoloadedDriver.java:146)
      at java.sql.DriverManager.getConnection(DriverManager.java:582)
      at java.sql.DriverManager.getConnection(DriverManager.java:207)
      at toursdb.insertMaps.main(insertMaps.java:51)
      Caused by: java.sql.SQLException: Database 'toursDB' not found.
      at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:45)
      at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(SQLExceptionFactory40.java:122)
      at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(SQLExceptionFactory40.java:71)
      ... 14 more

      I suspect this was introduced by the changes in DERBY-3986 when the destination directory for toursdb was changed.

      1. d5438.diff
        3 kB
        Knut Anders Hatlen

        Activity

        Hide
        Knut Anders Hatlen added a comment -

        Actually, the exception isn't caused by the moving, but rather because insertMaps uses the url jdbc:derby:toursDB (mixed case), whereas the ij script that creates the database uses jdbc:derby:toursdb (lower case). It might have worked before on case-insensitive file systems. After adjusting the URL to match the one in the script, I see this exception instead:

        Exception in thread "main" java.io.FileNotFoundException: cupisle.gif (No such file or directory)
        at java.io.FileInputStream.open(Native Method)
        at java.io.FileInputStream.<init>(FileInputStream.java:120)
        at toursdb.insertMaps.insertRows(insertMaps.java:74)
        at toursdb.insertMaps.main(insertMaps.java:51)

        Show
        Knut Anders Hatlen added a comment - Actually, the exception isn't caused by the moving, but rather because insertMaps uses the url jdbc:derby:toursDB (mixed case), whereas the ij script that creates the database uses jdbc:derby:toursdb (lower case). It might have worked before on case-insensitive file systems. After adjusting the URL to match the one in the script, I see this exception instead: Exception in thread "main" java.io.FileNotFoundException: cupisle.gif (No such file or directory) at java.io.FileInputStream.open(Native Method) at java.io.FileInputStream.<init>(FileInputStream.java:120) at toursdb.insertMaps.insertRows(insertMaps.java:74) at toursdb.insertMaps.main(insertMaps.java:51)
        Hide
        Knut Anders Hatlen added a comment -

        Attaching a patch that makes the following changes:

        1) Stop catching and printing exceptions in insertMaps.main(). Instead let the method throw the exception so that the exit status of the Java process reflects that it failed, and the build stops. With this change only, "ant all" fails with this message:

        BUILD FAILED
        /code/derby/trunk/build.xml:625: The following error occurred while executing this line:
        /code/derby/trunk/java/demo/build.xml:125: The following error occurred while executing this line:
        /code/derby/trunk/java/demo/toursdb/build.xml:92: Java returned: 1

        Then we'll notice if similar problems are introduced later.

        2) Change the URL used by insertMaps to match the one used in build.xml (toursDB -> toursdb) to fix the database not found error.

        3) Change the directory for the Java process that runs insertMaps to java/demo/toursdb, to avoid the FileNotFoundExceptions, and instead set derby.system.home to make derby.log and the database end up in generated/toursdb.

        With these changes, the MAPS table gets populated when I run "ant all" in my environment.

        Show
        Knut Anders Hatlen added a comment - Attaching a patch that makes the following changes: 1) Stop catching and printing exceptions in insertMaps.main(). Instead let the method throw the exception so that the exit status of the Java process reflects that it failed, and the build stops. With this change only, "ant all" fails with this message: BUILD FAILED /code/derby/trunk/build.xml:625: The following error occurred while executing this line: /code/derby/trunk/java/demo/build.xml:125: The following error occurred while executing this line: /code/derby/trunk/java/demo/toursdb/build.xml:92: Java returned: 1 Then we'll notice if similar problems are introduced later. 2) Change the URL used by insertMaps to match the one used in build.xml (toursDB -> toursdb) to fix the database not found error. 3) Change the directory for the Java process that runs insertMaps to java/demo/toursdb, to avoid the FileNotFoundExceptions, and instead set derby.system.home to make derby.log and the database end up in generated/toursdb. With these changes, the MAPS table gets populated when I run "ant all" in my environment.
        Hide
        Knut Anders Hatlen added a comment -

        Committed revision 1177589.
        Merged to 10.8 and committed revision 1177591.

        Show
        Knut Anders Hatlen added a comment - Committed revision 1177589. Merged to 10.8 and committed revision 1177591.
        Hide
        Dag H. Wanvik added a comment -

        Changes look good to me. +1

        Show
        Dag H. Wanvik added a comment - Changes look good to me. +1

          People

          • Assignee:
            Knut Anders Hatlen
            Reporter:
            Knut Anders Hatlen
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development