Hi,
My application is now running splendidly when I run it using NetBeans
(thanks for all the help!)
I would now like to create a binary executable that I can run on
another machine. I have added the following to my pom.xml:
<plugin>
<!-- NOTE: We don't need a groupId specification because the
group is
org.apache.maven.plugins ...which is assumed by default.
-->
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<archive>
<manifest>
<mainClass>org.esv.summarystats.StatsRunner</mainClass>
</manifest>
</archive>
</configuration>
<executions>
<execution>
<id>make-assembly</id><!-- this is used for inheritance
merges -->
<phase>package</phase><!-- append to the packaging phase.
-->
<goals>
<goal>attached</goal><!-- goals == mojos -->
</goals>
</execution>
</executions>
</plugin>
Building with Maven now creates a jar with dependencies. However,
when I try to run the jar (java -jar ...), I get:
java -jar SummaryStats-1.0-SNAPSHOT-jar-with-dependencies.jar
Exception in thread "main"
org.geotools.factory.FactoryNotFoundException: No factory of kind
"CRSAuthorityFactory" found.
at
org
.geotools
.factory.FactoryRegistry.getServiceProvider(FactoryRegistry.java:374)
at
org
.geotools
.factory.FactoryCreator.getServiceProvider(FactoryCreator.java:143)
at
org
.geotools
.referencing
.ReferencingFactoryFinder
.getAuthorityFactory(ReferencingFactoryFinder.java:216)
at
org
.geotools
.referencing
.ReferencingFactoryFinder
.getCRSAuthorityFactory(ReferencingFactoryFinder.java:436)
at
org.esv.summarystats.StatsRunner.processNextStats(StatsRunner.java:74)
at org.esv.summarystats.StatsRunner.<init>(StatsRunner.java:45)
at org.esv.summarystats.StatsRunner.main(StatsRunner.java:152)
Here's the code that seems to be causing the problem (StatsRunner.java:
74):
CRSAuthorityFactory factory =
ReferencingFactoryFinder.getCRSAuthorityFactory("EPSG", null);
CoordinateReferenceSystem crs =
factory.createCoordinateReferenceSystem("4326");
After googling around a bit, I verified that gt-epsg-hsql is in my
pom. Also, I see that org/geotools/referencing/factory/epsg is in the
built jar.
Again, the program runs fine when I run it from NetBeans. Any
suggestions?
Thanks!
Greg
------------------------------------------------------------------------------
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users