That makes sense, I recall seeing this beforehand. Just asking for the FT should do the trick (we just want to force in a call to describe feature type), but if not then we could also force the parsed dft call into the cache (there are some methods to do this).
 
David

 
On 11/17/05, Richard Gould <[EMAIL PROTECTED]> wrote:
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


Reply via email to