title: Geotools cannot find HSQL EPSG DB, throws error: NoSuchAuthorityCodeException
body: <p>I am running Geotools inside of Apache Storm, and having a heck of a time with geotools dependency management. Every thing works when I run the storm cluster locally (windows 7 laptop), but when I deploy to the cluster I get this exception in my logs.</p>
  
  <p>EDIT: Here is the Java I use that calls this functionality</p>
  
  <pre><code>      GridCoverage2D image = 
  new GeoTiffReader(f).read(new GeneralParameterValue[]{policy, gridsize, useJaiRead});
          /**
           * reproject to WGS84
           */
          CoordinateReferenceSystem targetCRS = CRS.decode("EPSG:4326");
          GridCoverage2D reprojectedImage = (GridCoverage2D) Operations.DEFAULT.resample(image, targetCRS);
  </code></pre>
  
  <p>Here's my environment</p>
  
  <pre><code>geotools 11.1
  java 7
  POM is below
  running on windows 7 when in local mode (works perfectly here)
  this problem happens on Ubuntu 12.04.5 LTS (GNU/Linux 3.2.0-63-virtual x86_64)
  
  here's the exception from the log
  
  
  [ERROR] Exception in Bolt org.geotools.data.DataSourceException: GEOTIFF Module Error Report
  No code "EPSG:32637" from authority "EPSG" found for object of type "EngineeringCRS".
  ModelPixelScaleTag: [2.0,2.0,0.0]
  ModelTiePointTag: (1 tie points)
  TP #0: [0.0,0.0,0.0] -&gt; [337668.0,3837288.0,0.0]
  ModelTransformationTag: NOT AVAILABLE
  GeoKey #1: Key = 2049, Value = GCS_WGS_1984
  GeoKey #2: Key = 2054, Value = 9102
  GeoKey #3: Key = 3072, Value = 32637
  GeoKey #4: Key = 1024, Value = 1
  GeoKey #5: Key = 1025, Value = 1
  GeoKey #6: Key = 1026, Value = PCS Name = WGS_1984_UTM_zone_37N
  GeoKey #7: Key = 3076, Value = 9001
  org.opengis.referencing.NoSuchAuthorityCodeException: No code "EPSG:32637" from authority "EPSG" found for object of type "EngineeringCRS".
          at org.geotools.referencing.factory.epsg.CartesianAuthorityFactory.noSuchAuthorityException(CartesianAuthorityFactory.java:136)
          at org.geotools.referencing.factory.epsg.CartesianAuthorityFactory.createEngineeringCRS(CartesianAuthorityFactory.java:130)
          at org.geotools.referencing.factory.epsg.CartesianAuthorityFactory.createCoordinateReferenceSystem(CartesianAuthorityFactory.java:121)
          at org.geotools.referencing.factory.AuthorityFactoryAdapter.createCoordinateReferenceSystem(AuthorityFactoryAdapter.java:802)
          at org.geotools.coverage.grid.io.imageio.geotiff.GeoTiffMetadata2CRSAdapter.createProjectedCoordinateReferenceSystem(GeoTiffMetadata2CRSAdapter.java:284)
          at org.geotools.coverage.grid.io.imageio.geotiff.GeoTiffMetadata2CRSAdapter.createCoordinateSystem(GeoTiffMetadata2CRSAdapter.java:205)
          at org.geotools.gce.geotiff.GeoTiffReader.getHRInfo(GeoTiffReader.java:299)
          at org.geotools.gce.geotiff.GeoTiffReader.&lt;init&gt;(GeoTiffReader.java:211)
          at org.geotools.gce.geotiff.GeoTiffReader.&lt;init&gt;(GeoTiffReader.java:156)
          at dgi.eii.utils.PixelExtractor.extract(PixelExtractor.java:80)
          at dgi.eii.storm.bolts.RasterPixelExtractorBolt.execute(RasterPixelExtractorBolt.java:59)
          at backtype.storm.daemon.executor$fn__5641$tuple_action_fn__5643.invoke(executor.clj:631)
          at backtype.storm.daemon.executor$mk_task_receiver$fn__5564.invoke(executor.clj:399)
          at backtype.storm.disruptor$clojure_handler$reify__745.onEvent(disruptor.clj:58)
          at backtype.storm.utils.DisruptorQueue.consumeBatchToCursor(DisruptorQueue.java:125)
          at backtype.storm.utils.DisruptorQueue.consumeBatchWhenAvailable(DisruptorQueue.java:99)
          at backtype.storm.disruptor$consume_batch_when_available.invoke(disruptor.clj:80)
          at backtype.storm.daemon.executor$fn__5641$fn__5653$fn__5700.invoke(executor.clj:746)
          at backtype.storm.util$async_loop$fn__457.invoke(util.clj:431)
          at clojure.lang.AFn.run(AFn.java:24)
          at java.lang.Thread.run(Thread.java:745)
  </code></pre>
  
  <p>I also get the same error when encountering an image with EPSQ:4326</p>
  
  <pre><code> [ERROR] Exception in Bolt org.geotools.data.DataSourceException: GEOTIFF Module Error Report
  No code "EPSG:4326" from authority "EPSG" found for object of type "EngineeringCRS".
  ModelPixelScaleTag: [2.0230196490091333E-5,2.0230196490071028E-5,0.0]
  ModelTiePointTag: (1 tie points)
  TP #0: [0.0,0.0,0.0] -&gt; [36.8167576323252,34.429979601192464,0.0]
  ModelTransformationTag: NOT AVAILABLE
  GeoKey #1: Key = 2048, Value = 4326
  GeoKey #2: Key = 2049, Value = GCS_WGS_1984
  GeoKey #3: Key = 2054, Value = 9102
  GeoKey #4: Key = 1024, Value = 2
  GeoKey #5: Key = 2057, Value = 6378137.0
  GeoKey #6: Key = 1025, Value = 1
  GeoKey #7: Key = 2059, Value = 298.257223563
  org.opengis.referencing.NoSuchAuthorityCodeException: No code "EPSG:4326" from authority "EPSG" found for object of type "EngineeringCRS".
          at org.geotools.referencing.factory.epsg.CartesianAuthorityFactory.noSuchAuthorityException(CartesianAuthorityFactory.java:136)
          at org.geotools.referencing.factory.epsg.CartesianAuthorityFactory.createEngineeringCRS(CartesianAuthorityFactory.java:130)
          at org.geotools.referencing.factory.epsg.CartesianAuthorityFactory.createCoordinateReferenceSystem(CartesianAuthorityFactory.java:121)
          at org.geotools.referencing.factory.AuthorityFactoryAdapter.createCoordinateReferenceSystem(AuthorityFactoryAdapter.java:802)
          at org.geotools.coverage.grid.io.imageio.geotiff.GeoTiffMetadata2CRSAdapter.createGeographicCoordinateReferenceSystem(GeoTiffMetadata2CRSAdapter.java:389)
          at org.geotools.coverage.grid.io.imageio.geotiff.GeoTiffMetadata2CRSAdapter.createCoordinateSystem(GeoTiffMetadata2CRSAdapter.java:208)
          at org.geotools.gce.geotiff.GeoTiffReader.getHRInfo(GeoTiffReader.java:299)
          at org.geotools.gce.geotiff.GeoTiffReader.&lt;init&gt;(GeoTiffReader.java:211)
          at org.geotools.gce.geotiff.GeoTiffReader.&lt;init&gt;(GeoTiffReader.java:156)
          at dgi.eii.utils.PixelExtractor.extract(PixelExtractor.java:80)
          at dgi.eii.storm.bolts.RasterPixelExtractorBolt.execute(RasterPixelExtractorBolt.java:59)
          at backtype.storm.daemon.executor$fn__5641$tuple_action_fn__5643.invoke(executor.clj:631)
          at backtype.storm.daemon.executor$mk_task_receiver$fn__5564.invoke(executor.clj:399)
          at backtype.storm.disruptor$clojure_handler$reify__745.onEvent(disruptor.clj:58)
          at backtype.storm.utils.DisruptorQueue.consumeBatchToCursor(DisruptorQueue.java:125)
          at backtype.storm.utils.DisruptorQueue.consumeBatchWhenAvailable(DisruptorQueue.java:99)
          at backtype.storm.disruptor$consume_batch_when_available.invoke(disruptor.clj:80)
          at backtype.storm.daemon.executor$fn__5641$fn__5653$fn__5700.invoke(executor.clj:746)
          at backtype.storm.util$async_loop$fn__457.invoke(util.clj:431)
          at clojure.lang.AFn.run(AFn.java:24)
          at java.lang.Thread.run(Thread.java:745)
  </code></pre>
  
  <p>I have seen several answers that indicated I need to put the gt-epsg-hsql in my pom, and I have, still doesn't find what it needs.</p>
  
  <p>Here are my geotools POM entries</p>
  
  <pre><code> &lt;dependency&gt;
              &lt;groupId&gt;org.geotools&lt;/groupId&gt;
              &lt;artifactId&gt;gt-swing&lt;/artifactId&gt;
              &lt;version&gt;11.1&lt;/version&gt;        
          &lt;/dependency&gt;
           &lt;dependency&gt;
              &lt;groupId&gt;org.geotools&lt;/groupId&gt;
              &lt;artifactId&gt;gt-opengis&lt;/artifactId&gt;
              &lt;version&gt;11.1&lt;/version&gt;        
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.geotools&lt;/groupId&gt;
              &lt;artifactId&gt;gt-epsg-hsql&lt;/artifactId&gt;
              &lt;version&gt;11.1&lt;/version&gt;                 
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.geotools&lt;/groupId&gt;
              &lt;artifactId&gt;gt-geotiff&lt;/artifactId&gt;
              &lt;version&gt;11.1&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.geotools&lt;/groupId&gt;
              &lt;artifactId&gt;gt-image&lt;/artifactId&gt;
              &lt;version&gt;11.1&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.geotools&lt;/groupId&gt;
              &lt;artifactId&gt;gt-wms&lt;/artifactId&gt;
              &lt;version&gt;11.1&lt;/version&gt;
          &lt;/dependency&gt;
  </code></pre>
  
  <p>here is how I am building the uber-jar with maven shade plugin</p>
  
  <pre><code> &lt;build&gt;
          &lt;plugins&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-shade-plugin&lt;/artifactId&gt;
                  &lt;executions&gt;
                      &lt;execution&gt;
                          &lt;phase&gt;package&lt;/phase&gt;
                          &lt;goals&gt;
                              &lt;goal&gt;shade&lt;/goal&gt;
                          &lt;/goals&gt;
                      &lt;/execution&gt;
                  &lt;/executions&gt;
                  &lt;configuration&gt;
                      &lt;archive&gt;
                          &lt;manifestFile&gt;src/main/resources/META-INF/MANIFEST.MF&lt;/manifestFile&gt;
                      &lt;/archive&gt;
                      &lt;!--  &lt;minimizeJar&gt;true&lt;/minimizeJar&gt;--&gt;
                      &lt;shadedArtifactAttached&gt;true&lt;/shadedArtifactAttached&gt;
                      &lt;shadedClassifierName&gt;stand-alone&lt;/shadedClassifierName&gt;
                      &lt;artifactSet&gt;
                          &lt;excludes&gt;                 
                              &lt;exclude&gt;org.slf4j:slf4j-api:jar:&lt;/exclude&gt;
                              &lt;exclude&gt;org.slf4j:slf4j-simple:jar:1.6.4:jar:&lt;/exclude&gt;
                              &lt;exclude&gt;org.slf4j:slf4j-log4j12:jar:&lt;/exclude&gt;
                              &lt;exclude&gt;org.slf4j:jcl-over-slf4j:jar:&lt;/exclude&gt;
                              &lt;exclude&gt;org.slf4j:slf4j-api:jar:1.7.5:jar:&lt;/exclude&gt;
                              &lt;!-- &lt;exclude&gt;org.slf4j*:&lt;/exclude&gt;--&gt;
                              &lt;exclude&gt;commons-logging:commons-logging:jar:&lt;/exclude&gt;
                              &lt;exclude&gt;commons-logging:commons-logging-api:jar:&lt;/exclude&gt;
                          &lt;/excludes&gt;
                      &lt;/artifactSet&gt;
                      &lt;filters&gt;
                          &lt;filter&gt;
                              &lt;artifact&gt;*:*&lt;/artifact&gt;
                              &lt;excludes&gt;
                                  &lt;exclude&gt;META-INF/*.SF&lt;/exclude&gt;
                                  &lt;exclude&gt;META-INF/*.DSA&lt;/exclude&gt;
                                  &lt;exclude&gt;META-INF/*.RSA&lt;/exclude&gt;
                              &lt;/excludes&gt;
                          &lt;/filter&gt;
                      &lt;/filters&gt;
                      &lt;finalName&gt;storm-topos&lt;/finalName&gt;
                      &lt;transformers&gt;
                          &lt;transformer
                              implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"&gt;
                              &lt;mainClass&gt;dgi.eii.storm.base.StormTopologyRunner&lt;/mainClass&gt;
                          &lt;/transformer&gt;
                         &lt;!-- &lt;transformer
                              implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"&gt;
                              &lt;resource&gt;META-INF/spring.handlers&lt;/resource&gt;
                          &lt;/transformer&gt;
                          &lt;transformer
                              implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"&gt;
                              &lt;resource&gt;META-INF/spring.schemas&lt;/resource&gt;
                          &lt;/transformer&gt;--&gt;
                      &lt;/transformers&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
      &lt;/build&gt;
  </code></pre>
  
  <p>EDIT:
  So i figured out a few things and got a little further... now getting this error</p>
  
  <pre><code>[ERROR] Exception in Bolt org.geotools.data.DataSourceException: org.hsqldb.DatabaseURL.parseURL(Ljava/lang/String;ZZ)Lorg/hsqldb/persist/HsqlProperties;
  </code></pre>
  
  <p>This slight advancement that led to the above new error was due to using the right transformers, and using the maven jar plugin to inject the right entries into the MANIFEST.MF file. Here is the new build section of my POM, which might help someone at least overcome the consolidation of geotools' META-INF/services files and to inject the right entries to overcome the old <code>vendorname cannot be null!</code> error</p>
  
  <pre><code>&lt;build&gt;
      &lt;resources&gt;
          &lt;resource&gt;
              &lt;directory&gt;${basedir}/src/main/resources&lt;/directory&gt;
              &lt;filtering&gt;false&lt;/filtering&gt;
              &lt;includes&gt;
                  &lt;include&gt;schema.xsd&lt;/include&gt;
              &lt;/includes&gt;
          &lt;/resource&gt;
      &lt;/resources&gt;
      &lt;plugins&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
              &lt;artifactId&gt;maven-shade-plugin&lt;/artifactId&gt;
              &lt;executions&gt;
                  &lt;execution&gt;
                      &lt;phase&gt;package&lt;/phase&gt;
                      &lt;goals&gt;
                          &lt;goal&gt;shade&lt;/goal&gt;
                      &lt;/goals&gt;
                  &lt;/execution&gt;
              &lt;/executions&gt;
              &lt;configuration&gt;
                  &lt;shadedArtifactAttached&gt;true&lt;/shadedArtifactAttached&gt;
                  &lt;shadedClassifierName&gt;stand-alone&lt;/shadedClassifierName&gt;
                  &lt;artifactSet&gt;
                      &lt;excludes&gt;
                          &lt;exclude&gt;org.slf4j:slf4j-api:jar:&lt;/exclude&gt;
                          &lt;exclude&gt;org.slf4j:slf4j-log4j12:jar:&lt;/exclude&gt;
                          &lt;exclude&gt;org.slf4j:jcl-over-slf4j:jar:&lt;/exclude&gt;
  
                          &lt;exclude&gt;commons-logging:commons-logging:jar:&lt;/exclude&gt;
                          &lt;exclude&gt;commons-logging:commons-logging-api:jar:&lt;/exclude&gt;
                      &lt;/excludes&gt;
                  &lt;/artifactSet&gt;
                  &lt;filters&gt;
                      &lt;filter&gt;
                          &lt;artifact&gt;*:*&lt;/artifact&gt;
                          &lt;excludes&gt;
                              &lt;exclude&gt;META-INF/*.SF&lt;/exclude&gt;
                              &lt;exclude&gt;META-INF/*.DSA&lt;/exclude&gt;
                              &lt;exclude&gt;META-INF/*.RSA&lt;/exclude&gt;
                          &lt;/excludes&gt;
                      &lt;/filter&gt;
                  &lt;/filters&gt;
                  &lt;finalName&gt;insightcloud-storm-topos&lt;/finalName&gt;
                  &lt;transformers&gt;
                      &lt;transformer
                          implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"&gt;
                          &lt;mainClass&gt;dgi.eii.storm.base.StormTopologyRunner&lt;/mainClass&gt;
                      &lt;/transformer&gt;
                      &lt;transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/&gt;
  
                      &lt;transformer
                          implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"&gt;
                          &lt;resource&gt;META-INF/spring.handlers&lt;/resource&gt;
                      &lt;/transformer&gt;
                      &lt;transformer
                          implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"&gt;
                          &lt;resource&gt;META-INF/spring.schemas&lt;/resource&gt;
                      &lt;/transformer&gt;
                  &lt;/transformers&gt;
              &lt;/configuration&gt;
          &lt;/plugin&gt;
  
          &lt;plugin&gt;
              &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
              &lt;artifactId&gt;maven-jar-plugin&lt;/artifactId&gt;
              &lt;configuration&gt;
                  &lt;archive&gt;
                      &lt;manifestFile&gt;src/main/resources/META-INF/MANIFEST.MF&lt;/manifestFile&gt;
                  &lt;/archive&gt;
              &lt;/configuration&gt;
          &lt;/plugin&gt;
      &lt;/plugins&gt;
  
  &lt;/build&gt;
  </code></pre>