Hello guys,
I have a short question which can be answered here hopefully cause I
really dont know why datastore is null in my code.
Here is the code fragment:
158 try {
159 File dirUpload = new File
(dir.getAbsolutePath()+"\\"+filename);
160 System.out.println("dirUpload: " + dirUpload );
161
162 Map<Object, Serializable> shapeParams = new
HashMap<Object, Serializable>();
163 System.out.println("shapeParams: " + shapeParams);
164
165 shapeParams.put("url", dirUpload.toURI().toURL());
166 shapeParams.put("create spatial index", true);
167 System.out.println("ShapeParams after put: " +
shapeParams);
168
169 DataStore dataStore =
DataStoreFinder.getDataStore(shapeParams);
170 System.out.println("Datastore: " + dataStore);
171
172 String typeName = dataStore.getTypeNames()[0];
And this is the debug output I get after running:
dirUpload:
C:\Users\DPipjorke\git\geonetwork\web\src\main\webapp\WEB-INF\data\data\metadata_data\00000-00099\51\private\dano.zip
shapeParams: {}
ShapeParams after put: {create spatial index=true,
url=file:/C:/Users/DPipjorke/git/geonetwork/web/src/main/webapp/WEB-INF/data/data/metadata_data/00000-00099/51/private/dano.zip}
Datastore: null
java.lang.NullPointerException
at
org.fao.geonet.services.resources.UploadAndProcess.exec(UploadAndProcess.java:172)
The exception which is mentioned in line 172 is caused by the dataStore
in line 169 which is null. But I dont understand why cause the
shapeParams Hashmap which is created before is not empty:
I am thankful for evey advice
Greetings
manuel
------------------------------------------------------------------------------
_______________________________________________
GeoTools-GT2-Users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users