Hi Justin,
I've attached a simplified testclass.

Matthias

2012/10/18 Justin Deoliveira <[email protected]>

> Hmmm.... not sure. Any chance you provide some code i can run that
> reproduces the error?
>
> On Wed, Oct 17, 2012 at 12:51 PM, Leiche teich <[email protected]>wrote:
>
>>
>>
>> 2012/10/17 Justin Deoliveira <[email protected]>
>>
>>> Oops sorry, that is what i get for writing code without looking. The
>>> QName passed in is the Name of the root element to encode.
>>
>> No problem, but i get an Exception:
>> Exception in thread "Thread-2" java.lang.RuntimeException: Failed to get
>> property: lockId
>>  at
>> org.geotools.xml.impl.GetPropertyExecutor.visit(GetPropertyExecutor.java:105)
>> at
>> org.geotools.xml.impl.BindingWalker$BindingExecutionChain.execute(BindingWalker.java:220)
>>  at org.geotools.xml.impl.BindingWalker.walk(BindingWalker.java:186)
>> at
>> org.geotools.xml.impl.BindingVisitorDispatch.walk(BindingVisitorDispatch.java:47)
>>  at
>> org.geotools.xml.impl.BindingVisitorDispatch.walk(BindingVisitorDispatch.java:32)
>> at org.geotools.xml.Encoder.encode(Encoder.java:883)
>>  at org.geotools.xml.Encoder.encode(Encoder.java:584)
>>
>> How can i set the lockId property or whats wrong????
>>
>>
>>> In this case it would be:
>>>
>>> encoder.encode(features, org.geotools.wfs.v1_0.WFS.FeatureCollection,
>>> output)
>>>
>>>
>>>
>>> On Wed, Oct 17, 2012 at 10:40 AM, Leiche teich 
>>> <[email protected]>wrote:
>>>
>>>> Hi Justin,
>>>>
>>>> thanks for your very fast response :-)
>>>>
>>>> 2012/10/17 Justin Deoliveira <[email protected]>
>>>>
>>>>> You should be able to do this.
>>>>>
>>>>> Encoder e = new Encoder(new org.geotools.wfs.v1_0.WFSConfiguration());
>>>>> e.encoder(features, output);
>>>>>
>>>> There are only encode methods, wich needs a QName. How do i have to do
>>>> that?
>>>>
>>>> Matthias
>>>>
>>>>>
>>>>> -Justin
>>>>>
>>>>> On Wed, Oct 17, 2012 at 8:54 AM, Leiche teich <[email protected]
>>>>> > wrote:
>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> what is the prefered way to write a FeatureCollection into a GML
>>>>>> file? Are there a GML DataStore implementation? I've found only this one:
>>>>>> http://docs.geotools.org/latest/userguide/library/xml/geometry.html#gml2-encoding-example
>>>>>> But there are some problems. With Version.GML2 i get
>>>>>> an IllegalStateException "Cannot encode a feature collection using GML2
>>>>>> (only WFS)" or is set the legacy mode flag. And with Version.GML3 the GML
>>>>>> file is empty. If i look in org.geotools.GML.java, in
>>>>>> the encode(OutputStream out, SimpleFeatureCollection collection) method, 
>>>>>> i
>>>>>> see that Version.GML3 will be ignored.
>>>>>> And at the last, there is a typo in the above document:
>>>>>>
>>>>>> encode2.encode(out2, collection);
>>>>>>
>>>>>> should IMHO be
>>>>>>
>>>>>> encode2.encode(xml, collection);
>>>>>>
>>>>>> Thanks for your help
>>>>>>
>>>>>> Matthias
>>>>>>
>>>>>>
>>>>>> ------------------------------------------------------------------------------
>>>>>> Everyone hates slow websites. So do we.
>>>>>> Make your web apps faster with AppDynamics
>>>>>> Download AppDynamics Lite for free today:
>>>>>> http://p.sf.net/sfu/appdyn_sfd2d_oct
>>>>>> _______________________________________________
>>>>>> GeoTools-GT2-Users mailing list
>>>>>> [email protected]
>>>>>> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Justin Deoliveira
>>>>> OpenGeo - http://opengeo.org
>>>>> Enterprise support for open source geospatial.
>>>>>
>>>>>
>>>>
>>>>
>>>> ------------------------------------------------------------------------------
>>>> Everyone hates slow websites. So do we.
>>>> Make your web apps faster with AppDynamics
>>>> Download AppDynamics Lite for free today:
>>>> http://p.sf.net/sfu/appdyn_sfd2d_oct
>>>> _______________________________________________
>>>> GeoTools-GT2-Users mailing list
>>>> [email protected]
>>>> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>>>>
>>>>
>>>
>>>
>>> --
>>> Justin Deoliveira
>>> OpenGeo - http://opengeo.org
>>> Enterprise support for open source geospatial.
>>>
>>>
>>
>>
>> ------------------------------------------------------------------------------
>> Everyone hates slow websites. So do we.
>> Make your web apps faster with AppDynamics
>> Download AppDynamics Lite for free today:
>> http://p.sf.net/sfu/appdyn_sfd2d_oct
>> _______________________________________________
>> GeoTools-GT2-Users mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>>
>>
>
>
> --
> Justin Deoliveira
> OpenGeo - http://opengeo.org
> Enterprise support for open source geospatial.
>
>

Attachment: GmlTest.java
Description: Binary data

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_sfd2d_oct
_______________________________________________
GeoTools-GT2-Users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to