<font size=2 face="sans-serif">I'm trying to use the Geotoolkit 3.19 with
Java 1.6 x64 to create a shapefile on Windows 7 PC.  </font>
<br><font size=2 face="sans-serif">After considerable frustration I executed
the sample and am getting a similar error that I'm getting in my code.
 </font>
<br>
<br><font size=2 face="sans-serif">Does anyone have any ideas what could
be wrong?</font>
<br>
<br><font size=2 face="sans-serif">The error is as follows,</font>
<br><font size=2 color=red face="Consolas">ug 3, 2012 2:24:25 PM org.geotoolkit.referencing.factory.epsg.ThreadedEpsgFactory
createBackingStore</font>
<br><font size=2 color=red face="Consolas">INFO: Connected to EPSG database
“jdbc:hsqldb:C:\Users\dkunzman\Application Data\Geotoolkit.org\EPSG\HSQL/7.09”
on “HSQL Database Engine”.</font>
<br><font size=2 color=red face="Consolas">Aug 3, 2012 2:24:25 PM org.geotoolkit.data.shapefile.StorageFile
replaceOriginals</font>
<br><font size=2 color=red face="Consolas">SEVERE: Unable to delete the
file: \tmp\test.shx when attempting to replace with temporary copy.</font>
<br><font size=2 color=red face="Consolas">Aug 3, 2012 2:24:25 PM org.geotoolkit.data.shapefile.StorageFile
replaceOriginals</font>
<br><font size=2 color=red face="Consolas">SEVERE: The problem is almost
certainly caused by the fact that there are still locks being held on the
shapefiles.  Probably a reader or writer was left unclosed</font>
<br><font size=2 color=red face="Consolas">Aug 3, 2012 2:24:25 PM org.geotoolkit.data.shapefile.ShpFiles
logCurrentLockers</font>
<br><font size=2 color=red face="Consolas">SEVERE: The following locker
still has a lock? write on file:/tmp/test.shp by StorageFile: test5109458120423620803.shp</font>
<br><font size=2 color=red face="Consolas"> it was created with the
following stack trace</font>
<br><font size=2 color=red face="Consolas">org.geotoolkit.data.shapefile.ShpFilesLocker$Trace:
Locking </font>
<br><font size=2 color=red face="Consolas">       
at org.geotoolkit.data.shapefile.ShpFilesLocker.setTraceException(</font><font size=2 color=#000080 face="Consolas"><u>ShpFilesLocker.java:50</u></font><font size=2 color=red face="Consolas">)</font>
<br><font size=2 color=red face="Consolas">       
at org.geotoolkit.data.shapefile.ShpFilesLocker.<init>(</font><font size=2 color=#000080 face="Consolas"><u>ShpFilesLocker.java:45</u></font><font size=2 color=red face="Consolas">)</font>
<br><font size=2 color=red face="Consolas">       
at org.geotoolkit.data.shapefile.ShpFiles.acquireWrite(</font><font size=2 color=#000080 face="Consolas"><u>ShpFiles.java:468</u></font><font size=2 color=red face="Consolas">)</font>
<br><font size=2 color=red face="Consolas">       
at org.geotoolkit.data.shapefile.StorageFile.getSrcURLForWrite(</font><font size=2 color=#000080 face="Consolas"><u>StorageFile.java:167</u></font><font size=2 color=red face="Consolas">)</font>
<br><font size=2 color=red face="Consolas">       
at org.geotoolkit.data.shapefile.StorageFile.replaceOriginals(</font><font size=2 color=#000080 face="Consolas"><u>StorageFile.java:103</u></font><font size=2 color=red face="Consolas">)</font>
<br><font size=2 color=red face="Consolas">       
at org.geotoolkit.data.shapefile.ShapefileFeatureWriter.clean(</font><font size=2 color=#000080 face="Consolas"><u>ShapefileFeatureWriter.java:204</u></font><font size=2 color=red face="Consolas">)</font>
<br><font size=2 color=red face="Consolas">       
at org.geotoolkit.data.shapefile.ShapefileFeatureWriter.close(</font><font size=2 color=#000080 face="Consolas"><u>ShapefileFeatureWriter.java:260</u></font><font size=2 color=red face="Consolas">)</font>
<br><font size=2 color=red face="Consolas">       
at org.geotoolkit.data.DataUtilities.write(</font><font size=2 color=#000080 face="Consolas"><u>DataUtilities.java:165</u></font><font size=2 color=red face="Consolas">)</font>
<br><font size=2 color=red face="Consolas">       
at org.geotoolkit.data.AbstractDataStore.handleAddWithFeatureWriter(</font><font size=2 color=#000080 face="Consolas"><u>AbstractDataStore.java:576</u></font><font size=2 color=red face="Consolas">)</font>
<br><font size=2 color=red face="Consolas">       
at org.geotoolkit.data.shapefile.ShapefileDataStore.addFeatures(</font><font size=2 color=#000080 face="Consolas"><u>ShapefileDataStore.java:298</u></font><font size=2 color=red face="Consolas">)</font>
<br><font size=2 color=red face="Consolas">       
at org.geotoolkit.data.AbstractDataStore.addFeatures(</font><font size=2 color=#000080 face="Consolas"><u>AbstractDataStore.java:232</u></font><font size=2 color=red face="Consolas">)</font>
<br><font size=2 color=red face="Consolas">       
at gov.usgs.bip.bisn.core.view.CreateShapefileDemo.main(</font><font size=2 color=#000080 face="Consolas"><u>CreateShapefileDemo.java:37</u></font><font size=2 color=red face="Consolas">)</font>
<br><font size=2 color=red face="Consolas">Aug 3, 2012 2:24:25 PM org.geotoolkit.data.shapefile.ShpFiles
logCurrentLockers</font>
<br><font size=2 color=red face="Consolas">SEVERE: The following locker
still has a lock? write on file:/tmp/test.shx by StorageFile: test8028264144081471416.shx</font>
<br><font size=2 color=red face="Consolas"> it was created with the
following stack trace</font>
<br><font size=2 color=red face="Consolas">org.geotoolkit.data.shapefile.ShpFilesLocker$Trace:
Locking </font>
<br><font size=2 color=red face="Consolas">       
at org.geotoolkit.data.shapefile.ShpFilesLocker.setTraceException(</font><font size=2 color=#000080 face="Consolas"><u>ShpFilesLocker.java:50</u></font><font size=2 color=red face="Consolas">)</font>
<br><font size=2 color=red face="Consolas">       
at org.geotoolkit.data.shapefile.ShpFilesLocker.<init>(</font><font size=2 color=#000080 face="Consolas"><u>ShpFilesLocker.java:45</u></font><font size=2 color=red face="Consolas">)</font>
<br><font size=2 color=red face="Consolas">       
at org.geotoolkit.data.shapefile.ShpFiles.acquireWrite(</font><font size=2 color=#000080 face="Consolas"><u>ShpFiles.java:468</u></font><font size=2 color=red face="Consolas">)</font>
<br><font size=2 color=red face="Consolas">       
at org.geotoolkit.data.shapefile.StorageFile.getSrcURLForWrite(</font><font size=2 color=#000080 face="Consolas"><u>StorageFile.java:167</u></font><font size=2 color=red face="Consolas">)</font>
<br><font size=2 color=red face="Consolas">       
at org.geotoolkit.data.shapefile.StorageFile.replaceOriginals(</font><font size=2 color=#000080 face="Consolas"><u>StorageFile.java:103</u></font><font size=2 color=red face="Consolas">)</font>
<br><font size=2 color=red face="Consolas">       
at org.geotoolkit.data.shapefile.ShapefileFeatureWriter.clean(</font><font size=2 color=#000080 face="Consolas"><u>ShapefileFeatureWriter.java:204</u></font><font size=2 color=red face="Consolas">)</font>
<br><font size=2 color=red face="Consolas">       
at org.geotoolkit.data.shapefile.ShapefileFeatureWriter.close(</font><font size=2 color=#000080 face="Consolas"><u>ShapefileFeatureWriter.java:260</u></font><font size=2 color=red face="Consolas">)</font>
<br><font size=2 color=red face="Consolas">       
at org.geotoolkit.data.DataUtilities.write(</font><font size=2 color=#000080 face="Consolas"><u>DataUtilities.java:165</u></font><font size=2 color=red face="Consolas">)</font>
<br><font size=2 color=red face="Consolas">       
at org.geotoolkit.data.AbstractDataStore.handleAddWithFeatureWriter(</font><font size=2 color=#000080 face="Consolas"><u>AbstractDataStore.java:576</u></font><font size=2 color=red face="Consolas">)</font>
<br><font size=2 color=red face="Consolas">       
at org.geotoolkit.data.shapefile.ShapefileDataStore.addFeatures(</font><font size=2 color=#000080 face="Consolas"><u>ShapefileDataStore.java:298</u></font><font size=2 color=red face="Consolas">)</font>
<br><font size=2 color=red face="Consolas">       
at org.geotoolkit.data.AbstractDataStore.addFeatures(</font><font size=2 color=#000080 face="Consolas"><u>AbstractDataStore.java:232</u></font><font size=2 color=red face="Consolas">)</font>
<br><font size=2 color=red face="Consolas">       
at gov.usgs.bip.bisn.core.view.CreateShapefileDemo.main(</font><font size=2 color=#000080 face="Consolas"><u>CreateShapefileDemo.java:37</u></font><font size=2 color=red face="Consolas">)</font>
<br>
<br><font size=2 face="sans-serif">and the code is here,</font>
<br>
<br>
<br><font size=2 face="sans-serif">import com.vividsolutions.jts.geom.Coordinate;</font>
<br><font size=2 face="sans-serif">import com.vividsolutions.jts.geom.GeometryFactory;</font>
<br><font size=2 face="sans-serif">import com.vividsolutions.jts.geom.Point;</font>
<br><font size=2 face="sans-serif">import java.net.URL;</font>
<br><font size=2 face="sans-serif">import java.util.ArrayList;</font>
<br><font size=2 face="sans-serif">import java.util.List;</font>
<br><font size=2 face="sans-serif">import org.geotoolkit.data.shapefile.ShapefileDataStore;</font>
<br><font size=2 face="sans-serif">import org.geotoolkit.feature.FeatureTypeBuilder;</font>
<br><font size=2 face="sans-serif">import org.geotoolkit.feature.FeatureUtilities;</font>
<br><font size=2 face="sans-serif">import org.geotoolkit.referencing.CRS;</font>
<br><font size=2 face="sans-serif">import org.geotoolkit.storage.DataStoreException;</font>
<br><font size=2 face="sans-serif">import org.opengis.feature.Feature;</font>
<br><font size=2 face="sans-serif">import org.opengis.feature.type.FeatureType;</font>
<br>
<br><font size=2 face="sans-serif">public class CreateShapefileDemo {</font>
<br><font size=2 face="sans-serif">        public
static void main(String[] args) throws Exception {</font>
<br><font size=2 face="sans-serif">         
      // create a datastore toward the wanted path</font>
<br><font size=2 face="sans-serif">         
      final ShapefileDataStore store = new ShapefileDataStore(new
URL(</font>
<br><font size=2 face="sans-serif">         
               
      "file:/tmp/test.shp"));</font>
<br><font size=2 face="sans-serif">         
      // create the feature type needed</font>
<br><font size=2 face="sans-serif">         
      final FeatureTypeBuilder ftb = new FeatureTypeBuilder();</font>
<br><font size=2 face="sans-serif">         
      ftb.setName("River");</font>
<br><font size=2 face="sans-serif">         
      ftb.add("the_geom", Point.class,
CRS.decode("EPSG:4326"));</font>
<br><font size=2 face="sans-serif">         
      ftb.add("name", String.class);</font>
<br><font size=2 face="sans-serif">         
      final FeatureType type = ftb.buildFeatureType();</font>
<br><font size=2 face="sans-serif">         
      // add this model in the datastore</font>
<br><font size=2 face="sans-serif">         
      store.createSchema(type.getName(), type);</font>
<br><font size=2 face="sans-serif">         
      // create and store a feature</font>
<br><font size=2 face="sans-serif">         
      final List<Feature> features = new ArrayList<Feature>();</font>
<br><font size=2 face="sans-serif">         
      final Feature f = FeatureUtilities.defaultFeature(type,
"id-0");</font>
<br><font size=2 face="sans-serif">         
      f.getProperty("the_geom").setValue(</font>
<br><font size=2 face="sans-serif">         
               
      new GeometryFactory().createPoint(new Coordinate(15,
20)));</font>
<br><font size=2 face="sans-serif">         
      f.getProperty("name").setValue("long
river");</font>
<br><font size=2 face="sans-serif">         
      features.add(f);</font>
<br><font size=2 face="sans-serif">         
      store.addFeatures(type.getName(), features);</font>
<br><font size=2 face="sans-serif">        }</font>
<br><font size=2 face="sans-serif">}</font>
<br><font size=2 face="sans-serif">Douglas Kunzman<br>
12201 Sunrise Valley Drive<br>
Reston, VA 20192<br>
Phone: 703 648-4234<br>
dkunzman@usgs.gov<br>
</font>