I run Geotools inside Apache Storm and take time using geotools dependency management. Everything works when I start the storm cluster locally (Windows 7 laptop), but when I deploy the cluster, I get this exception in my logs.
EDIT: I am using Java which calls this function
GridCoverage2D image = new GeoTiffReader(f).read(new GeneralParameterValue[]{policy, gridsize, useJaiRead}); CoordinateReferenceSystem targetCRS = CRS.decode("EPSG:4326"); GridCoverage2D reprojectedImage = (GridCoverage2D) Operations.DEFAULT.resample(image, targetCRS);
Here is my environment
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 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
I also get the same error when meeting with EPSQ: 4326
[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] -> [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.<init>(GeoTiffReader.java:211) at org.geotools.gce.geotiff.GeoTiffReader.<init>(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)
I saw several answers stating that I needed to put gt-epsg-hsql in my pom, and I still could not find what it needed.
Here are my POM geometries
<dependency> <groupId>org.geotools</groupId> <artifactId>gt-swing</artifactId> <version>11.1</version> </dependency> <dependency> <groupId>org.geotools</groupId> <artifactId>gt-opengis</artifactId> <version>11.1</version> </dependency> <dependency> <groupId>org.geotools</groupId> <artifactId>gt-epsg-hsql</artifactId> <version>11.1</version> </dependency> <dependency> <groupId>org.geotools</groupId> <artifactId>gt-geotiff</artifactId> <version>11.1</version> </dependency> <dependency> <groupId>org.geotools</groupId> <artifactId>gt-image</artifactId> <version>11.1</version> </dependency> <dependency> <groupId>org.geotools</groupId> <artifactId>gt-wms</artifactId> <version>11.1</version> </dependency>
this is how i build uber-jar with maven shade plugin
<build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-shade-plugin</artifactId> <executions> <execution> <phase>package</phase> <goals> <goal>shade</goal> </goals> </execution> </executions> <configuration> <archive> <manifestFile>src/main/resources/META-INF/MANIFEST.MF</manifestFile> </archive> <shadedArtifactAttached>true</shadedArtifactAttached> <shadedClassifierName>stand-alone</shadedClassifierName> <artifactSet> <excludes> <exclude>org.slf4j:slf4j-api:jar:</exclude> <exclude>org.slf4j:slf4j-simple:jar:1.6.4:jar:</exclude> <exclude>org.slf4j:slf4j-log4j12:jar:</exclude> <exclude>org.slf4j:jcl-over-slf4j:jar:</exclude> <exclude>org.slf4j:slf4j-api:jar:1.7.5:jar:</exclude> <exclude>commons-logging:commons-logging:jar:</exclude> <exclude>commons-logging:commons-logging-api:jar:</exclude> </excludes> </artifactSet> <filters> <filter> <artifact>*:*</artifact> <excludes> <exclude>META-INF/*.SF</exclude> <exclude>META-INF/*.DSA</exclude> <exclude>META-INF/*.RSA</exclude> </excludes> </filter> </filters> <finalName>storm-topos</finalName> <transformers> <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"> <mainClass>dgi.eii.storm.base.StormTopologyRunner</mainClass> </transformer> </transformers> </configuration> </plugin> </plugins> </build>
EDIT: So, I figured out a few things and got a little further ... now I get this error
[ERROR] Exception in Bolt org.geotools.data.DataSourceException: org.hsqldb.DatabaseURL.parseURL(Ljava/lang/String;ZZ)Lorg/hsqldb/persist/HsqlProperties;
This little progress that led to the aforementioned new error was due to using the correct transformers and using the maven jar plugin to enter the correct entries into the MANIFEST.MF file. Here is a section of the new build of my POM that can help someone at least overcome the META-INF / services geotools file consolidation and enter the correct entries to overcome the old vendorname cannot be null! error vendorname cannot be null!
<build> <resources> <resource> <directory>${basedir}/src/main/resources</directory> <filtering>false</filtering> <includes> <include>schema.xsd</include> </includes> </resource> </resources> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-shade-plugin</artifactId> <executions> <execution> <phase>package</phase> <goals> <goal>shade</goal> </goals> </execution> </executions> <configuration> <shadedArtifactAttached>true</shadedArtifactAttached> <shadedClassifierName>stand-alone</shadedClassifierName> <artifactSet> <excludes> <exclude>org.slf4j:slf4j-api:jar:</exclude> <exclude>org.slf4j:slf4j-log4j12:jar:</exclude> <exclude>org.slf4j:jcl-over-slf4j:jar:</exclude> <exclude>commons-logging:commons-logging:jar:</exclude> <exclude>commons-logging:commons-logging-api:jar:</exclude> </excludes> </artifactSet> <filters> <filter> <artifact>*:*</artifact> <excludes> <exclude>META-INF/*.SF</exclude> <exclude>META-INF/*.DSA</exclude> <exclude>META-INF/*.RSA</exclude> </excludes> </filter> </filters> <finalName>insightcloud-storm-topos</finalName> <transformers> <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"> <mainClass>dgi.eii.storm.base.StormTopologyRunner</mainClass> </transformer> <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/> <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> <resource>META-INF/spring.handlers</resource> </transformer> <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> <resource>META-INF/spring.schemas</resource> </transformer> </transformers> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jar-plugin</artifactId> <configuration> <archive> <manifestFile>src/main/resources/META-INF/MANIFEST.MF</manifestFile> </archive> </configuration> </plugin> </plugins> </build>