If the shade program did not work for you, perhaps create the
META-INF/services files yourself?

--
Jody Garnett

On 5 May 2015 at 06:34, Valentin Pertuy <valentin.per...@gmail.com> wrote:

> Hello everyone. I hope I did everything right to subscribe to this mailing
> list, it's the first time I join one.
>
> First of all, please forgive any mistakes you'll probably see in my mail,
> I'm not a native speaker.
>
> I'm seeking some help with GeoTools. I've been using it for a school's
> project, I had almost no problem until now.
>
> But now that my project is done, I've tried to build an executable jar
> with the maven's shade plugin like it is shown in the GeoTools' FAQ.
>
> Here's my problem, when I try to use the jar which have been created when
> I type 'mvn package', I get this error :
>
>
>> java.lang.UnsupportedOperationException: Trying to get a reader from an
>> unknown
>> format.
>>         at
>> org.geotools.coverage.grid.io.UnknownFormat.getReader(UnknownFormat.j
>> ava:62)
>>         at coeurDLL.SMap.<init>(SMap.java:44)
>>         at coeurDLL.CoeurController.initialize(CoeurController.java:103)
>>         at coeur.Interface.getMapsAndDisplay(Interface.java:152)
>>         at coeur.Interface.<init>(Interface.java:948)
>>         at coeur.Interface.main(Interface.java:957)
>> java.lang.NullPointerException
>>         at
>> coeurDLL.CoeurController.getColumnsFields(CoeurController.java:225)
>>         at coeur.Interface.setControlPanel(Interface.java:327)
>>         at coeur.Interface.displayMainWindow(Interface.java:185)
>>         at coeur.Interface.getMapsAndDisplay(Interface.java:162)
>>         at coeur.Interface.<init>(Interface.java:948)
>>         at coeur.Interface.main(Interface.java:957)
>
>
>
> It happens when I try to read a GeoTif file with the method
> "reader.read(null)".
> Of course I don't have this problem when executing the project on Eclipse.
>
> I read somewhere that it could be a dependency problem, but I don't see
> what I could have missed.
>
> Some details which could be helpful :
> - I'm using GeoTools version 12-RC1
> - I'm not using the JAI libraries, I'm working in Java Pure mode. It
> allows me to work with a 64 bits jdk. I tried by curiosity with a 32bit
> jdk, but I still have the same problem anyway.
> - I'm working on Windows 7, but it shouldn't make any difference.
>
>
> Here's the content of my pom.xml :
>
> <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/xsd/maven-4.0.0.xsd";>
>>   <modelVersion>4.0.0</modelVersion>
>>   <groupId>pfe.coeur</groupId>
>>   <artifactId>coeur</artifactId>
>>   <version>0.0.1-SNAPSHOT</version>
>>   <packaging>jar</packaging>
>>   <name>tuto</name>
>>   <url>http://maven.apache.org</url>
>>
>>
>>     <properties>
>>         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
>>         <geotools.version>12-RC1</geotools.version>
>>     </properties>
>> <build>
>>       <plugins>
>>           <plugin>
>>               <artifactId>maven-compiler-plugin</artifactId>
>>               <version>3.1</version>
>>               <configuration>
>>                   <encoding>UTF-8</encoding>
>>                   <target>1.7</target>
>>                   <source>1.7</source>
>>               </configuration>
>>           </plugin>
>>           <plugin>
>>               <groupId>org.apache.maven.plugins</groupId>
>>               <artifactId>maven-shade-plugin</artifactId>
>>               <version>2.3</version>
>>               <executions>
>>                   <execution>
>>                       <phase>package</phase>
>>                       <goals>
>>                           <goal>shade</goal>
>>                       </goals>
>>                       <configuration>
>>                           <transformers>
>>                               <!-- This bit sets the main class for the
>> executable jar as you otherwise -->
>>                               <!-- would with the assembly plugin
>>                               -->
>>                               <transformer
>> implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
>>                                   <manifestEntries>
>>
>> <Main-Class>coeur.Interface</Main-Class>
>>                                   </manifestEntries>
>>                               </transformer>
>>                               <!-- This bit merges the various GeoTools
>> META-INF/services files         -->
>>                               <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>4.11</version>
>>             <scope>test</scope>
>>         </dependency>
>>         <dependency>
>>             <groupId>org.geotools</groupId>
>>             <artifactId>gt-coverage</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-shapefile</artifactId>
>>             <version>${geotools.version}</version>
>>         </dependency>
>>         <dependency>
>>             <groupId>org.geotools</groupId>
>>             <artifactId>gt-swing</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-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-wms</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>
>
>
>
> I'd be very grateful if someone can help me to solve this problem. I need
> this executable jar to finish my project and I don't have a lot of time to
> get it.
>
> Regards,
> Valentin
>
>
> ------------------------------------------------------------------------------
> One dashboard for servers and applications across Physical-Virtual-Cloud
> Widest out-of-the-box monitoring support with 50+ applications
> Performance metrics, stats and reports that give you Actionable Insights
> Deep dive visibility with transaction tracing using APM Insight.
> http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
> _______________________________________________
> GeoTools-GT2-Users mailing list
> GeoTools-GT2-Users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>
>
------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to