Unmarshalling Error: unexpected element 错误的解决

本文介绍了在调用接口过程中遇到的XML与Java对象转换失败的问题,并给出了具体的异常信息及解决办法。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

[javax.xml.bind.UnmarshalException: unexpected element (uri:"", local:"finOver"). Expected elements are <{}deptName>,<{}lastChangTime>,<{}cityId>,<{}remark>,<{}registerFund>,<{}modifyDate>,<{}channelSource>,<{}custNature>,<{}isRedeempoints>,<{}companyProperty>,<{}city>,<{}custPotentialType>,<{}billTitle>,<{}shuttleAddressList>,<{}recommendCust>,<{}province>,<{}bussType>,<{}simpleName>,<{}upgradeSource>,<{}lastYearProfit>,<{}focusDeptId>,<{}isSpecial>,<{}isImportCustor>,<{}isParentCompany>,<{}mainContact>,<{}createUser>,<{}parentCompanyId>,<{}contactId>,<{}custNumber>,<{}custName>,<{}custStatus>,<{}deptId>,<{}versionNumber>,<{}lastYearIncome>,<{}isAcceptMarket>,<{}provinceId>,<{}tradeId>,<{}preferenceService>,<{}nextLevel>,<{}focusDeptName>,<{}responsibillity>,<{}parentNumber>,<{}areaId>,<{}id>,<{}becomeMemTime>,<{}createDate>,<{}isTranGoods>,<{}surplusMonthlyStatementMoney>,<{}custType>,<{}custId>,<{}accountList>,<{}registAddress>,<{}contactList>,<{}logs>,<{}jshAddress>,<{}companyScop>,<{}degree>,<{}procRedit>,<{}modifyUser>,<{}isFocusPay>,<{}taxregNumber>,<{}channel>,<{}brandWorth>]
 at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.handleStreamException(UnmarshallerImpl.java:425)
 at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:362)
 at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:339)
 at org.apache.cxf.jaxb.JAXBEncoderDecoder.unmarshall(JAXBEncoderDecoder.java:764)
 ... 121 more

在调用接口的时候遇到了这个问题,[javax.xml.bind.UnmarshalException就是转换xml文件和java对象的时候报错。最后确定下来的原因是我所调用的接口返回参数已经修改,而本地没有更新。

解决方法是重新生成客户端代码。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值