NutzCN Logo
问答 做了个微信新浪登陆,结果报错找不到极光推送,不知道什么原因
发布于 2729天前 作者 shusheng 1493 次浏览 复制 上一个帖子 下一个帖子
标签:

报错信息

2017-05-27 at 18:52:28 CST DEBUG org.nutz.ioc.impl.NutIoc 151 get - Get 'conf'<>
2017-05-27 at 18:52:28 CST DEBUG org.nutz.ioc.impl.NutIoc 151 get - Get 'userService'<class net.wendal.nutzbook.service.UserService>
2017-05-27 at 18:52:28 CST DEBUG net.wendal.nutzbook.mvc.LogTimeProcessor 24 process - [POST]URI=/ssb//xl/app/login 200 84ms
2017-05-27 at 18:52:28 CST WARN  org.nutz.mvc.impl.processor.FailProcessor 28 process - Error@/xl/app/login : java.lang.NoClassDefFoundError: cn/jpush/api/common/connection/NativeHttpClient$1
	at java.lang.Class.getDeclaringClass0(Native Method) ~[?:1.8.0_102]
	at java.lang.Class.getDeclaringClass(Class.java:1235) ~[?:1.8.0_102]
	at java.lang.Class.getEnclosingClass(Class.java:1277) ~[?:1.8.0_102]
	at java.lang.Class.getCanonicalName(Class.java:1392) ~[?:1.8.0_102]
	at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:536) ~[?:1.8.0_102]
	at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:185) ~[?:1.8.0_102]
	at sun.net.www.protocol.http.HttpURLConnection.getOutputStream0(HttpURLConnection.java:1283) ~[?:1.8.0_102]
	at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1258) ~[?:1.8.0_102]
	at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:250) ~[?:1.8.0_102]
	at org.nutz.http.Sender.getOutputStream(Sender.java:299) ~[nutz-1.r.59-SNAPSHOT.jar:?]
	at org.nutz.http.sender.PostSender.send(PostSender.java:35) ~[nutz-1.r.59-SNAPSHOT.jar:?]
	at net.wendal.nutzbook.service.login.LoginService.getXLUserInfo(LoginService.java:856) ~[classes/:?]
	at net.wendal.nutzbook.service.login.LoginService.xlLogin(LoginService.java:821) ~[classes/:?]
	at net.wendal.nutzbook.module.mp.XLAppModule.login(XLAppModule.java:40) ~[classes/:?]
	at net.wendal.nutzbook.module.mp.XLAppModule$$FASTCLASS._invoke(XLAppModule.java:1) ~[nutz-1.r.59-SNAPSHOT.jar:?]
	at org.nutz.lang.reflect.AbstractFastClass.invoke(AbstractFastClass.java:143) ~[nutz-1.r.59-SNAPSHOT.jar:?]
	at org.nutz.lang.reflect.FastClassFactory.invoke(FastClassFactory.java:67) ~[nutz-1.r.59-SNAPSHOT.jar:?]
	at org.nutz.mvc.impl.processor.MethodInvokeProcessor.process(MethodInvokeProcessor.java:27) ~[nutz-1.r.59-SNAPSHOT.jar:?]
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44) ~[nutz-1.r.59-SNAPSHOT.jar:?]
	at org.nutz.mvc.impl.processor.AdaptorProcessor.process(AdaptorProcessor.java:33) ~[nutz-1.r.59-SNAPSHOT.jar:?]
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44) ~[nutz-1.r.59-SNAPSHOT.jar:?]
	at org.nutz.mvc.impl.processor.ActionFiltersProcessor.process(ActionFiltersProcessor.java:58) ~[nutz-1.r.59-SNAPSHOT.jar:?]
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44) ~[nutz-1.r.59-SNAPSHOT.jar:?]
	at org.nutz.integration.shiro.NutShiroProcessor.process(NutShiroProcessor.java:126) ~[nutz-integration-shiro-1.r.58.jar:?]
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44) ~[nutz-1.r.59-SNAPSHOT.jar:?]
	at org.nutz.mvc.impl.processor.ModuleProcessor.process(ModuleProcessor.java:123) ~[nutz-1.r.59-SNAPSHOT.jar:?]
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44) ~[nutz-1.r.59-SNAPSHOT.jar:?]
	at org.nutz.mvc.impl.processor.EncodingProcessor.process(EncodingProcessor.java:27) ~[nutz-1.r.59-SNAPSHOT.jar:?]
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44) ~[nutz-1.r.59-SNAPSHOT.jar:?]
	at org.nutz.mvc.impl.processor.UpdateRequestAttributesProcessor.process(UpdateRequestAttributesProcessor.java:15) ~[nutz-1.r.59-SNAPSHOT.jar:?]
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44) ~[nutz-1.r.59-SNAPSHOT.jar:?]
	at net.wendal.nutzbook.mvc.DailyUniqueUsersProcessor.process(DailyUniqueUsersProcessor.java:48) ~[classes/:?]
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44) ~[nutz-1.r.59-SNAPSHOT.jar:?]
	at net.wendal.nutzbook.mvc.LogTimeProcessor.process(LogTimeProcessor.java:19) ~[classes/:?]
	at org.nutz.mvc.impl.NutActionChain.doChain(NutActionChain.java:44) [nutz-1.r.59-SNAPSHOT.jar:?]
	at org.nutz.mvc.impl.ActionInvoker.invoke(ActionInvoker.java:68) [nutz-1.r.59-SNAPSHOT.jar:?]
	at org.nutz.mvc.ActionHandler.handle(ActionHandler.java:31) [nutz-1.r.59-SNAPSHOT.jar:?]
	at org.nutz.mvc.NutFilter.doFilter(NutFilter.java:198) [nutz-1.r.59-SNAPSHOT.jar:?]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) [catalina.jar:9.0.0.M15]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) [catalina.jar:9.0.0.M15]
	at com.thetransactioncompany.cors.CORSFilter.doFilter(CORSFilter.java:156) [cors-filter-1.7.jar:1.7]
	at com.thetransactioncompany.cors.CORSFilter.doFilter(CORSFilter.java:233) [cors-filter-1.7.jar:1.7]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) [catalina.jar:9.0.0.M15]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) [catalina.jar:9.0.0.M15]
	at com.alibaba.druid.support.http.WebStatFilter.doFilter(WebStatFilter.java:123) [druid-1.0.25.jar:1.0.25]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) [catalina.jar:9.0.0.M15]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) [catalina.jar:9.0.0.M15]
	at org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449) [shiro-web-1.3.2.jar:1.3.2]
	at org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365) [shiro-web-1.3.2.jar:1.3.2]
	at org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90) [shiro-core-1.3.2.jar:1.3.2]
	at org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83) [shiro-core-1.3.2.jar:1.3.2]
	at org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:383) [shiro-core-1.3.2.jar:1.3.2]
	at org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362) [shiro-web-1.3.2.jar:1.3.2]
	at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125) [shiro-web-1.3.2.jar:1.3.2]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) [catalina.jar:9.0.0.M15]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) [catalina.jar:9.0.0.M15]
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199) [catalina.jar:9.0.0.M15]
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) [catalina.jar:9.0.0.M15]
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:474) [catalina.jar:9.0.0.M15]
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140) [catalina.jar:9.0.0.M15]
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79) [catalina.jar:9.0.0.M15]
	at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:624) [catalina.jar:9.0.0.M15]
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) [catalina.jar:9.0.0.M15]
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:349) [catalina.jar:9.0.0.M15]
	at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:783) [tomcat-coyote.jar:9.0.0.M15]
	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) [tomcat-coyote.jar:9.0.0.M15]
	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:745) [tomcat-coyote.jar:9.0.0.M15]
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1437) [tomcat-coyote.jar:9.0.0.M15]
	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) [tomcat-coyote.jar:9.0.0.M15]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:1.8.0_102]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:1.8.0_102]
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-util.jar:9.0.0.M15]
	at java.lang.Thread.run(Thread.java:745) [?:1.8.0_102]

