GeoTools
  1. GeoTools
  2. GEOT-2776

H2 EPSG Authority temporary database URL on mac

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 2.6-RC1
    • Fix Version/s: 2.7.5
    • Component/s: referencing
    • Labels:
      None
    • Environment:

      Description

      H2 EPSG authority has a build failure on mac .... given then problem " File not found: /private/var/folders/xv/xvN1hpRQE-8KP+iyx3ETuU+++TI/Tmp/Geotools/Databases/EPSG-H2-7.1.0/EPSG.lobs.db/2.lobs.db/672.t49.lob.db [90124-104]" I am guessing that the H2 code is tripping up on the File/URL boundary that we addressed in GeoTools using a couple of DataUtilities methods.

      We need to check if we create this temporary file; of if H2 is doing it internally.

      Oct 10, 2009 10:36:18 AM org.geotools.referencing.operation.AuthorityBackedFactory createFromDatabase
      WARNING: Failed to create a coordinate operation from "European Petroleum Survey Group" authority factory.
      org.opengis.referencing.FactoryException: Database failure while creating a 'OperationMethod' object for code "9651".
      at org.geotools.referencing.factory.epsg.DirectEpsgFactory.databaseFailure(DirectEpsgFactory.java:2889)
      at org.geotools.referencing.factory.epsg.DirectEpsgFactory.createOperationMethod(DirectEpsgFactory.java:2272)
      at org.geotools.referencing.factory.BufferedAuthorityFactory.createOperationMethod(BufferedAuthorityFactory.java:1016)
      at org.geotools.referencing.factory.epsg.DirectEpsgFactory.createCoordinateOperation(DirectEpsgFactory.java:2496)
      at org.geotools.referencing.factory.BufferedAuthorityFactory.createCoordinateOperation(BufferedAuthorityFactory.java:1039)
      at org.geotools.referencing.factory.epsg.DirectEpsgFactory.createCoordinateOperation(DirectEpsgFactory.java:2584)
      at org.geotools.referencing.factory.BufferedAuthorityFactory.createCoordinateOperation(BufferedAuthorityFactory.java:1039)
      at org.geotools.referencing.factory.epsg.CoordinateOperationSet.createObject(CoordinateOperationSet.java:91)
      at org.geotools.referencing.factory.IdentifiedObjectSet$Iter.toNext(IdentifiedObjectSet.java:392)
      at org.geotools.referencing.factory.IdentifiedObjectSet$Iter.<init>(IdentifiedObjectSet.java:376)
      at org.geotools.referencing.factory.IdentifiedObjectSet.iterator(IdentifiedObjectSet.java:219)
      at org.geotools.referencing.factory.IdentifiedObjectSet.resolve(IdentifiedObjectSet.java:237)
      at org.geotools.referencing.factory.epsg.DirectEpsgFactory.createFromCoordinateReferenceSystemCodes(DirectEpsgFactory.java:2736)
      at org.geotools.referencing.factory.BufferedAuthorityFactory.createFromCoordinateReferenceSystemCodes(BufferedAuthorityFactory.java:1063)
      at org.geotools.referencing.operation.AuthorityBackedFactory.createFromDatabase(AuthorityBackedFactory.java:248)
      at org.geotools.referencing.operation.DefaultCoordinateOperationFactory.createOperation(DefaultCoordinateOperationFactory.java:202)
      at org.geotools.referencing.operation.BufferedCoordinateOperationFactory.createOperation(BufferedCoordinateOperationFactory.java:254)
      at org.geotools.referencing.factory.epsg.DefaultFactoryTest.testSerialization(DefaultFactoryTest.java:521)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.junit.internal.runners.TestMethod.invoke(TestMethod.java:59)
      at org.junit.internal.runners.MethodRoadie.runTestMethod(MethodRoadie.java:98)
      at org.junit.internal.runners.MethodRoadie$2.run(MethodRoadie.java:79)
      at org.junit.internal.runners.MethodRoadie.runBeforesThenTestThenAfters(MethodRoadie.java:87)
      at org.junit.internal.runners.MethodRoadie.runTest(MethodRoadie.java:77)
      at org.junit.internal.runners.MethodRoadie.run(MethodRoadie.java:42)
      at org.junit.internal.runners.JUnit4ClassRunner.invokeTestMethod(JUnit4ClassRunner.java:88)
      at org.junit.internal.runners.JUnit4ClassRunner.runMethods(JUnit4ClassRunner.java:51)
      at org.junit.internal.runners.JUnit4ClassRunner$1.run(JUnit4ClassRunner.java:44)
      at org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:27)
      at org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:37)
      at org.junit.internal.runners.JUnit4ClassRunner.run(JUnit4ClassRunner.java:42)
      at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
      at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
      at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
      at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:345)
      at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1009)
      Caused by: org.h2.jdbc.JdbcSQLException: File not found: /private/var/folders/xv/xvN1hpRQE-8KP+iyx3ETuU+++TI/Tmp/Geotools/Databases/EPSG-H2-7.1.0/EPSG.lobs.db/2.lobs.db/672.t49.lob.db [90124-104]
      at org.h2.message.Message.getSQLException(Message.java:103)
      at org.h2.message.Message.getSQLException(Message.java:114)
      at org.h2.message.Message.getSQLException(Message.java:77)
      at org.h2.engine.Database.openFile(Database.java:448)
      at org.h2.value.ValueLob.getInputStream(ValueLob.java:635)
      at org.h2.value.ValueLob.getReader(ValueLob.java:625)
      at org.h2.value.ValueLob.getString(ValueLob.java:555)
      at org.h2.jdbc.JdbcResultSet.getString(JdbcResultSet.java:267)
      at org.geotools.referencing.factory.epsg.DirectEpsgFactory.createOperationMethod(DirectEpsgFactory.java:2257)
      ... 42 more

        Activity

        Hide
        Jody Garnett added a comment -
        Stepping through the code it correctly produces the following "source":
        {panel}
        jdbc:h2:/var/folders/xv/xvN1hpRQE-8KP+iyx3ETuU+++TI/-Tmp-/Geotools/Databases/EPSG-H2-7.1.0/EPSG;AUTO_RECONNECT=TRUE;CACHE_SIZE=131072;CACHE_TYPE=TQ
        {panel}

        I am not quite sure how to handle this; the comments already indicate that H2 does not want to see an encoded URL. I think we may need to revert the version of H2 used; or store the H2 database in the user's home directory as a temporary measure.
        Show
        Jody Garnett added a comment - Stepping through the code it correctly produces the following "source": {panel} jdbc:h2:/var/folders/xv/xvN1hpRQE-8KP+iyx3ETuU+++TI/-Tmp-/Geotools/Databases/EPSG-H2-7.1.0/EPSG;AUTO_RECONNECT=TRUE;CACHE_SIZE=131072;CACHE_TYPE=TQ {panel} I am not quite sure how to handle this; the comments already indicate that H2 does not want to see an encoded URL. I think we may need to revert the version of H2 used; or store the H2 database in the user's home directory as a temporary measure.
        Hide
        Jody Garnett added a comment -
        It seems that removing the directory and allowing it to recreate the database again did the trick. I managed to get a NPE during the readonly method over the course of testing.

        A patch is supplied which fixes up some of the logic to get the directory given a jdbc url
        Show
        Jody Garnett added a comment - It seems that removing the directory and allowing it to recreate the database again did the trick. I managed to get a NPE during the readonly method over the course of testing. A patch is supplied which fixes up some of the logic to get the directory given a jdbc url
        Hide
        Andrea Aime added a comment -
        Jody, is this still an issue?
        Show
        Andrea Aime added a comment - Jody, is this still an issue?
        Hide
        Jody Garnett added a comment -
        No it is not - we consistently used the DataUtilities methods to account for this strangeness.
        Show
        Jody Garnett added a comment - No it is not - we consistently used the DataUtilities methods to account for this strangeness.

          People

          • Assignee:
            Andrea Aime
            Reporter:
            Jody Garnett
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: