From: Jody G. <jga...@re...> - 2007-10-25 05:44:08
|
No worries; 2.3.3 should be fine; now about that stack trace? Jody #LIU DONGQUAN# wrote: > Dear Jody: > Thank you for your reply. I am using gt2-2.3.3.a. should I try other version? > > Regards > liudq > > -----Original Message----- > From: Jody Garnett [mailto:jga...@re...] > Sent: 2007年10月25日 5:52 > To: #LIU DONGQUAN# > Cc: geo...@li... > Subject: Re: [Geotools-gt2-users] Problem of reading shapefile > > mayol wrote: > >> hi, all >> i am new to geotools. i am trying the shapefile reading programe on the >> website. but it got problem when running it. >> problem is: java.lang.NullPointerException!!! >> >> > Can you give me the stack trace? > > >> the code is shown below. i think problem is in this line: "DataStore >> dataStore = DataStoreFinder.getDataStore( connect );". please help me about >> it. thanks a lot~~~~ >> >> > > >> File file = new File( "bc_hospitals.shp" ); >> if( !file.exists() ) System.exit(1); >> >> Map connect = new HashMap(); >> connect.put( "url", file.toURL() ); >> System.out.println(file.toURL().toString()); >> >> DataStore dataStore = DataStoreFinder.getDataStore( connect ); >> >> > That looks okay; and I see you checked to make sure the file exists > already. What version of GeoTools are you running with? > Jody > |