I've done a bunch more digging on this error and am going to attempt to 
describe what I've discovered.

When the feature schema is read for the topp:states layers if parses 
this request:
http://localhost:8765/geoserver/wfs?request=DescribeFeatureType&SERVICE=WFS&VERSION=1.0.0&TYPENAME=topp:states
and places it in the SchemaFactory schemas cache associated with the 
targetNamespace, which in this case is "http://www.openplans.org./topp";.

However the SimpleFeatureType that is returned by the SchemaFactory has 
a namespace of 
http://localhost:8765/geoserver/wfs?request=DescribeFeatureType&SERVICE=WFS&VERSION=1.0.0&TYPENAME=topp:states.

So later in the test when commit goes to generate the required xml to 
perform the updates, it is looking for a schema associated with the 
namespace
http://localhost:8765/geoserver/wfs?request=DescribeFeatureType&SERVICE=WFS&VERSION=1.0.0&TYPENAME=topp:states
.  It doesn't find anything (because when the feature was read it was 
cached with the target namespace - www.openplans.org/topp) and the test 
fails.

Somehow I think we need to cache the feature schema with this key
http://localhost:8765/geoserver/wfs?request=DescribeFeatureType&SERVICE=WFS&VERSION=1.0.0&TYPENAME=topp:states
as well as the targetNamespace key?  Or maybe geoserver target namespace 
should be something else??

I hope this makes some sense.

Emily







Emily Gouge (JIRA) wrote:
> WFS Transaction Bug  (GeoServerOnlineTest.java)
> -----------------------------------------------
> 
>                  Key: GEOT-2081
>                  URL: http://jira.codehaus.org/browse/GEOT-2081
>              Project: GeoTools
>           Issue Type: Bug
>           Components: data wfs
>          Environment: Windows XP, Java 1.6.0_06
>             Reporter: Emily Gouge
> 
> 
> I downloaded and ran the GeoServerOnlineTest.java test.  A few of the tests 
> failed in particular the testWrite() test case:  I got the following errors:
> 
> 1)  An error in the WFSDataStroeWriteOnlineTest.java around line 100 (String 
> cannot be converted to FeatureID).  This can easily fixed by updating the for 
> loop to the following:
>  for(Iterator<FeatureId> it = fids1.iterator();it.hasNext();){
>             FeatureId fid = (FeatureId) it.next();
>             featureIds.add(fid);
>         }
> 
> 2)  The next error is in the testWrite() 
> java.lang.NullPointerException
>       at 
> org.geotools.xml.wfs.WFSTransactionComplexTypes$InsertElementType.encode(WFSTransactionComplexTypes.java:922)
>       at 
> org.geotools.xml.wfs.WFSTransactionComplexTypes$TransactionType.encode(WFSTransactionComplexTypes.java:306)
>       at 
> org.geotools.xml.DocumentWriter.writeFragment(DocumentWriter.java:316)
>       at 
> org.geotools.xml.DocumentWriter.writeDocument(DocumentWriter.java:214)
>       at 
> org.geotools.wfs.v_1_0_0.data.WFSTransactionState.commitPost(WFSTransactionState.java:278)
>       at 
> org.geotools.wfs.v_1_0_0.data.WFSTransactionState.commit(WFSTransactionState.java:149)
>       at 
> org.geotools.data.DefaultTransaction.commit(DefaultTransaction.java:182)
>       at 
> org.geotools.wfs.v_1_0_0.data.WFSDataStoreWriteOnlineTest.doInsert(WFSDataStoreWriteOnlineTest.java:132)
>       at 
> org.geotools.wfs.v_1_0_0.data.GeoServerOnlineTest.testWrite(GeoServerOnlineTest.java:325)
>       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>       at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>       at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>       at java.lang.reflect.Method.invoke(Unknown Source)
>       at junit.framework.TestCase.runTest(TestCase.java:168)
>       at junit.framework.TestCase.runBare(TestCase.java:134)
>       at junit.framework.TestResult$1.protect(TestResult.java:110)
>       at junit.framework.TestResult.runProtected(TestResult.java:128)
>       at junit.framework.TestResult.run(TestResult.java:113)
>       at junit.framework.TestCase.run(TestCase.java:124)
>       at junit.framework.TestSuite.runTest(TestSuite.java:232)
>       at junit.framework.TestSuite.run(TestSuite.java:227)
>       at 
> org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:81)
>       at 
> org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:45)
>       at 
> org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
>       at 
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
>       at 
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
>       at 
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
>       at 
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
> 
> I tracked this error down to the fact that the 
> SchemaFactory.getInstance(name.getNamespaceURI()) is returning null (around 
> line 921 in WFSTransactionComplexTypes class).
> 
> 
> 
> 

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Geotools-devel mailing list
Geotools-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to