jfinal 微信开发 消息群发

求助!!项目需求 用jfinal进行微信开发 需要用到消息群发的接口 然后我用了一下

String jsonStr = "\"filter\":{\"is_to_all\":true},\"text\{\"content\":\"test\"},\"msgtype\":\"text\"}";

 ApiResult apiResult = MessageApi.sendAll(jsonStr);

报错如下:

严重: /msg?signature=cf6d41e63bbf195a5838f31b2c72a69404712422&timestamp=1479804675&nonce=998905130&openid=oK72cwlJxsueTKy_QpXsCy__gv0o

java.lang.RuntimeException: java.lang.reflect.InvocationTargetException

at com.jfinal.aop.Invocation.invoke(Invocation.java:87)

at com.jfinal.weixin.sdk.jfinal.MsgInterceptor.intercept(MsgInterceptor.java:54)

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.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1307)

at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:453)

at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)

at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:560)

at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)

at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1072)

at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:382)

at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)

at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1006)

at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)

at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)

at org.eclipse.jetty.server.Server.handle(Server.java:365)

at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:485)

at org.eclipse.jetty.server.AbstractHttpConnection.content(AbstractHttpConnection.java:937)

at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.content(AbstractHttpConnection.java:998)

at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:856)

at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:240)

at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)

at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:628)

at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52)

at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)

at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)

at java.lang.Thread.run(Unknown Source)

Caused by: java.lang.reflect.InvocationTargetException

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at com.jfinal.aop.Invocation.invoke(Invocation.java:73)

... 27 more

Caused by: java.lang.ExceptionInInitializerError

at com.jfinal.weixin.sdk.api.MessageApi.post(MessageApi.java:16)

at com.jfinal.weixin.sdk.api.MessageApi.sendAll(MessageApi.java:29)

at com.jfinal.weixin.demo.WeixinMsgController.processInTextMsg(WeixinMsgController.java:55)

at com.jfinal.weixin.sdk.jfinal.MsgController.index(MsgController.java:50)

... 32 more

Caused by: java.util.NoSuchElementException

at java.util.ServiceLoader$LazyIterator.nextService(Unknown Source)

at java.util.ServiceLoader$LazyIterator.next(Unknown Source)

at java.util.ServiceLoader$1.next(Unknown Source)

at com.jfinal.weixin.sdk.api.AccessTokenApi.<clinit>(AccessTokenApi.java:40)

... 36 more

请问各位大神哪边的错?在线等

评论区

JFinal

2016-11-22 17:03

下载首页的 jfinal weixin jar 包,换上试试

Dreamlu

2016-11-22 17:03

请下载jfinal-weixin1.8.jar

JFinal

2016-11-22 17:04

@Dreamlu 正打算找你呢,来得正是时候

Dreamlu

2016-11-22 17:11

@JFinal 公众号第三方平台相关API,上次合了这个版本之后就改不动了,下次还是把它先还原回去了,以后版本再加吧。

Nicolas_Husky

2016-11-22 17:21

@Dreamlu 我试了还是报错 就是AccessTokenApi.getAccessTokenStr()这句报错 这边有什么别的要求么

JFinal

2016-11-22 21:47

@Dreamlu 为啥一直对合并其他人的代码持非常谨慎的态度,就是担心这种情况发生

热门反馈

扫码入社