Android与Java服务端进行数据通信,通信失败,Android报错内容如下:
08-13 21:20:39.977 11693-11713/com.example.robotmachine W/System.err: java.io.StreamCorruptedException
08-13 21:20:39.977 11693-11713/com.example.robotmachine W/System.err: at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:2068)
08-13 21:20:39.977 11693-11713/com.example.robotmachine W/System.err: at java.io.ObjectInputStream.<init>(ObjectInputStream.java:371)
08-13 21:20:39.977 11693-11713/com.example.robotmachine W/System.err: at com.example.robotmachine.NetData.NetDataHandle.SocketRun(NetDataHandle.java:14)
08-13 21:20:39.977 11693-11713/com.example.robotmachine W/System.err: at com.example.robotmachine.MainActivity$1.run(MainActivity.java:73)
08-13 21:20:39.977 11693-11713/com.example.robotmachine W/System.err: at java.lang.Thread.run(Thread.java:818)
08-13 21:20:40.979 11693-11713/com.example.robotmachine W/System.err: java.io.StreamCorruptedException
08-13 21:20:40.979 11693-11713/com.example.robotmachine W/System.err: at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:2068)
08-13 21:20:40.979 11693-11713/com.example.robotmachine W/System.err: at java.io.ObjectInputStream.<init>(ObjectInputStream.java:371)
08-13 21:20:40.980 11693-11713/com.example.robotmachine W/System.err: at com.example.robotmachine.NetData.NetDataHandle.SocketRun(NetDataHandle.java:14)
08-13 21:20:40.980 11693-11713/com.example.robotmachine W/System.err: at com.example.robotmachine.MainActivity$1.run(MainActivity.java:73)
08-13 21:20:40.980 11693-11713/com.example.robotmachine W/System.err: at java.lang.Thread.run(Thread.java:818)
--------- beginning of system
08-13 21:20:41.073 1751-1873/? W/ContextImpl: Calling a method in the system process without a qualified user: android.app.ContextImpl.sendBroadcast:1327 com.android.server.InputMethodManagerService.hideCurrentInputLocked:1992 com.android.server.InputMethodManagerService.windowGainedFocus:2082 com.android.internal.view.IInputMethodManager$Stub.onTransact:221 com.android.server.InputMethodManagerService.onTransact:873
08-13 21:20:41.982 11693-11713/com.example.robotmachine W/System.err: java.io.StreamCorruptedException
08-13 21:20:41.982 11693-11713/com.example.robotmachine W/System.err: at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:2068)
08-13 21:20:41.982 11693-11713/com.example.robotmachine W/System.err: at java.io.ObjectInputStream.<init>(ObjectInputStream.java:371)
08-13 21:20:41.982 11693-11713/com.example.robotmachine W/System.err: at com.example.robotmachine.NetData.NetDataHandle.SocketRun(NetDataHandle.java:14)
08-13 21:20:41.982 11693-11713/com.example.robotmachine W/System.err: at com.example.robotmachine.MainActivity$1.run(MainActivity.java:73)
08-13 21:20:41.982 11693-11713/com.example.robotmachine W/System.err: at java.lang.Thread.run(Thread.java:818)
08-13 21:20:42.985 11693-11713/com.example.robotmachine W/System.err: java.io.StreamCorruptedException
08-13 21:20:42.985 11693-11713/com.example.robotmachine W/System.err: at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:2068)
08-13 21:20:42.985 11693-11713/com.example.robotmachine W/System.err: at java.io.ObjectInputStream.<init>(ObjectInputStream.java:371)
08-13 21:20:42.985 11693-11713/com.example.robotmachine W/System.err: at com.example.robotmachine.NetData.NetDataHandle.SocketRun(NetDataHandle.java:14)
08-13 21:20:42.985 11693-11713/com.example.robotmachine W/System.err: at com.example.robotmachine.MainActivity$1.run(MainActivity.java:73)
08-13 21:20:42.985 11693-11713/com.example.robotmachine W/System.err: at java.lang.Thread.run(Thread.java:818)
08-13 21:20:43.987 11693-11713/com.example.robotmachine W/System.err: java.io.StreamCorruptedException
08-13 21:20:43.987 11693-11713/com.example.robotmachine W/System.err: at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:2068)
08-13 21:20:43.987 11693-11713/com.example.robotmachine W/System.err: at java.io.ObjectInputStream.<init>(ObjectInputStream.java:371)
08-13 21:20:43.987 11693-11713/com.example.robotmachine W/System.err: at com.example.robotmachine.NetData.NetDataHandle.SocketRun(NetDataHandle.java:14)
08-13 21:20:43.987 11693-11713/com.example.robotmachine W/System.err: at com.example.robotmachine.MainActivity$1.run(MainActivity.java:73)
08-13 21:20:43.987 11693-11713/com.example.robotmachine W/System.err: at java.lang.Thread.run(Thread.java:818)
08-13 21:20:44.990 11693-11713/com.example.robotmachine W/System.err: java.io.StreamCorruptedException
08-13 21:20:44.990 11693-11713/com.example.robotmachine W/System.err: at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:2068)
08-13 21:20:44.990 11693-11713/com.example.robotmachine W/System.err: at java.io.ObjectInputStream.<init>(ObjectInputStream.java:371)
08-13 21:20:44.990 11693-11713/com.example.robotmachine W/System.err: at com.example.robotmachine.NetData.NetDataHandle.SocketRun(NetDataHandle.java:14)
08-13 21:20:44.990 11693-11713/com.example.robotmachine W/System.err: at com.example.robotmachine.MainActivity$1.run(MainActivity.java:73)
08-13 21:20:44.990 11693-11713/com.example.robotmachine W/System.err: at java.lang.Thread.run(Thread.java:818)
08-13 21:20:45.992 11693-11713/com.example.robotmachine W/System.err: java.io.StreamCorruptedException
08-13 21:20:45.992 11693-11713/com.example.robotmachine W/System.err: at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:2068)
08-13 21:20:45.992 11693-11713/com.example.robotmachine W/System.err: at java.io.ObjectInputStream.<init>(ObjectInputStream.java:371)
08-13 21:20:45.992 11693-11713/com.example.robotmachine W/System.err: at com.example.robotmachine.NetData.NetDataHandle.SocketRun(NetDataHandle.java:14)
08-13 21:20:45.992 11693-11713/com.example.robotmachine W/System.err: at com.example.robotmachine.MainActivity$1.run(MainActivity.java:73)
08-13 21:20:45.992 11693-11713/com.example.robotmachine W/System.err: at java.lang.Thread.run(Thread.java:818)
08-13 21:20:46.994 11693-11713/com.example.robotmachine W/System.err: java.io.StreamCorruptedException
08-13 21:20:46.995 11693-11713/com.example.robotmachine W/System.err: at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:2068)
08-13 21:20:46.995 11693-11713/com.example.robotmachine W/System.err: at java.io.ObjectInputStream.<init>(ObjectInputStream.java:371)
08-13 21:20:46.995 11693-11713/com.example.robotmachine W/System.err: at com.example.robotmachine.NetData.NetDataHandle.SocketRun(NetDataHandle.java:14)
08-13 21:20:46.995 11693-11713/com.example.robotmachine W/System.err: at com.example.robotmachine.MainActivity$1.run(MainActivity.java:73)
08-13 21:20:46.995 11693-11713/com.example.robotmachine W/System.err: at java.lang.Thread.run(Thread.java:818)
08-13 21:20:47.999 11693-11713/com.example.robotmachine W/System.err: java.io.StreamCorruptedException
08-13 21:20:47.999 11693-11713/com.example.robotmachine W/System.err: at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:2068)
08-13 21:20:47.999 11693-11713/com.example.robotmachine W/System.err: at java.io.ObjectInputStream.<init>(ObjectInputStream.java:371)
08-13 21:20:47.999 11693-11713/com.example.robotmachine W/System.err: at com.example.robotmachine.NetData.NetDataHandle.SocketRun(NetDataHandle.java:14)
08-13 21:20:47.999 11693-11713/com.example.robotmachine W/System.err: at com.example.robotmachine.MainActivity$1.run(MainActivity.java:73)
08-13 21:20:47.999 11693-11713/com.example.robotmachine W/System.err: at java.lang.Thread.run(Thread.java:818)
08-13 21:20:49.002 11693-11713/com.example.robotmachine W/System.err: java.io.StreamCorruptedException
08-13 21:20:49.002 11693-11713/com.example.robotmachine W/System.err: at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:2068)
08-13 21:20:49.002 11693-11713/com.example.robotmachine W/System.err: at java.io.ObjectInputStream.<init>(ObjectInputStream.java:371)
08-13 21:20:49.002 11693-11713/com.example.robotmachine W/System.err: at com.example.robotmachine.NetData.NetDataHandle.SocketRun(NetDataHandle.java:14)
08-13 21:20:49.002 11693-11713/com.example.robotmachine W/System.err: at com.example.robotmachine.MainActivity$1.run(MainActivity.java:73)
08-13 21:20:49.002 11693-11713/com.example.robotmachine W/System.err: at java.lang.Thread.run(Thread.java:818)
08-13 21:20:50.005 11693-11713/com.example.robotmachine W/System.err: java.io.StreamCorruptedException
08-13 21:20:50.005 11693-11713/com.example.robotmachine W/System.err: at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:2068)
08-13 21:20:50.005 11693-11713/com.example.robotmachine W/System.err: at java.io.ObjectInputStream.<init>(ObjectInputStream.java:371)
08-13 21:20:50.005 11693-11713/com.example.robotmachine W/System.err: at com.example.robotmachine.NetData.NetDataHandle.SocketRun(NetDataHandle.java:14)
08-13 21:20:50.005 11693-11713/com.example.robotmachine W/System.err: at com.example.robotmachine.MainActivity$1.run(MainActivity.java:73)
08-13 21:20:50.005 11693-11713/com.example.robotmachine W/System.err: at java.lang.Thread.run(Thread.java:818)
08-13 21:20:51.008 11693-11713/com.example.robotmachine W/System.err: java.io.StreamCorruptedException
08-13 21:20:51.008 11693-11713/com.example.robotmachine W/System.err: at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:2068)
08-13 21:20:51.008 11693-11713/com.example.robotmachine W/System.err: at java.io.ObjectInputStream.<init>(ObjectInputStream.java:371)
08-13 21:20:51.008 11693-11713/com.example.robotmachine W/System.err: at com.example.robotmachine.NetData.NetDataHandle.SocketRun(NetDataHandle.java:14)
08-13 21:20:51.008 11693-11713/com.example.robotmachine W/System.err: at com.example.robotmachine.MainActivity$1.run(MainActivity.java:73)
08-13 21:20:51.008 11693-11713/com.example.robotmachine W/System.err: at java.lang.Thread.run(Thread.java:818)
08-13 21:20:52.114 11693-11713/com.example.robotmachine W/System.err: java.io.StreamCorruptedException
08-13 21:20:52.114 11693-11713/com.example.robotmachine W/System.err: at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:2068)
08-13 21:20:52.114 11693-11713/com.example.robotmachine W/System.err: at java.io.ObjectInputStream.<init>(ObjectInputStream.java:371)
08-13 21:20:52.114 11693-11713/com.example.robotmachine W/System.err: at com.example.robotmachine.NetData.NetDataHandle.SocketRun(NetDataHandle.java:14)
08-13 21:20:52.114 11693-11713/com.example.robotmachine W/System.err: at com.example.robotmachine.MainActivity$1.run(MainActivity.java:73)
08-13 21:20:52.114 11693-11713/com.example.robotmachine W/System.err: at java.lang.Thread.run(Thread.java:818)
08-13 21:20:52.686 11734-11734/? E/memtrack: Couldn't load memtrack module (No such file or directory)
08-13 21:20:52.686 11734-11734/? E/android.os.Debug: failed to load memtrack module: -2
08-13 21:20:52.713 1751-5316/? I/ActivityManager: Force stopping com.example.robotmachine appid=10045 user=0: from pid 11734
08-13 21:20:52.713 1751-5316/? I/ActivityManager: Killing 11693:com.example.robotmachine/u0a45 (adj 0): stop com.example.robotmachine
08-13 21:20:52.753 1751-1785/? W/InputDispatcher: channel '264d94df com.example.robotmachine/com.example.robotmachine.MainActivity (server)' ~ Consumer closed input channel or an error occurred. events=0x9
08-13 21:20:52.753 1751-1785/? E/InputDispatcher: channel '264d94df com.example.robotmachine/com.example.robotmachine.MainActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
08-13 21:20:52.755 1751-2080/? I/WindowState: WIN DEATH: Window{264d94df u0 com.example.robotmachine/com.example.robotmachine.MainActivity}
08-13 21:20:52.755 1751-2080/? W/InputDispatcher: Attempted to unregister already unregistered input channel '264d94df com.example.robotmachine/com.example.robotmachine.MainActivity (server)'
08-13 21:20:52.755 1751-2080/? W/WindowManager: Force-removing child win Window{285a4bf5 u0 SurfaceView} from container Window{264d94df u0 com.example.robotmachine/com.example.robotmachine.MainActivity}
08-13 21:20:52.759 1751-2863/? W/WindowManager: Failed looking up window
java.lang.IllegalArgumentException: Requested window android.os.BinderProxy@35de852c does not exist
at com.android.server.wm.WindowManagerService.windowForClientLocked(WindowManagerService.java:8757)
at com.android.server.wm.WindowManagerService.windowForClientLocked(WindowManagerService.java:8748)
at com.android.server.wm.WindowState$DeathRecipient.binderDied(WindowState.java:1146)
at android.os.BinderProxy.sendDeathNotice(Binder.java:551)
08-13 21:20:52.759 1751-2863/? I/WindowState: WIN DEATH: null
08-13 21:20:52.768 1751-5316/? W/ActivityManager: Force removing ActivityRecord{ee84f93 u0 com.example.robotmachine/.MainActivity t44}: app died, no saved state
08-13 21:20:52.772 1751-2994/? W/ActivityManager: Spurious death for ProcessRecord{3a6b73cf 11693:com.example.robotmachine/u0a45}, curProc for 11693: null
08-13 21:20:52.938 1751-2863/? W/ContextImpl: Calling a method in the system process without a qualified user: android.app.ContextImpl.sendBroadcast:1327 com.android.server.InputMethodManagerService.hideCurrentInputLocked:1992 com.android.server.InputMethodManagerService.windowGainedFocus:2082 com.android.internal.view.IInputMethodManager$Stub.onTransact:221 com.android.server.InputMethodManagerService.onTransact:873
08-13 21:20:52.938 1751-2863/? W/InputMethodManagerService: Got RemoteException sending setActive(false) notification to pid 11693 uid 10045
08-13 21:20:53.457 2084-2299/com.vphone.launcher W/OpenGLRenderer: Incorrectly called buildLayer on View: ShortcutAndWidgetContainer, destroying layer...
08-13 21:20:53.542 11761-11761/? E/memtrack: Couldn't load memtrack module (No such file or directory)
08-13 21:20:53.542 11761-11761/? E/android.os.Debug: failed to load memtrack module: -2
08-13 21:20:53.562 1751-2080/? I/ActivityManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.example.robotmachine/.MainActivity} from uid 0 on display 0
08-13 21:20:53.574 11771-11771/? I/art: Late-enabling -Xcheck:jni
08-13 21:20:53.575 1751-5316/? I/ActivityManager: Start proc 11771:com.example.robotmachine/u0a45 for activity com.example.robotmachine/.MainActivity
08-13 21:20:53.703 11771-11771/com.example.robotmachine I/InstantRun: starting instant run server: is main process
08-13 21:20:53.760 11771-11771/com.example.robotmachine W/art: Before Android 4.1, method android.graphics.PorterDuffColorFilter android.support.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable
08-13 21:20:53.786 11771-11771/com.example.robotmachine I/art: Rejecting re-init on previously-failed class java.lang.Class<android.support.v4.view.ViewCompat$OnUnhandledKeyEventListenerWrapper>
08-13 21:20:53.786 11771-11771/com.example.robotmachine I/art: Rejecting re-init on previously-failed class java.lang.Class<android.support.v4.view.ViewCompat$OnUnhandledKeyEventListenerWrapper>
08-13 21:20:53.960 11771-11791/com.example.robotmachine W/System.err: java.io.StreamCorruptedException
08-13 21:20:53.960 11771-11791/com.example.robotmachine W/System.err: at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:2068)
08-13 21:20:53.960 11771-11791/com.example.robotmachine W/System.err: at java.io.ObjectInputStream.<init>(ObjectInputStream.java:371)
08-13 21:20:53.960 11771-11791/com.example.robotmachine W/System.err: at com.example.robotmachine.NetData.NetDataHandle.SocketRun(NetDataHandle.java:14)
08-13 21:20:53.960 11771-11791/com.example.robotmachine W/System.err: at com.example.robotmachine.MainActivity$1.run(MainActivity.java:73)
08-13 21:20:53.960 11771-11791/com.example.robotmachine W/System.err: at java.lang.Thread.run(Thread.java:818)
08-13 21:20:54.034 11771-11790/com.example.robotmachine I/OpenGLRenderer: Initialized EGL, version 1.4
08-13 21:20:54.334 1751-1774/? I/ActivityManager: Displayed com.example.robotmachine/.MainActivity: +770ms
08-13 21:20:54.466 2084-2249/com.vphone.launcher W/DebugConnManager: getNetworkInfo() on networkType 1
08-13 21:20:54.963 11771-11791/com.example.robotmachine W/System.err: java.io.StreamCorruptedException
08-13 21:20:54.963 11771-11791/com.example.robotmachine W/System.err: at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:2068)
08-13 21:20:54.963 11771-11791/com.example.robotmachine W/System.err: at java.io.ObjectInputStream.<init>(ObjectInputStream.java:371)
08-13 21:20:54.963 11771-11791/com.example.robotmachine W/System.err: at com.example.robotmachine.NetData.NetDataHandle.SocketRun(NetDataHandle.java:14)
08-13 21:20:54.963 11771-11791/com.example.robotmachine W/System.err: at com.example.robotmachine.MainActivity$1.run(MainActivity.java:73)
08-13 21:20:54.963 11771-11791/com.example.robotmachine W/System.err: at java.lang.Thread.run(Thread.java:818)
08-13 21:20:55.966 11771-11791/com.example.robotmachine W/System.err: java.lang.ClassNotFoundException: SixAxise.AxiseInfo
08-13 21:20:55.966 11771-11791/com.example.robotmachine W/System.err: at java.lang.Class.classForName(Native Method)
08-13 21:20:55.966 11771-11791/com.example.robotmachine W/System.err: at java.lang.Class.forName(Class.java:309)
08-13 21:20:55.966 11771-11791/com.example.robotmachine W/System.err: at java.io.ObjectInputStream.resolveClass(ObjectInputStream.java:2263)
08-13 21:20:55.966 11771-11791/com.example.robotmachine W/System.err: at java.io.ObjectInputStream.readNewClassDesc(ObjectInputStream.java:1641)
08-13 21:20:55.966 11771-11791/com.example.robotmachine W/System.err: at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:657)
08-13 21:20:55.966 11771-11791/com.example.robotmachine W/System.err: at java.io.ObjectInputStream.readNewObject(ObjectInputStream.java:1782)
08-13 21:20:55.966 11771-11791/com.example.robotmachine W/System.err: at java.io.ObjectInputStream.readNonPrimitiveContent(ObjectInputStream.java:761)
08-13 21:20:55.966 11771-11791/com.example.robotmachine W/System.err: at java.io.ObjectInputStream.readObject(ObjectInputStream.java:1983)
08-13 21:20:55.966 11771-11791/com.example.robotmachine W/System.err: at java.io.ObjectInputStream.readObject(ObjectInputStream.java:1940)
08-13 21:20:55.966 11771-11791/com.example.robotmachine W/System.err: at com.example.robotmachine.NetData.NetDataHandle.SocketRun(NetDataHandle.java:15)
08-13 21:20:55.966 11771-11791/com.example.robotmachine W/System.err: at com.example.robotmachine.MainActivity$1.run(MainActivity.java:73)
08-13 21:20:55.966 11771-11791/com.example.robotmachine W/System.err: at java.lang.Thread.run(Thread.java:818)
08-13 21:20:55.966 11771-11791/com.example.robotmachine W/System.err: Caused by: java.lang.ClassNotFoundException: Didn't find class "SixAxise.AxiseInfo" on path: DexPathList[[zip file "/data/app/com.example.robotmachine-1/base.apk", zip file "/data/app/com.example.robotmachine-1/split_lib_dependencies_apk.apk", zip file "/data/app/com.example.robotmachine-1/split_lib_slice_0_apk.apk", zip file "/data/app/com.example.robotmachine-1/split_lib_slice_1_apk.apk", zip file "/data/app/com.example.robotmachine-1/split_lib_slice_2_apk.apk", zip file "/data/app/com.example.robotmachine-1/split_lib_slice_3_apk.apk", zip file "/data/app/com.example.robotmachine-1/split_lib_slice_4_apk.apk", zip file "/data/app/com.example.robotmachine-1/split_lib_slice_5_apk.apk", zip file "/data/app/com.example.robotmachine-1/split_lib_slice_6_apk.apk", zip file "/data/app/com.example.robotmachine-1/split_lib_slice_7_apk.apk", zip file "/data/app/com.example.robotmachine-1/split_lib_slice_8_apk.apk", zip file "/data/app/com.example.robotmachine-1/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
08-13 21:20:55.966 11771-11791/com.example.robotmachine W/System.err: at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
08-13 21:20:55.966 11771-11791/com.example.robotmachine W/System.err: at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
08-13 21:20:55.966 11771-11791/com.example.robotmachine W/System.err: at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
08-13 21:20:55.966 11771-11791/com.example.robotmachine W/System.err: ... 12 more
08-13 21:20:55.966 11771-11791/com.example.robotmachine W/System.err: Suppressed: java.lang.ClassNotFoundException: SixAxise.AxiseInfo
08-13 21:20:55.966 11771-11791/com.example.robotmachine W/System.err: at java.lang.Class.classForName(Native Method)
08-13 21:20:55.966 11771-11791/com.example.robotmachine W/System.err: at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
08-13 21:20:55.966 11771-11791/com.example.robotmachine W/System.err: at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
08-13 21:20:55.966 11771-11791/com.example.robotmachine W/System.err: at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
08-13 21:20:55.966 11771-11791/com.example.robotmachine W/System.err: ... 13 more
08-13 21:20:55.966 11771-11791/com.example.robotmachine W/System.err: Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available
08-13 21:20:56.969 11771-11791/com.example.robotmachine W/System.err: java.io.StreamCorruptedException
08-13 21:20:56.969 11771-11791/com.example.robotmachine W/System.err: at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:2068)
08-13 21:20:56.969 11771-11791/com.example.robotmachine W/System.err: at java.io.ObjectInputStream.<init>(ObjectInputStream.java:371)
08-13 21:20:56.969 11771-11791/com.example.robotmachine W/System.err: at com.example.robotmachine.NetData.NetDataHandle.SocketRun(NetDataHandle.java:14)
08-13 21:20:56.969 11771-11791/com.example.robotmachine W/System.err: at com.example.robotmachine.MainActivity$1.run(MainActivity.java:73)
08-13 21:20:56.969 11771-11791/com.example.robotmachine W/System.err: at java.lang.Thread.run(Thread.java:818)
08-13 21:20:57.124 1751-1873/? W/ContextImpl: Calling a method in the system process without a qualified user: android.app.ContextImpl.sendBroadcast:1327 com.android.server.InputMethodManagerService.hideCurrentInputLocked:1992 com.android.server.InputMethodManagerService.windowGainedFocus:2082 com.android.internal.view.IInputMethodManager$Stub.onTransact:221 com.android.server.InputMethodManagerService.onTransact:873
08-13 21:20:57.972 11771-11791/com.example.robotmachine W/System.err: java.io.StreamCorruptedException
08-13 21:20:57.972 11771-11791/com.example.robotmachine W/System.err: at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:2068)
08-13 21:20:57.972 11771-11791/com.example.robotmachine W/System.err: at java.io.ObjectInputStream.<init>(ObjectInputStream.java:371)
08-13 21:20:57.972 11771-11791/com.example.robotmachine W/System.err: at com.example.robotmachine.NetData.NetDataHandle.SocketRun(NetDataHandle.java:14)
08-13 21:20:57.972 11771-11791/com.example.robotmachine W/System.err: at com.example.robotmachine.MainActivity$1.run(MainActivity.java:73)
08-13 21:20:57.972 11771-11791/com.example.robotmachine W/System.err: at java.lang.Thread.run(Thread.java:818)
08-13 21:20:58.974 11771-11791/com.example.robotmachine W/System.err: java.io.StreamCorruptedException
08-13 21:20:58.974 11771-11791/com.example.robotmachine W/System.err: at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:2068)
08-13 21:20:58.974 11771-11791/com.example.robotmachine W/System.err: at java.io.ObjectInputStream.<init>(ObjectInputStream.java:371)
08-13 21:20:58.974 11771-11791/com.example.robotmachine W/System.err: at com.example.robotmachine.NetData.NetDataHandle.SocketRun(NetDataHandle.java:14)
08-13 21:20:58.974 11771-11791/com.example.robotmachine W/System.err: at com.example.robotmachine.MainActivity$1.run(MainActivity.java:73)
08-13 21:20:58.974 11771-11791/com.example.robotmachine W/System.err: at java.lang.Thread.run(Thread.java:818)
08-13 21:20:59.978 11771-11791/com.example.robotmachine W/System.err: java.io.StreamCorruptedException
08-13 21:20:59.978 11771-11791/com.example.robotmachine W/System.err: at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:2068)
08-13 21:20:59.978 11771-11791/com.example.robotmachine W/System.err: at java.io.ObjectInputStream.<init>(ObjectInputStream.java:371)
08-13 21:20:59.978 11771-11791/com.example.robotmachine W/System.err: at com.example.robotmachine.NetData.NetDataHandle.SocketRun(NetDataHandle.java:14)
08-13 21:20:59.978 11771-11791/com.example.robotmachine W/System.err: at com.example.robotmachine.MainActivity$1.run(MainActivity.java:73)
08-13 21:20:59.978 11771-11791/com.example.robotmachine W/System.err: at java.lang.Thread.run(Thread.java:818)
08-13 21:21:00.981 11771-11791/com.example.robotmachine W/System.err: java.io.StreamCorruptedException
08-13 21:21:00.981 11771-11791/com.example.robotmachine W/System.err: at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:2068)
08-13 21:21:00.981 11771-11791/com.example.robotmachine W/System.err: at java.io.ObjectInputStream.<init>(ObjectInputStream.java:371)
学完序列化知识后即Serializable后感觉很好用,于是尝试通过Java服务端将对象序列化后通过Socket进行数据通信,Android端从而进行反序列化,从而获得数据。
这个想法是好的,但是不是 那么容易操作。
对于上面的操作,出现的原因是:两个序列化的对象所在的包不同,从而导致反序列化失败。
通过使用两个用java写的 客户端和服务端 进行序列化和反序列化是没有问题的,而一个用Android一个用Java服务端,就出现问题。
果断放弃,不进行 骚操作了,转JSON去了****