For what it's worth commenting out that entire block makes things work.
Hi Justin, I have found that debugging SchemaFactory class, we
obtain a null schena
private synchronized Schema getRealInstance(URI targetNamespace) {
Schema r = (Schema) schemas.get(targetNamespace); // r is *null*
......
}
so WFSTransactionComplexTypes.encode return a NullException
public void encode(Element element, Object value, PrintHandler
output, Map hints) throws IOException, OperationNotSupportedException {
....
Schema schema = SchemaFactory.getInstance( name.getNamespaceURI() );
//*schema is null*
Element els = schema.getElements(); //NullException
.....
}
Is there any problem with the tagetNameSpace URI? It works
registering the URI with next code, before making the commit.
URI uri = new URI(store.getSchema().getName().getNamespaceURI());
Schema schema = SchemaFactory.getInstance(uri ,uri, Level.FINE );
...
insert.commit();
PD: I think that you could invoke this method
SchemaFactory.getInstance(uri ,uri, Level.FINE );
instead of:
SchemaFactory.getInstance( name.getNamespaceURI() ); at
WFSTransactionComplexTypes.encode;
Excuse my English,
*Thank you very much*
El 9 de junio de 2009 8:16, Juan Manuel Sánchez Martagón
<peruxho@anonymised.com <mailto:peruxho@anonymised.com>> escribió:
Hi, you are absolutely right, I realized yesterday that problem
but I had to put the attribute ' version=1.0.0'
to get the class instance of WFSFactoryStore and now I have
another problem and the jvm throw this Exception in line
'insert.commit();'.
/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)/
Excuse my English,
*Thank you very much*
El 9 de junio de 2009 5:50, Justin Deoliveira
<jdeolive@anonymised.com <mailto:jdeolive@anonymised.com>> escribió:
Hi,
What is the value of geoServerConfig.getWFSServerUrl()?
My guess is that it is incomplete, and does not include the
"&request=GetCapabilities" parameter. Just a guess based on
the error, and i tried a quick test using your code and when
i left it off I indeed replicated the error message.
-Justin
Juan Manuel Sánchez Martagón wrote:
Hi, We're working with Geoserver 1.7.3 and Geotools 2.5.5.
We are trying to insert features in a Geoserver layer
trough WFS transactions (like says at
http://docs.codehaus.org/display/GEOTDOC/07+FeatureStore)
but We have the next exception:
org.geotools.data.DataSourceException: Exception Report
Could not determine geoserver request
from http request
org.apache.catalina.connector.RequestFacade@anonymised.com
Exception Code:MissingParameterValue Locator: request
executing this code:
public static void addFeatures(String layer,
List<Map<String, Object>> featAttribs) {
.....
Transaction insert = new DefaultTransaction("insert");
map = new HashMap(); map.put(WFSDataStoreFactory.URL.key,
geoServerConfig.getWFSServerUrl());
map.put(WFSDataStoreFactory.TIMEOUT.key, new
Integer(10000));
wfsDataStore = (new
WFSDataStoreFactory()).createDataStore(map); featStore = (FeatureStore<SimpleFeatureType,
SimpleFeature>) wfsDataStore.getFeatureSource( layer );
featStore.setTransaction(insert);
featBuilder = new
SimpleFeatureBuilder(featStore.getSchema()); collection = FeatureCollections.newCollection();
for(Map<String, Object> featAttribsMap :
featAttribs){
for(String key : featAttribsMap.keySet()){
featBuilder.set(key,
featAttribsMap.get(key)); }
//null para que genere un id por defecto
feat = featBuilder.buildFeature(null);
collection.add(feat);
}
featStore.addFeatures( collection );
insert.commit();
.......
}
Any advice please? (Thank you very much, this is my
presentation message!)
------------------------------------------------------------------------
------------------------------------------------------------------------------
OpenSolaris 2009.06 is a cutting edge operating system
for enterprises looking to deploy the next generation of
Solaris that includes the latest innovations from Sun
and the OpenSource community. Download a copy and enjoy
capabilities such as Networking, Storage and
Virtualization. Go to: http://p.sf.net/sfu/opensolaris-get
------------------------------------------------------------------------
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
<mailto:Geoserver-users@lists.sourceforge.net>
https://lists.sourceforge.net/lists/listinfo/geoserver-users
-- Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.
------------------------------------------------------------------------
------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing server and web deployment.
http://p.sf.net/sfu/businessobjects
------------------------------------------------------------------------
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users