Hi David,

We have come across a problem in the WFS code (specifically 2.1.x) where the feature type schema is only loaded properly if a call to WFSDataStore.getFeatureReader() is made before performing any transactions (addFeatures()).

Specifically it looks like the getFeatureReader() call loads the feature type schema into the SchemaFactory, and it must be loaded in order to commit features.

Here is the exception:

java.lang.NullPointerException
at org.geotools.xml.wfs.WFSTransactionComplexTypes$InsertElementType.encode(WFSTransactionComplexTypes.java:915) at org.geotools.xml.wfs.WFSTransactionComplexTypes$TransactionType.encode(WFSTransactionComplexTypes.java:300) at org.geotools.xml.DocumentWriter.writeFragment(DocumentWriter.java:309) at org.geotools.xml.DocumentWriter.writeDocument(DocumentWriter.java:208) at org.geotools.data.wfs.WFSTransactionState.commitPost(WFSTransactionState.java:190) at org.geotools.data.wfs.WFSTransactionState.commit(WFSTransactionState.java:110) at org.geotools.data.wfs.WFSFeatureStore.addFeatures(WFSFeatureStore.java:109)
   ...

If I add the following call before addFeatures() is called, everything works fine. FeatureReader reader = dataStore.getFeatureReader(query, Transaction.AUTO_COMMIT);

I wrote a test case, but it is not very useful as it uses and hits local data and a geoserver on my machine, but I can probably make it public if you would like.

Richard



-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.  Get Certified Today
Register for a JBoss Training Course.  Free Certification Exam
for All Training Attendees Through End of 2005. For more info visit:
http://ads.osdn.com/?ad_id=7628&alloc_id=16845&op=click
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to