Hi,
I've got a situation where JiBX marshals a document but can't re-read
and unmarshal that same document. There's only one binding file
involved. The output document looks correct and is well-formed, so, I'm
not sure what's causing the problem. Can anyone suggest what I may have
done wrong? Too many optional elements in a binding perhaps ;-) ?
Thanks,
...Leif
---[ the stack trace ]------------------
java.lang.RuntimeException: org.jibx.runtime.JiBXException: Expected
"{http://www.opengeospatial.net/ows}ServiceIdentification" end tag,
found "{http://www.opengeospatial.net/ows}Keywords" start tag (line 6,
col 15)
at
com.galdosinc.common.ogc.OgcUtilTest.unmarshal(OgcUtilTest.java:87)
at
com.galdosinc.common.ogc.OgcUtilTest.input(OgcUtilTest.java:145)
at
com.galdosinc.common.ogc.ows.capabilities.OwsCapabilitiesTest.testServic
eIdentification(OwsCapabilitiesTest.java:98)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
a:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Impl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at junit.framework.TestCase.runTest(TestCase.java:166)
at junit.framework.TestCase.runBare(TestCase.java:140)
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:131)
at junit.framework.TestSuite.runTest(TestSuite.java:173)
at junit.framework.TestSuite.run(TestSuite.java:168)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTe
stRunner.java:436)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRun
ner.java:311)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRu
nner.java:192)
Caused by: org.jibx.runtime.JiBXException: Expected
"{http://www.opengeospatial.net/ows}ServiceIdentification" end tag,
found "{http://www.opengeospatial.net/ows}Keywords" start tag (line 6,
col 15)
at
org.jibx.runtime.impl.UnmarshallingContext.parsePastCurrentEndTag(Unmars
hallingContext.java:1673)
at
com.galdosinc.common.ogc.ows.capabilities.JiBX_WRSCapabilitiesServiceIde
ntification_access.unmarshal()
at
com.galdosinc.common.ogc.ows.capabilities.BaseCapabilities.JiBX_WRSCapab
ilities_unmarshal_1_1(BaseCapabilities.java)
at
com.galdosinc.common.ogc.ows.capabilities.BaseCapabilities.JiBX_WRSCapab
ilities_unmarshal_1_2(BaseCapabilities.java)
at
com.galdosinc.common.ogc.ows.capabilities.JiBX_WRSCapabilitiesBaseCapabi
lities_access.unmarshal()
at
org.jibx.runtime.impl.UnmarshallingContext.unmarshalElement(Unmarshallin
gContext.java:5137)
at
org.jibx.runtime.impl.UnmarshallingContext.unmarshalDocument(Unmarshalli
ngContext.java:5457)
at
com.galdosinc.common.ogc.OgcUtilTest.unmarshal(OgcUtilTest.java:83)
... 17 more
---[ the mappings local to the error ]------------------
<mapping name="ServiceIdentification"
class="com.galdosinc.common.ogc.ows.capabilities.ServiceIdentification">
<namespace uri="http://www.opengeospatial.net/ows"
default="elements"/>
<value style="element" name="Title" field="title" usage="optional"/>
<value style="element" name="Abstract" field="abstractText"
usage="optional"/>
<collection field="keywordsList" usage="optional"
factory="org.jibx.runtime.Utility.arrayListFactory">
<structure map-as="com.galdosinc.common.ogc.iso19115.Keywords"/>
</collection>
<structure name="ServiceType" field="serviceType" usage="optional"
map-as="OwsCodeType"/>
<collection field="serviceTypeVersionList" usage="optional"
item-type="java.lang.String"
factory="org.jibx.runtime.Utility.arrayListFactory">
<value name="ServiceTypeVersion" style="element"
usage="optional"/>
</collection>
<value style="element" name="Fees" field="fees" usage="optional"/>
<collection field="accessConstraintList" usage="optional"
item-type="java.lang.String"
factory="org.jibx.runtime.Utility.arrayListFactory">
<value name="AccessConstraints" style="element" usage="optional"/>
</collection>
</mapping>
<mapping name="Keywords"
class="com.galdosinc.common.ogc.iso19115.Keywords">
<collection field="wordList" usage="optional"
item-type="java.lang.String"
factory="org.jibx.runtime.Utility.arrayListFactory">
<value name="Keyword" style="element"/>
</collection>
<structure name="Type" field="type" map-as="OwsCodeType"/>
</mapping>
<mapping abstract="true" type-name="OwsCodeType"
class="com.galdosinc.common.ogc.ows.capabilities.OwsCode">
<value style="text" field="code" usage="required"/>
<value style="attribute" name="codeSpace" field="codeSpace"
usage="optional"/>
</mapping>
---[ the test document ]------------------
<?xml version="1.0" encoding="UTF-8"?>
<Capabilities xmlns="http://www.opengeospatial.net/ows"
version="51515" updateSequence="1234567">
<ServiceIdentification>
<Title>A Web Service</Title>
<Abstract>This is the service abstract</Abstract>
<Keywords>
<Keyword>mungojerry</Keyword>
<Keyword>macavity</Keyword>
<Type codeSpace="the keyword codespace">keywords-test-type</Type>
</Keywords>
<ServiceType codeSpace="service type
codespace">ogc:csw</ServiceType>
<ServiceTypeVersion>1.0.0</ServiceTypeVersion>
<ServiceTypeVersion>2.3.9</ServiceTypeVersion>
<Fees>Service fee: $1.49 per use, free on weekends.</Fees>
<AccessConstraints>access constraint #1</AccessConstraints>
<AccessConstraints>access constraint #2</AccessConstraints>
</ServiceIdentification>
</Capabilities>
---[ end ]---------------------------------
-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
jibx-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jibx-users