收藏
回答

公众号服务器配置url,验证token一直出错,为什么?

江湖救急:

在公众号A上配置好url,token验证通过并能正常跑起来,

但在公众号B上配置相同的配置,却一直提示token验证失败,后台报错:

Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.dom4j.DocumentException: Error on line 1 of document  : 文件提前结束。] with root cause




最后一次编辑于  11-20
回答关注问题邀请回答
收藏

2 个回答

  • Hanks
    Hanks
    11-20

    同一个接口吗?对请求做不同公众号的区分了吗

    11-20
    赞同
    回复 11
    • Ethan文
      Ethan文
      11-20
      2个接口,两个token,其他都是一样,一个测试一个正式,测试通过,正式一直验证失败
      11-20
      回复
    • Hanks
      Hanks
      11-20回复Ethan文
      B的接收不到消息了?同样的环境?
      11-20
      回复
    • Ethan文
      Ethan文
      11-20回复Hanks
      B在提交验证token,就提示验证失败了
      11-20
      回复
    • Ethan文
      Ethan文
      11-20
      配置的url可以单独访问,token在代码中也和配置的token一致,一验证就提示“文件提前结束”
      11-20
      回复
    • Hanks
      Hanks
      11-20回复Ethan文
      俩环境一样吗?你后台报错。。。似曾相识,我也想不起来了,尴尬
      11-20
      回复
    查看更多(6)
  • Ethan文
    Ethan文
    11-20

    详细日志:

    org.xml.sax.SAXParseException: 文件提前结束。

    at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:203) ~[na:1.8.0_111]

    at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:177) ~[na:1.8.0_111]

    at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:400) ~[na:1.8.0_111]

    at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:327) ~[na:1.8.0_111]

    at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(XMLScanner.java:1472) ~[na:1.8.0_111]

    at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:1014) ~[na:1.8.0_111]

    at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:602) ~[na:1.8.0_111]

    at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:112) ~[na:1.8.0_111]

    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:505) ~[na:1.8.0_111]

    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:841) ~[na:1.8.0_111]

    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:770) ~[na:1.8.0_111]

    at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141) ~[na:1.8.0_111]

    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213) ~[na:1.8.0_111]

    at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:643) ~[na:1.8.0_111]

    at org.dom4j.io.SAXReader.read(SAXReader.java:445) ~[dom4j-2.1.1.jar!/:na]

    at org.dom4j.io.SAXReader.read(SAXReader.java:325) ~[dom4j-2.1.1.jar!/:na]

    at cn.helpin.token.base.BaseUtils.xmlToMap(BaseUtils.java:51) ~[classes!/:0.0.1]

    at cn.helpin.token.VerifyTokenController.verifyWXToken(VerifyTokenController.java:54) ~[classes!/:0.0.1]

    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_111]

    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_111]

    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_111]

    at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_111]

    at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:190) ~[spring-web-5.2.1.RELEASE.jar!/:5.2.1.RELEASE]

    at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:138) ~[spring-web-5.2.1.RELEASE.jar!/:5.2.1.RELEASE]

    at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:106) ~[spring-webmvc-5.2.1.RELEASE.jar!/:5.2.1.RELEASE]

    at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:888) ~[spring-webmvc-5.2.1.RELEASE.jar!/:5.2.1.RELEASE]

    at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:793) ~[spring-webmvc-5.2.1.RELEASE.jar!/:5.2.1.RELEASE]


    11-20
    赞同
    回复
问题标签