Sorry, forgot to paste the root cause of that exception, but here's the
whole thing:

java.lang.RuntimeException: Parsing failed for AllowedValues:
java.lang.RuntimeException: Unable to set property: Value for eobject: {
http://www.opengis.net/ows/1.1}AllowedValues
 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.xs.XMLSchemaValidator.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 WCSTest.testWCS(WCSTest.java:40)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
 at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
 at junit.framework.TestCase.runTest(TestCase.java:154)
at junit.framework.TestCase.runBare(TestCase.java:127)
 at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
 at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
 at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
 at
org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
 at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
 at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: java.lang.RuntimeException: Unable to set property: Value for
eobject: {http://www.opengis.net/ows/1.1}AllowedValues
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)
... 34 more
Caused by: java.lang.ClassCastException: The feature 'value's type
'ValueType' does not permit a value of type 'java.lang.String'
 at
org.eclipse.emf.ecore.impl.EStructuralFeatureImpl$BasicFeatureMapEntry.validate(EStructuralFeatureImpl.java:2942)
at
org.eclipse.emf.ecore.util.FeatureMapUtil.createEntry(FeatureMapUtil.java:181)
 at
org.eclipse.emf.ecore.util.BasicFeatureMap.createEntry(BasicFeatureMap.java:103)
at
org.eclipse.emf.ecore.util.BasicFeatureMap.addAll(BasicFeatureMap.java:1440)
 at
org.eclipse.emf.ecore.util.FeatureMapUtil$FeatureEList.addAll(FeatureMapUtil.java:763)
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)
 ... 37 more

This seems to be saying that it's parsed the ValueType into a String
(sounds sensible), but the model is expecting something else (perhaps a
ValueType object). Is this correct? Any hints on how to fix such a problem?

Thanks again and sorry for the newbie questions :-)

Jon


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

> Thanks for the info Jody.
>
> I've been playing around with it a bit today and I've got some bindings
> generated. I'm having trouble parsing a Capabilities response however and
> getting the following exception.
>
> java.lang.RuntimeException: Parsing failed for AllowedValues:
> java.lang.RuntimeException: Unable to set property: Value for eobject: {
> http://www.opengis.net/ows/1.1}AllowedValues
>
> From what I can gather, this should be handled by the OWS bindings in
> gt-xsd-ows and looking at the code this seems correct:
>
>
> https://github.com/geotools/geotools/blob/master/modules/extension/xsd/xsd-ows/src/main/java/org/geotools/ows/v1_1/OWSConfiguration.java
>
> Does this mean that there are problems with the OWS configuration? Or is
> there just something wrong with my setup?
>
> Thanks,
>
> Jon
>
>
> On 19 November 2012 12:17, Jody Garnett <jody.garn...@gmail.com> wrote:
>
>>  The docs for XML fun and games is here:
>> -
>> http://docs.geotools.org/latest/userguide/library/xml/internal/index.html
>>
>> In particular the tutor
>>
>> The objects are here (these are often EMF generated from schema):
>> -
>> https://github.com/geotools/geotools/tree/master/modules/ogc/net.opengis.wcs
>>
>> The bindings are here:
>> -
>> https://github.com/geotools/geotools/tree/master/modules/extension/xsd/xsd-wcs
>>
>> I also could not find any test cases for WCS.
>>
>> Checking over in the geoserver code base… yep found it!
>>
>> - 
>> DescribeCoverageXmlParserTest.java<https://github.com/geoserver/geoserver/blob/master/src/wcs1_1/src/test/java/org/geoserver/wcs/xml/DescribeCoverageXmlParserTest.java>
>> - 
>> GetCoverageXmlParserTest.java<https://github.com/geoserver/geoserver/blob/master/src/wcs1_1/src/test/java/org/geoserver/wcs/xml/GetCoverageXmlParserTest.java>
>> - 
>> GetCapabilitiesXmlParserTest.java<https://github.com/geoserver/geoserver/blob/master/src/wcs1_1/src/test/java/org/geoserver/wcs/xml/GetCapabilitiesXmlParserTest.java>
>>
>> Now they are only testing parsing the responses, not encoding them. But
>> you can at least se the configuration that is required.
>> --
>> Jody Garnett
>>
>> On Monday, 19 November 2012 at 7:07 PM, Jon Britton wrote:
>>
>> Hi Jody,
>>
>> Thanks for the response. Could you possibly point me to some examples of
>> WCS XML parsing/encoding in GeoTools? Also, is there any documentation on
>> how to handle XML with GeoTools? Is there a standard way?
>>
>> Thanks,
>>
>> Jon
>>
>>
>> On 17 November 2012 14:42, Jody Garnett <jody.garn...@gmail.com> wrote:
>>
>>  Often you will find that only the parsing of Requests will have been
>> tested (as that is what GeoServer uses), and possibly the encoding of
>> Responses.
>>
>> However if you would like to step up and write test cases for the other
>> side of the coin you may be able to pull together a viable client.  I agree
>> that it would be great!
>>
>> --
>> Jody Garnett
>>
>> On Saturday, 17 November 2012 at 11:04 PM, Jon Britton wrote:
>>
>> Hi guys,
>>
>> I've noticed that there are Java bindings for the WCS schema in GeoTools.
>> I realise that there is no WCS client in GeoTools yet, but is there
>> something buried away in there to help with parsing WCS responses in Java
>> objects?
>>
>> I've got a very hacky WCS client which uses code generated using Eclipse
>> EMF. I'd like to get rid of all this if possible as it's a nightmare to
>> deal with.
>>
>> Thanks,
>>
>> Jon
>>
>> ------------------------------------------------------------------------------
>> 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