java版SDk按照文档demo写测试,无法使用


(冠鸣科技) #1


#2

提供完整的报错,可以直接搜索你的报错


(冠鸣科技) #5

报错点进去去到的是你们的sdk里面的东西,而且里面又没注释,没法看啊


#6

那麻烦把你完整的报错信息贴文本贴出来


(冠鸣科技) #8

报错如下面:

{}
	at cn.jiguang.common.connection.NativeHttpClient._doRequest(NativeHttpClient.java:234)
	at cn.jiguang.common.connection.NativeHttpClient.doRequest(NativeHttpClient.java:99)
	at cn.jiguang.common.connection.NativeHttpClient.sendPost(NativeHttpClient.java:86)
	at cn.jpush.api.push.PushClient.sendPush(PushClient.java:163)
	at cn.jpush.api.JPushClient.sendPush(JPushClient.java:194)
	at com.test.testpush.test(testpush.java:36)
	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:483)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)

#9

没有更多的报错?获取一下极光的错误码


(冠鸣科技) #10

没有了,看错误应该是没有发出去,代码里打印pushResult的responseCode没打出来


(冠鸣科技) #11

!!!没有了,看错误应该是没有发出去,代码里打印pushResult的responseCode没打出来


#12

1、此前有人除了这些错误,捕获到的报错是没有目标错误,也就是你客户端没有已经集成成功的设备,所以是肯定报错的

推送前请保证客户端已经集成成功

2、一般来说会有http的错误码和极光的错误码,可以捕获一下


3、检查服务端是否开通了443、80端口


(冠鸣科技) #14

window上面测试的,必须开


#15

第三点只是顺带检查,注意我的前两点说明