Hi Mason,
You pom.xml looks fine to me.
The reason that I asked you to check is that the NullPointerException
you and others were seeing was caused by a problem in the
MapViewport.getScreenToWorld() method.
The top bit of the error trace you posted was:
java.lang.NullPointerException
at java.awt.geom.AffineTransform.<init>(AffineTransform.java:471)
at org.geotools.map.MapViewport.getScreenToWorld(MapViewport.java:351)
The NPE was being thrown by the AffineTransform constructor when it
was passed a null value by this stupid code (which I'm afraid I
wrote)...
public AffineTransform getScreenToWorld() {
return new AffineTransform(screenToWorld);
}
But that method was changed yesterday to this...
public synchronized AffineTransform getScreenToWorld() {
return screenToWorld == null ? null : new
AffineTransform(screenToWorld);
}
So there doesn't seem to be any way you can get the same NPE.
To make sure that what you are seeing and what I am testing relates to
exactly the same code can you try the following please:
- delete the org/geotools folder from your local maven repo
- build your project again, forcing maven to download the jars
- post the error trace (if you get one) to the list
Thanks for your patience !
Michael
On 18 August 2011 18:12, mason <[email protected]> wrote:
> Here is my pom (it's a copy-paste from your website). And I update the
> dependencies before run the program. I am glad to help and I can learn
> something.
> Mason
>
> <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>
>
> <properties>
>
> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
> <geotools.version>8-SNAPSHOT</geotools.version>
> </properties>
>
> <groupId>org.geotools</groupId>
> <artifactId>tutorial</artifactId>
> <version>0.0.1-SNAPSHOT</version>
> <packaging>jar</packaging>
>
> <name>tutorial</name>
> <url>http://maven.apache.org</url>
>
>
>
> <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-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>
> <repository>
> <id>opengeo</id>
> <name>OpenGeo Maven Repository</name>
> <snapshots>
> <enabled>true</enabled>
> </snapshots>
> <url>http://repo.opengeo.org/</url>
> </repository>
> </repositories>
>
> </project>
>
> --
> View this message in context:
> http://osgeo-org.1803224.n2.nabble.com/NullPointerException-with-JMapFrame-was-Problem-method-JMapFrame-showMap-tp6691364p6698512.html
> Sent from the geotools-gt2-users mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> Get a FREE DOWNLOAD! and learn more about uberSVN rich system,
> user administration capabilities and model configuration. Take
> the hassle out of deploying and managing Subversion and the
> tools developers use with it. http://p.sf.net/sfu/wandisco-d2d-2
> _______________________________________________
> Geotools-gt2-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>
------------------------------------------------------------------------------
Get a FREE DOWNLOAD! and learn more about uberSVN rich system,
user administration capabilities and model configuration. Take
the hassle out of deploying and managing Subversion and the
tools developers use with it. http://p.sf.net/sfu/wandisco-d2d-2
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users