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.

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

Reply via email to