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.

------------------------------------------------------------------------------

_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to