访问http://域名/msg就报错
波总,这是什么错误?
接收消息:
[Fatal Error] :1:1: 文件提前结束。
09-Apr-2016 15:11:33.874 SEVERE [http-apr-80-exec-10] com.jfinal.core.ActionHandler.error /msg
java.lang.RuntimeException: org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 1; 文件提前结束。
at com.jfinal.weixin.sdk.kit.XmlKit.parse(XmlKit.java:45)
at com.jfinal.weixin.sdk.msg.InMsgParser.parse(InMsgParser.java:38)
at com.jfinal.weixin.sdk.jfinal.MsgController.getInMsg(MsgController.java:142)
at com.jfinal.weixin.sdk.jfinal.MsgController.index(MsgController.java:54)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at com.jfinal.aop.Invocation.invoke(Invocation.java:73)
at com.jfinal.weixin.sdk.jfinal.MsgInterceptor.intercept(MsgInterceptor.java:46)
at com.jfinal.aop.Invocation.invoke(Invocation.java:67)
at com.jfinal.core.ActionHandler.handle(ActionHandler.java:74)
at com.jfinal.core.JFinalFilter.doFilter(JFinalFilter.java:72)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:217)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:184)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:105)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:506)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:361)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:1080)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:75)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:757)
at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2287)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 1; 文件提前结束。
at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:257)
at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:348)
at com.jfinal.weixin.sdk.kit.XmlKit.parse(XmlKit.java:39)
... 30 more
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我好像也遇到了这个问题。
[Fatal Error] :1:1: Premature end of file.
2016-4-11 16:24:59 com.jfinal.core.ActionHandler error
严重: /msg
java.lang.RuntimeException: org.xml.sax.SAXParseException: Premature end of file.
at com.jfinal.weixin.sdk.kit.MsgEncryptKit.decrypt(MsgEncryptKit.java:74)
at com.jfinal.weixin.sdk.jfinal.MsgController.getInMsgXml(MsgController.java:132)
at com.jfinal.weixin.sdk.jfinal.MsgController.index(MsgController.java:50)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
Caused by: org.xml.sax.SAXParseException: Premature end of file.
我是通过微信的调试工具访问的,还是没搞懂为什么错。
是我微信哪里配置错了?
回复
看一下控制台的 jfinal action report 输出的 xml 交互 message 是否正确,是否有异常抛出。如果控制台没有任何输出,需要配置好日志,以及设置好开发模式:me.setDevMode(true)