gpt4 book ai didi

java - xml 解码错误 jaxb 预期元素中存在意外元素

转载 作者:行者123 更新时间:2023-12-01 11:11:12 26 4
gpt4 key购买 nike

我发现一个可以解释的错误,在解码jaxb中抛出一个错误,它说xml有一个意外的元素,但在expeted元素中它出现了:

javax.xml.bind.UnmarshalException: 
unexpected element (uri:"urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0", local:"AdhocQueryResponse").
Expected elements are <{urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0}Action>,<{urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0}Address>,<{urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0}AdhocQuery>,<{urn:oasis:names:tc:ebxml-regrep:xsd:query:3.0}AdhocQueryResponse>,<{urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0}Association>,<{urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0}AuditableEvent>,<{urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0}Classification>,<{urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0}ClassificationNode>,<{urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0}ClassificationScheme>,<{urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0}Description>,<{urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0}EmailAddress>,<{urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0}ExternalIdentifier>,<{urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0}ExternalLink>,<{urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0}ExtrinsicObject>,<{urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0}Federation>,<{urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0}Identifiable>,<{urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0}InternationalString>,<{urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0}LocalizedString>,<{urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0}Name>,<{urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0}Notification>,<{urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0}NotifyAction>,<{urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0}ObjectRef>,<{urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0}ObjectRefList>,<{urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0}Organization>,<{urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0}Person>,<{urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0}PersonName>,<{urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0}PostalAddress>,<{urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0}QueryExpression>,<{urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0}Registry>,<{urn:oasis:names:tc:ebxml-regrep:xsd:rs:3.0}RegistryError>,<{urn:oasis:names:tc:ebxml-regrep:xsd:rs:3.0}RegistryErrorList>,<{urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0}RegistryObject>,<{urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0}RegistryObjectList>,<{urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0}RegistryPackage>,<{urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0}Service>,<{urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0}ServiceBinding>,<{urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0}Slot>,<{urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0}SlotList>,<{urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0}SpecificationLink>,<{urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0}Subscription>,<{urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0}TelephoneNumber>,<{urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0}UsageDescription>,<{urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0}UsageParameter>,<{urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0}User>,<{urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0}Value>,<{urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0}ValueList>

有什么想法吗?

最佳答案

事实并非如此。

意外元素:

{urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0}AdhocQueryResponse

预期元素包含:

{urn:oasis:names:tc:ebxml-regrep:xsd:query:3.0}AdhocQueryResponse

你的命名空间是错误的

关于java - xml 解码错误 jaxb 预期元素中存在意外元素,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32348104/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com