报错代码:

private UserXLInfo getXLUserInfo(String accessToken){
		// 获得新浪用uid
		String url = "https://api.weibo.com/oauth2/get_token_info";
		Map<String, Object> params = new HashMap<>();
		params.put("access_token",accessToken);
		Request request = Request.create(url, Request.METHOD.POST,params);
		Response response = Sender.create(request).setTimeout(60*1000).send();
		String content = response.getContent("UTF-8");
		Map<String ,String> map = Json.fromJsonAsMap(String.class, content);
		String uid = map.get("uid");
		if (!StringUtils.isBlank(map.get("error_code"))){
			log.info("LoginService|getXLUserInfo|map="+Json.toJson(map)+" accessToken="+accessToken);
			return null;
		}
		url = "https://api.weibo.com/2/users/show.json";
		params = new HashMap<>();
		params.put("access_token",accessToken);
		params.put("uid",uid);
		request = Request.create(url, Request.METHOD.GET,params);
		response = Sender.create(request).setTimeout(60*1000).send();
		content = response.getContent("UTF-8");
		UserXLInfo userXLInfo = Json.fromJson(UserXLInfo.class, content);
		if (!StringUtils.isBlank(userXLInfo.getError_code())){
			log.info("LoginService|getXLUserInfo|userXLInfo="+Json.toJson(userXLInfo)+" accessToken="+accessToken);
			return null;
		}
		return userXLInfo;
	}

Response response = Sender.create(request).setTimeout(60*1000).send();这句就报错了

2 回复

要不加上jpush试试?

jar包冲突导致的,在maven配置中

<dependency>
			<groupId>cn.jpush.api</groupId>
			<artifactId>jpush-client</artifactId>
			<version>3.2.8</version>
		</dependency>

在lib下面也有一个相同的jar包,删除lib下面的jar包,重新打包后,运行成功

添加回复
请先登陆
回到顶部