From: Agossa <lac...@ho...> - 2010-04-29 14:37:18
|
Hi. I can compile and run Imagelab using maven within Eclipse however the package generated doesn't run. I got the Execeptions hereafter. What's wrong? Thanks. The pom follows: =================================POM======================= <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>org.geotools.demo</groupId> <artifactId>example</artifactId> <packaging>jar</packaging> <version>1.0-SNAPSHOT</version> <name>example</name> <url>http://maven.apache.org</url> <properties> <geotools.version>2.6.1</geotools.version> </properties> <build> <resources> <resource> <filtering>false</filtering> <directory>src/main/resources</directory> </resource> <resource> <filtering>false</filtering> <directory>src/main/java</directory> <includes> <include>**</include> </includes> <excludes> <exclude>**/*.java</exclude> </excludes> </resource> </resources> <plugins> <plugin> <artifactId>maven-compiler-plugin</artifactId> <configuration> <encoding>UTF-8</encoding> <target>1.5</target> <source>1.5</source> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-shade-plugin</artifactId> <version>1.3.1</version> <executions> <execution> <phase>package</phase> <goals> <goal>shade</goal> </goals> <configuration> <transformers> <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"> <manifestEntries> <Main-Class>org.geotools.demo.App</Main-Class> </manifestEntries> </transformer> <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/> </transformers> </configuration> </execution> </executions> </plugin> </plugins> </build> <dependencies> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>3.8.1</version> <scope>test</scope> </dependency> <dependency> <groupId>org.geotools</groupId> <artifactId>gt-shapefile</artifactId> <version>${geotools.version}</version> </dependency> <dependency> <groupId>org.geotools</groupId> <artifactId>gt-epsg-hsql</artifactId> <version>${geotools.version}</version> </dependency> <dependency> <groupId>org.geotools</groupId> <artifactId>gt-epsg-extension</artifactId> <version>${geotools.version}</version> </dependency> <dependency> <groupId>org.geotools</groupId> <artifactId>gt-geotiff</artifactId> <version>${geotools.version}</version> </dependency> <dependency> <groupId>org.geotools</groupId> <artifactId>gt-image</artifactId> <version>${geotools.version}</version> </dependency> <dependency> <groupId>org.geotools</groupId> <artifactId>gt-swing</artifactId> <version>${geotools.version}</version> </dependency> </dependencies> <repositories> <repository> <id>maven2-repository.dev.java.net</id> <name>Java.net repository</name> <url>http://download.java.net/maven/2</url> </repository> <repository> <id>osgeo</id> <name>Open Source Geospatial Foundation Repository</name> <url>http://download.osgeo.org/webdav/geotools/</url> </repository> </repositories> </project> E:\sources\example>java -jar target/example-1.0-SNAPSHOT.jar =================================EXCEPTIONS============================== org.geotools.factory.FactoryRegistry scanForPlugins WARNING: Can't load a service for category "CRSAuthorityFactory". Cause is "ServiceConfigurationError: org.opengis.referencing.crs.CRSAuthorityFactory: Provider org (...) geotools.referencing.factory.epsg.ThreadedHsqlEpsgFactory not found". sun.misc.ServiceConfigurationError: org.opengis.referencing.crs.CRSAuthorityFactory: Provider org.geotools.referencing.factory.epsg.LongitudeFirstEpsgDecorator org.geotools.referencing.factory.epsg.ThreadedHsqlEpsgFactory not found at sun.misc.Service.fail(Service.java:129) at sun.misc.Service.access$000(Service.java:111) at sun.misc.Service$LazyIterator.next(Service.java:273) at org.geotools.factory.FactoryRegistry.register(FactoryRegistry.java:829) at org.geotools.factory.FactoryRegistry.scanForPlugins(FactoryRegistry.java:773) at org.geotools.factory.FactoryRegistry.scanForPluginsIfNeeded(FactoryRegistry.java:808) at org.geotools.factory.FactoryRegistry.getServiceProviders(FactoryRegistry.java:195) at org.geotools.referencing.ReferencingFactoryFinder.getFactories(ReferencingFactoryFinder.java:176) at org.geotools.referencing.ReferencingFactoryFinder.getCRSAuthorityFactories(ReferencingFactoryFinder.java:451) at org.geotools.referencing.DefaultAuthorityFactory.getBackingFactory(DefaultAuthorityFactory.java:88) at org.geotools.referencing.DefaultAuthorityFactory.<init>(DefaultAuthorityFactory.java:69) at org.geotools.referencing.CRS.getAuthorityFactory(CRS.java:197) at org.geotools.referencing.CRS.decode(CRS.java:435) at org.geotools.coverage.grid.io.AbstractGridFormat.<clinit>(AbstractGridFormat.java:98) at org.geotools.gce.image.WorldImageFormatFactory.createFormat(WorldImageFormatFactory.java:36) at org.geotools.gce.image.WorldImageFormatFactory.createFormat(WorldImageFormatFactory.java:34) at org.geotools.coverage.grid.io.GridFormatFinder.findFormats(GridFormatFinder.java:169) at org.geotools.coverage.grid.io.GridFormatFinder.findFormat(GridFormatFinder.java:200) at org.geotools.demo.ImageLab.displayLayers(ImageLab.java:105) at org.geotools.demo.ImageLab.getLayersAndDisplay(ImageLab.java:90) at org.geotools.demo.App.main(App.java:12) Exception in thread "main" java.lang.UnsupportedOperationException: Trying to get a reader from an unknown format. at org.geotools.coverage.grid.io.UnknownFormat.getReader(UnknownFormat.java:62) at org.geotools.demo.ImageLab.displayLayers(ImageLab.java:106) at org.geotools.demo.ImageLab.getLayersAndDisplay(ImageLab.java:90) at org.geotools.demo.App.main(App.java:12) -- View this message in context: http://osgeo-org.1803224.n2.nabble.com/jar-from-quick-start-using-maven-doesn-t-run-Can-t-load-a-service-for-category-CRSAuthorityFactory-tp4980342p4980342.html Sent from the geotools-gt2-users mailing list archive at Nabble.com. |
From: Jody G. <jod...@gm...> - 2010-04-29 22:12:02
|
It should be working ... the following dependency is the one that contributes "EPSG" definitions to the library. Can you check that that jar showed up? Jody On 30/04/2010, at 12:37 AM, Agossa wrote: > <dependency> > <groupId>org.geotools</groupId> > <artifactId>gt-epsg-hsql</artifactId> > <version>${geotools.version}</version> > </dependency> |
From: Michael B. <mic...@gm...> - 2010-04-30 02:32:14
|
The problem might be this one... http://jira.codehaus.org/browse/GEOT-2982 Please try switching to GeoTools version 2.6.3 and see if that fixes your jar. Michael |
From: Agossa <lac...@ho...> - 2010-05-07 17:22:07
|
Hello Michael, Thank you. The CRSAuthorityFactory exception is fixed with Geotools 2.6.3 dependencies but the Exception hereafter is still there when I want to show image files(tiff or worldfile images). Could you please give me a pom that works for imageLab example? I'd remind that the code compile and run in Eclipse but the executable can't read image files. I'd also like to know how to add (mlib_jai_mmx.dll, mlib_jai_util.dll, mlib_jai.dll) to my maven dependances so that they can be fund at runtime. Regards. Agossa Exception in thread "AWT-EventQueue-0" java.lang.UnsupportedOperationException: Trying to get a reader from an unknown format. at org.geotools.coverage.grid.io.UnknownFormat.getReader(UnknownFormat.j ava:62) -- View this message in context: http://osgeo-org.1803224.n2.nabble.com/jar-from-quick-start-using-maven-doesn-t-run-Can-t-load-a-service-for-category-CRSAuthorityFactory-tp4980342p5020429.html Sent from the geotools-gt2-users mailing list archive at Nabble.com. |
From: Jody G. <jod...@gm...> - 2010-05-08 00:28:45
|
On 08/05/2010, at 3:22 AM, Agossa wrote: > I'd also like to know how to add (mlib_jai_mmx.dll, mlib_jai_util.dll, > mlib_jai.dll) to my maven dependances so that they can be fund at runtime. I usually install them into the JRE that maven is using; there are a number of installers available. Not sure maven gets much of a say in it. Jody |
From: Michael B. <mic...@gm...> - 2010-05-08 04:31:27
|
On 8 May 2010 10:25, Jody Garnett wrote: > > On 08/05/2010, at 3:22 AM, Agossa wrote: > >> I'd also like to know how to add (mlib_jai_mmx.dll, mlib_jai_util.dll, >> mlib_jai.dll) to my maven dependances so that they can be fund at runtime. > > I usually install them into the JRE that maven is using; there are a number of installers > available. Not sure maven gets much of a say in it. Hi Agossa, I think Jody is right - it's not under maven's control. Instead, JAI is supposed to detect the native libraries if you have them installed. As for the exception, I've just built an executable jar with the shade plugin and I get the same error - so at least we know it's not your fault :-) I'll look at it again later today and see if I can spot the problem. Michael |
From: Michael B. <mic...@gm...> - 2010-05-08 09:46:25
|
Hi again Agossa, Please update your POM with the dependencies below, and then let us know if hat fixes the problem with the executable jar. Michael <dependencies> <dependency> <groupId>org.geotools</groupId> <artifactId>gt-swing</artifactId> <version>${geotools.version}</version> </dependency> <dependency> <groupId>org.geotools</groupId> <artifactId>gt-render</artifactId> <version>${geotools.version}</version> </dependency> <dependency> <groupId>org.geotools</groupId> <artifactId>gt-epsg-hsql</artifactId> <version>${geotools.version}</version> </dependency> <dependency> <groupId>org.geotools</groupId> <artifactId>gt-shapefile</artifactId> <version>${geotools.version}</version> </dependency> <dependency> <groupId>org.geotools</groupId> <artifactId>gt-coverage</artifactId> <version>${geotools.version}</version> </dependency> <dependency> <groupId>org.geotools</groupId> <artifactId>gt-geotiff</artifactId> <version>${geotools.version}</version> </dependency> <dependency> <groupId>org.geotools</groupId> <artifactId>gt-image</artifactId> <version>${geotools.version}</version> </dependency> </dependencies> |
From: Agossa <lac...@ho...> - 2010-05-11 14:41:58
|
Thanks Michael, It doesn't fix. I get the same exception for the image file. See below. Regards. Agossa. E:\sources\example>java -jar target\example-1.0-SNAPSHOT.jar Exception in thread "main" java.lang.UnsupportedOperationException: Trying to ge t a reader from an unknown format. at org.geotools.coverage.grid.io.UnknownFormat.getReader(UnknownFormat.j ava:62) at org.geotools.demo.ImageLab.displayLayers(ImageLab.java:109) at org.geotools.demo.ImageLab.getLayersAndDisplay(ImageLab.java:93) at org.geotools.demo.App.main(App.java:27) Exception while removing reference: java.lang.InterruptedException java.lang.InterruptedException at java.lang.Object.wait(Native Method) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:118) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:134) at sun.java2d.Disposer.run(Disposer.java:125) at java.lang.Thread.run(Thread.java:619) The Pom <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>org.geotools.demo</groupId> <artifactId>example</artifactId> <packaging>jar</packaging> <version>1.0-SNAPSHOT</version> <name>example</name> <url>http://maven.apache.org</url> <properties> <geotools.version>2.6.3</geotools.version> </properties> <build> <resources> <resource> <filtering>false</filtering> <directory>src/main/resources</directory> </resource> <resource> <filtering>false</filtering> <directory>src/main/java</directory> <includes> <include>**</include> </includes> <excludes> <exclude>**/*.java</exclude> </excludes> </resource> </resources> <plugins> <plugin> <artifactId>maven-compiler-plugin</artifactId> <configuration> <encoding>UTF-8</encoding> <target>1.6</target> <source>1.6</source> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-eclipse-plugin</artifactId> <configuration> <downloadSources>true</downloadSources> <downloadJavadocs>true</downloadJavadocs> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-shade-plugin</artifactId> <version>1.3.1</version> <executions> <execution> <phase>package</phase> <goals> <goal>shade</goal> </goals> <configuration> <transformers> <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"> <manifestEntries> <Main-Class>org.geotools.demo.App</Main-Class> </manifestEntries> </transformer> <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" /> </transformers> </configuration> </execution> </executions> </plugin> </plugins> </build> <dependencies> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>3.8.1</version> <scope>test</scope> </dependency> <dependency> <groupId>org.geotools</groupId> <artifactId>gt-swing</artifactId> <version>${geotools.version}</version> </dependency> <dependency> <groupId>org.geotools</groupId> <artifactId>gt-render</artifactId> <version>${geotools.version}</version> </dependency> <dependency> <groupId>org.geotools</groupId> <artifactId>gt-epsg-hsql</artifactId> <version>${geotools.version}</version> </dependency> <dependency> <groupId>org.geotools</groupId> <artifactId>gt-shapefile</artifactId> <version>${geotools.version}</version> </dependency> <dependency> <groupId>org.geotools</groupId> <artifactId>gt-coverage</artifactId> <version>${geotools.version}</version> </dependency> <dependency> <groupId>org.geotools</groupId> <artifactId>gt-geotiff</artifactId> <version>${geotools.version}</version> </dependency> <dependency> <groupId>org.geotools</groupId> <artifactId>gt-image</artifactId> <version>${geotools.version}</version> </dependency> </dependencies> <repositories> <repository> <id>maven2-repository.dev.java.net</id> <name>Java.net repository</name> <url>http://download.java.net/maven/2</url> </repository> <repository> <id>osgeo</id> <name>Open Source Geospatial Foundation Repository</name> <url>http://download.osgeo.org/webdav/geotools/</url> </repository> </repositories> </project> -- View this message in context: http://osgeo-org.1803224.n2.nabble.com/jar-from-quick-start-using-maven-doesn-t-run-Can-t-load-a-service-for-category-CRSAuthorityFactory-tp4980342p5036311.html Sent from the geotools-gt2-users mailing list archive at Nabble.com. |
From: Agossa <lac...@ho...> - 2010-05-11 15:55:56
|
Many thanks Jody, I did install all those dll in my JDK and JRE already. I was wondering if the final user of my application will get the program run without installing all those dynamic libraries. Actually, I have a couple of dll of other libraries such as jhdf.dll at the root of my project (everything is allright within eclipse) yet I would like to have them in the package that I will release to the users of the application. Thanks in advance. Agossa -- View this message in context: http://osgeo-org.1803224.n2.nabble.com/jar-from-quick-start-using-maven-doesn-t-run-Can-t-load-a-service-for-category-CRSAuthorityFactory-tp4980342p5036750.html Sent from the geotools-gt2-users mailing list archive at Nabble.com. |
From: Michael B. <mic...@gm...> - 2010-05-12 01:43:19
|
On 12 May 2010 00:41, Agossa wrote: > > > Thanks Michael, > > It doesn't fix. I get the same exception for the image file. See below. > Bummer. The executable jar is working for me with those dependencies and the shade plugin set up in the pom as you have it. I'm afraid I don't have another suggestion right now. > I did install all those dll in my JDK and JRE already. I was wondering if > the final user of my application will get the program run without installing > all those dynamic libraries. JAI will run in pure java mode if the native libs are not on the classpath, so they are not strictly required. On Windows they provide accelerated processing. On OSX the equivalent libraries are somewhat broken and you have to disable them if you want correct results form some JAI operations. Michael |