이클립스 http://docs.geotools.org/latest/userguide/tutorial/quickstart/eclipse.html 를 사용하여 Geotools 빠른 튜토리얼보고 있었다 나는 모든 단계를 따라 내가 빠른 시작을 실행할 때 나는 빠른 클래스Geotools 빠른 튜토리얼 JFileDataStoreChooser.showOpenFile는 원인이되는 오류
을 실행할 때까지 모든 것이 잘 갔다 수업. 이 오류
Exception in thread "main" java.lang.NullPointerException
at sun.awt.shell.Win32ShellFolder2.getFileSystemPath(Win32ShellFolder2.java:571)
at sun.awt.shell.Win32ShellFolder2.access$400(Win32ShellFolder2.java:72)
at sun.awt.shell.Win32ShellFolder2$2.call(Win32ShellFolder2.java:298)
at sun.awt.shell.Win32ShellFolder2$2.call(Win32ShellFolder2.java:296)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at sun.awt.shell.Win32ShellFolderManager2$ComInvoker$3.run(Win32ShellFolderManager2.java:502)
at java.lang.Thread.run(Thread.java:722)
있어 그리고 난이 방법은 내가 위의 방법을 사용을 제외한 다른 모든 라인을 주석
문제 JFileDataStoreChooser.showOpenFile를 일으키는 것을 발견하고, 여전히 같은있어 오류.
package org.geotools.tutorial;
import java.io.File;
import org.geotools.data.FileDataStore;
import org.geotools.data.FileDataStoreFinder;
import org.geotools.data.simple.SimpleFeatureSource;
import org.geotools.map.FeatureLayer;
import org.geotools.map.Layer;
import org.geotools.map.MapContent;
import org.geotools.styling.SLD;
import org.geotools.styling.Style;
import org.geotools.swing.JMapFrame;
import org.geotools.swing.data.JFileDataStoreChooser;
/**
* Prompts the user for a shapefile and displays the contents on the screen in a map frame.
* <p>
* This is the GeoTools Quickstart application used in documentationa and tutorials. *
*/
public class Quickstart {
/**
* GeoTools Quickstart demo application. Prompts the user for a shapefile and displays its
* contents on the screen in a map frame
*/
public static void main(String[] args) throws Exception {
// display a data store file chooser dialog for shapefiles
/*********This is the line *********/
File file = JFileDataStoreChooser.showOpenFile("shp", null);
/***********************************/
// if (file == null) {
// return;
// }
//
// FileDataStore store = FileDataStoreFinder.getDataStore(file);
// SimpleFeatureSource featureSource = store.getFeatureSource();
//
// // Create a map content and add our shapefile to it
// MapContent map = new MapContent();
// map.setTitle("Quickstart");
//
// Style style = SLD.createSimpleStyle(featureSource.getSchema());
// Layer layer = new FeatureLayer(featureSource, style);
// map.addLayer(layer);
//
// // Now display the map
// JMapFrame.showMap(map);
}
}
또한 pom.xml 파일에서, I은 버전 8.0 M2 및 8 SNAPSHOT 시도 (I뿐만 아니라 그 선 댓글 만약 에러가 없다). 하지만 행운을 ...
누구든지 아이디어가 있습니까? module geotools.swing에 문제가 있습니까?
감사
답변 해 주셔서 감사합니다. 나는 그 키워드를 Google에 시도했다. http://netbeans.org/bugzilla/show_bug.cgi?id=186615에서 6시 21 분, http://www.dbvis.com/forum/message.jspa?messageID=10866에서 수정되었다고 말했습니다. 버전 6u18로 돌아 가기. 나는 둘 다 시도했지만 여전히 NullPointerException을 가졌지 만 다른 스택 추적을 얻었다. 내 원래 버전은 JDK 7입니다. – shane716