Hi again guys,

I'm getting on with parsing a WCS capabilities document but I've come
against a problem with parsing the the SupportedCRS property of the
Contents type. A SupportedCRS is actually a "AnyURI", which according to
the generated model code should parse as a String. However if I'm reading
the exception correctly, it seems it's being parsed as a java.net.URI. I
can't figure out where this is actually happening or how to prevent it!

I've looked at some of the other models and binding code (a WFS FeatureType
has a "otherSRS" list which is similar) but I can't find any differences
which would account for this problem.

Anyway, here is the exception I'm getting:

java.lang.RuntimeException: Parsing failed for Contents:
java.lang.RuntimeException: Unable to set property: SupportedCRS for
eobject: {http://www.opengis.net/wcs/1.1.1}Contents
 at org.geotools.xml.impl.ParseExecutor.visit(ParseExecutor.java:164)
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.ElementHandlerImpl.endElement(ElementHandlerImpl.java:233)
 at org.geotools.xml.impl.ParserHandler.endElement(ParserHandler.java:698)
at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
 at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown
Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
Source)
 at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
 at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
 at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.geotools.xml.Parser.parse(Parser.java:239)
 at org.geotools.xml.Parser.parse(Parser.java:167)
at org.geotools.wcs.test.WCSTest.testWCS(WCSTest.java:19)
Caused by: java.lang.RuntimeException: Unable to set property: SupportedCRS
for eobject: {http://www.opengis.net/wcs/1.1.1}Contents
at
org.geotools.xml.AbstractComplexEMFBinding.setProperty(AbstractComplexEMFBinding.java:301)
 at
org.geotools.xml.AbstractComplexEMFBinding.setProperties(AbstractComplexEMFBinding.java:206)
at
org.geotools.xml.AbstractComplexEMFBinding.parse(AbstractComplexEMFBinding.java:147)
 at org.geotools.xml.impl.ParseExecutor.visit(ParseExecutor.java:155)
... 43 more
Caused by: java.lang.ArrayStoreException: java.net.URI
 at org.eclipse.emf.common.util.BasicEList.assign(BasicEList.java:124)
at org.eclipse.emf.common.util.BasicEList.addAllUnique(BasicEList.java:514)
 at
org.eclipse.emf.common.notify.impl.NotifyingListImpl.doAddAllUnique(NotifyingListImpl.java:506)
at
org.eclipse.emf.common.notify.impl.NotifyingListImpl.addAllUnique(NotifyingListImpl.java:478)
 at
org.eclipse.emf.common.notify.impl.NotifyingListImpl.addAllUnique(NotifyingListImpl.java:406)
at org.eclipse.emf.common.util.AbstractEList.addAll(AbstractEList.java:374)
 at org.geotools.xml.EMFUtils.add(EMFUtils.java:169)
at org.geotools.xml.EMFUtils.add(EMFUtils.java:144)
 at
org.geotools.xml.AbstractComplexEMFBinding.setProperty(AbstractComplexEMFBinding.java:234)
... 46 more


On 22 November 2012 09:56, Jon Britton <jonbritt...@gmail.com> wrote:

> Hi,
>
> I think I've solved my problem. It seems that it was something to do with
> the layout of my project and that my .xsd files weren't in my
> src/main/resources directory.
>
> Cheers!
>
>
> On 21 November 2012 23:10, Jody Garnett <jody.garn...@gmail.com> wrote:
>
>> You config should include both sets of bindings?
>>
>> --
>> Jody Garnett
>>
>> On 22/11/2012, at 8:45 AM, Jon Britton <jonbritt...@gmail.com> wrote:
>>
>> BTW, when I try to parse using only the OWSConfiguration it seems to work
>> ok (although it produces a Map rather than a Capabilities object). However,
>> when I try to use my WCSConfiguration it fails. As far as I can tell I've
>> set up my configuration the same as in GeoServer.
>>
>> I get the impression I'm missing something obvious.
>>
>> Jon
>>
>> On 21 November 2012 09:48, Jon Britton <jonbritt...@gmail.com> wrote:
>>
>>> @Andrea - No I'm using trunk too.
>>>
>>> @Justin - here is the XML I'm trying to parse
>>>
>>>
>>> https://github.com/deadpassive/xml-wcs/blob/master/src/test/java/capabilities.xml
>>>
>>> Which I retrieved from here:
>>>
>>>
>>> http://geoprocessing.demo.52north.org:8080/geoserver/ows?service=wcs&version=1.1.1&request=GetCapabilities
>>>
>>> You can also see the rest of my code in that project. As it is, I've
>>> only got one binding on my configuration at the moment. As I was going to
>>> add them as I went.
>>>
>>>
>>> https://github.com/deadpassive/xml-wcs/blob/master/src/main/java/org/geotools/wcs/WCSConfiguration.java
>>>
>>>
>>>
>>> On 21 November 2012 08:24, Andrea Aime <andrea.a...@geo-solutions.it>wrote:
>>>
>>>> On Wed, Nov 21, 2012 at 5:49 AM, Justin Deoliveira <
>>>> jdeol...@opengeo.org> wrote:
>>>>
>>>>> Yeah, probably an issue with the ows bindings. Unfortunately they are
>>>>> sort of battle tested as someone tries to support parsing or encoding of a
>>>>> specific schema.
>>>>>
>>>>> @Jon: Could you provide the document you are trying to parse, i will
>>>>> take a look to see what the issue is.
>>>>>
>>>>> That said, I just whipped up a quick test case to test parsing one of
>>>>> the sample ows capabilities documents. Found here:
>>>>>
>>>>>
>>>>> http://schemas.opengis.net/ows/1.1.0/Examples/exampleCapabilities1.xml
>>>>>
>>>>> The test case (which i just added) is here.
>>>>>
>>>>>
>>>>> https://github.com/geotools/geotools/blob/master/modules/extension/xsd/xsd-ows/src/test/java/org/geotools/ows/v1_1/CapabilitiesParseTest.java
>>>>>
>>>>> And indeed it did not pass at first, i had to add a binding that was
>>>>> missing.
>>>>>
>>>>>
>>>>> https://github.com/geotools/geotools/commit/98239d5d8d8737dad766576a1d59218f75af8bd2
>>>>>
>>>>> That said the AllowedValues element did parse properly as is.
>>>>>
>>>>
>>>> As a note, I already made a few little improvements in that area, but
>>>> only on trunk, to make CSW
>>>> capabilities document parse/encode properly (which is also based on OWS
>>>> 1.1).
>>>> It may also be that Jon is using the stable series (8.x) instead
>>>>
>>>> Cheers
>>>> Andrea
>>>>
>>>> --
>>>> ==
>>>> Our support, Your Success! Visit http://opensdi.geo-solutions.it for
>>>> more information.
>>>> ==
>>>>
>>>> Ing. Andrea Aime
>>>> @geowolf
>>>> Technical Lead
>>>>
>>>> GeoSolutions S.A.S.
>>>> Via Poggio alle Viti 1187
>>>> 55054  Massarosa (LU)
>>>> Italy
>>>> phone: +39 0584 962313
>>>> fax: +39 0584 1660272
>>>> mob: +39  339 8844549
>>>>
>>>> http://www.geo-solutions.it
>>>> http://twitter.com/geosolutions_it
>>>>
>>>> -------------------------------------------------------
>>>>
>>>>
>>>>
>>>> ------------------------------------------------------------------------------
>>>> Monitor your physical, virtual and cloud infrastructure from a single
>>>> web console. Get in-depth insight into apps, servers, databases, vmware,
>>>> SAP, cloud infrastructure, etc. Download 30-day Free Trial.
>>>> Pricing starts from $795 for 25 servers or applications!
>>>> http://p.sf.net/sfu/zoho_dev2dev_nov
>>>> _______________________________________________
>>>> GeoTools-Devel mailing list
>>>> GeoTools-Devel@lists.sourceforge.net
>>>> https://lists.sourceforge.net/lists/listinfo/geotools-devel
>>>>
>>>>
>>>
>>
>> ------------------------------------------------------------------------------
>> Monitor your physical, virtual and cloud infrastructure from a single
>> web console. Get in-depth insight into apps, servers, databases, vmware,
>> SAP, cloud infrastructure, etc. Download 30-day Free Trial.
>> Pricing starts from $795 for 25 servers or applications!
>> http://p.sf.net/sfu/zoho_dev2dev_nov
>>
>> _______________________________________________
>> GeoTools-Devel mailing list
>> GeoTools-Devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/geotools-devel
>>
>>
>
------------------------------------------------------------------------------
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
_______________________________________________
GeoTools-Devel mailing list
GeoTools-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to