这段时间比较忙,没有分了,
- Java code
04-06 15:48:03.797: W/System.err(530): java.lang.reflect.InvocationTargetException04-06 15:48:03.816: W/System.err(530): at android.net.vpn.VpnManager.startVpnService(VpnManager.java:140)04-06 15:48:03.816: W/System.err(530): at java.lang.reflect.Method.invokeNative(Native Method)04-06 15:48:03.816: W/System.err(530): at java.lang.reflect.Method.invoke(Method.java:521)04-06 15:48:03.816: W/System.err(530): at xink.vpn.wrapper.AbstractWrapper.invokeStubMethod(AbstractWrapper.java:117)04-06 15:48:03.847: W/System.err(530): at xink.vpn.wrapper.VpnManager.startVpnService(VpnManager.java:44)04-06 15:48:03.847: W/System.err(530): at xink.vpn.VpnActor.connect(VpnActor.java:78)04-06 15:48:03.847: W/System.err(530): at xink.vpn.Connec$ButtonListener.onClick(Connec.java:77)04-06 15:48:03.856: W/System.err(530): at android.view.View.performClick(View.java:2408)04-06 15:48:03.856: W/System.err(530): at android.view.View$PerformClick.run(View.java:8816)04-06 15:48:03.856: W/System.err(530): at android.os.Handler.handleCallback(Handler.java:587)04-06 15:48:03.856: W/System.err(530): at android.os.Handler.dispatchMessage(Handler.java:92)04-06 15:48:03.856: W/System.err(530): at android.os.Looper.loop(Looper.java:123)04-06 15:48:03.856: W/System.err(530): at android.app.ActivityThread.main(ActivityThread.java:4627)04-06 15:48:03.856: W/System.err(530): at java.lang.reflect.Method.invokeNative(Native Method)04-06 15:48:03.866: W/System.err(530): at java.lang.reflect.Method.invoke(Method.java:521)04-06 15:48:03.866: W/System.err(530): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)04-06 15:48:03.866: W/System.err(530): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)04-06 15:48:03.866: W/System.err(530): at dalvik.system.NativeStart.main(Native Method)04-06 15:48:03.866: W/System.err(530): Caused by: java.lang.NullPointerException
这是抛出的异常,,贴出调用方法
- Java code
public void startVpnService() { System.out.println("vpnmanager ------ 43 ------startVpnService()"); invokeStubMethod(METHOD_START_VPN_SERVICE);}METHOD_START_VPN_SERVICE=“startVpnService”;protected <T> T invokeStubMethod(final String methodName, final Object... args) { try { System.out.println("abstractwrapper ---------113" + methodName + " -----" + args); Method method = findStubMethod(methodName, args); return (T) method.invoke(stub, args); } catch (Exception e) { e.printStackTrace(); // System.out.println("exception ------"+e.printStackTrace()); throw new WrapperException("failed to invoke mehod '" + methodName + "' on stub", e); } }
大哥们,小弟在线等的
------解决方案--------------------------------------------------------
Caused by: java.lang.NullPointerException