报如下错,无法调用,不知什么原因

杰灵 发布于 2015/06/24 15:51
阅读 1K+
收藏 0

ava.lang.IllegalArgumentException
	java.net.URI.create(URI.java:841)
	org.apache.http.client.methods.HttpGet.<init>(HttpGet.java:69)
	me.chanjar.weixin.mp.api.WxMpServiceImpl.getAccessToken(WxMpServiceImpl.java:106)
	me.chanjar.weixin.mp.api.WxMpServiceImpl.executeInternal(WxMpServiceImpl.java:559)
	me.chanjar.weixin.mp.api.WxMpServiceImpl.execute(WxMpServiceImpl.java:535)
	me.chanjar.weixin.mp.api.WxMpServiceImpl.customMessageSend(WxMpServiceImpl.java:179)
	com.lin.weixin.test.SendMsgServlet.doPost(SendMsgServlet.java:97)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:722)

root cause

java.net.URISyntaxException: Illegal character in query at index 133: https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=wx264329620ef78a4f&secret=39b9e65956f62b83c527d97f8ee3fd36 
	java.net.URI$Parser.fail(URI.java:2810)
	java.net.URI$Parser.checkChars(URI.java:2983)
	java.net.URI$Parser.parseHierarchical(URI.java:3073)
	java.net.URI$Parser.parse(URI.java:3015)
	java.net.URI.<init>(URI.java:577)
	java.net.URI.create(URI.java:839)
	org.apache.http.client.methods.HttpGet.<init>(HttpGet.java:69)
	me.chanjar.weixin.mp.api.WxMpServiceImpl.getAccessToken(WxMpServiceImpl.java:106)
	me.chanjar.weixin.mp.api.WxMpServiceImpl.executeInternal(WxMpServiceImpl.java:559)
	me.chanjar.weixin.mp.api.WxMpServiceImpl.execute(WxMpServiceImpl.java:535)
	me.chanjar.weixin.mp.api.WxMpServiceImpl.customMessageSend(WxMpServiceImpl.java:179)
	com.lin.weixin.test.SendMsgServlet.doPost(SendMsgServlet.java:97)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:722)

加载中
0
jarchan
jarchan
secret 后面有个空格
0
王瑞平
王瑞平
非法字符
0
fly2xiang
fly2xiang
问题表面看就是非法字符,你检查下URL,另外你的AppID和AppSecret暴漏了,赶快重置AppSecret吧
0
杰灵
杰灵
已解决,就是有一个空格。
返回顶部
顶部