收藏
回答

微信支付回调接口 通过sdk解析xml时 报出异常,该如何避免?

微信支付回调接口

通过sdk解析xml时 报出异常:

org.xml.sax.SAXParseException: Premature end of file.

at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:257) ~[?:1.8.0_231]

at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:339) ~[?:1.8.0_231]

at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:121) ~[?:1.8.0_231]

at zeroup.cms.utile.wechatsdk.WXPayUtil.xmlToMap(WXPayUtil.java:96) ~[classes!/:0.0.5-SNAPSHOT]

at zeroup.cms.uzo.controller.app.ApiCommonController.wxpaycallback(ApiCommonController.java:356) [classes!/:0.0.5-SNAPSHOT]

at zeroup.cms.uzo.controller.app.ApiCommonController$$FastClassBySpringCGLIB$$48a64c36.invoke(<generated>) [classes!/:0.0.5-SNAPSHOT]

at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204) [spring-core-5.0.4.RELEASE.jar!/:5.0.4.RELEASE]

at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:747) [spring-aop-5.0.4.RELEASE.jar!/:5.0.4.RELEASE]

at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) [spring-aop-5.0.4.RELEASE.jar!/:5.0.4.RELEASE]

at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:89) [spring-aop-5.0.4.RELEASE.jar!/:5.0.4.RELEASE]

at zeroup.cms.aspect.MyAspect.doAround(MyAspect.java:106) [classes!/:0.0.5-SNAPSHOT]

at sun.reflect.GeneratedMethodAccessor115.invoke(Unknown Source) ~[?:?]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_231]

at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_231]


请问引起异常的原因, 以及该如何避免

回答关注问题邀请回答
收藏

1 个回答

  • 是小白啊
    是小白啊
    2020-01-06

    支付、卡券相关的问题请移步至微信支付专区https://developers.weixin.qq.com/community/pay提问,我们会有对应同学来处理

    2020-01-06
    有用
    回复 1
    • Law
      Law
      2020-01-06
      好的,那我拷贝一份,重新发帖.
      2020-01-06
      回复
登录 后发表内容
问题标签