Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WxCpTpXmlMessage类中order字段上@XStreamConverter注解有误,导致创建部门事件解析失败 #1982

Closed
ibootz opened this issue Jan 28, 2021 · 2 comments
Milestone

Comments

@ibootz
Copy link

ibootz commented Jan 28, 2021

简要描述

企业微信第三方应用开发过程中,需要监听微信的新增部门事件,在将解析好的xml数据映射到WxCpTpXmlMessage时,报了下面日志中的错误。

模块版本情况

  • WxJava 模块名: CpTp
  • WxJava 版本号: weixin-java-cp-4.0.0

详细描述

企业微信第三方应用开发过程中,需要监听微信的新增部门事件,在将解析好的xml数据映射到WxCpTpXmlMessage时,报了下面日志中的错误。经调试发现,应该是order字段声明为了Integer类型,但是字段上面的注解@XStreamConverter(value = XStreamCDataConverter.class)仍然是解析string类型的转换类。

日志

以下是解析完xml之后,映射给WxCpTpXmlMessage类时报的错误堆栈
com.thoughtworks.xstream.converters.ConversionException: Explicit selected converter cannot handle type
---- Debugging information ----
message : Explicit selected converter cannot handle type
item-type : java.lang.Integer
converter-type : com.thoughtworks.xstream.converters.SingleValueConverterWrapper
class : me.chanjar.weixin.cp.bean.message.WxCpTpXmlMessage
required-type : me.chanjar.weixin.cp.bean.message.WxCpTpXmlMessage
converter-type[1] : com.thoughtworks.xstream.converters.reflection.ReflectionConverter
line number : 1
version : not available

at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:59)
at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshallField(AbstractReflectionConverter.java:499)
at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.doUnmarshal(AbstractReflectionConverter.java:425)
at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshal(AbstractReflectionConverter.java:277)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:50)
at com.thoughtworks.xstream.core.TreeUnmarshaller.start(TreeUnmarshaller.java:134)
at com.thoughtworks.xstream.core.AbstractTreeMarshallingStrategy.unmarshal(AbstractTreeMarshallingStrategy.java:32)
@jyjyjyy
Copy link

jyjyjyy commented Jan 28, 2021

我刚好也遇到了这个问题了,期待解决

@binarywang
Copy link
Member

欢迎直接提交PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants