JAVA classnotfound exeption ...
안녕하세요 안드로이드 공부중인 학생입니다 ..
다름이 아니라 소켓 통신 구현해서 Object input/output Stream 으로 제가 직접 짠 객체를 주고 받으려고 하고 있는데요,(아래의 FileFolderPacket)
안드로이드 쪽에서 classnotfound exeption이 터지네요...
구글링도 많이 해보고 했는데, 도저히 원인을 알 수가 없습니다. 비슷한 문제를 겪고 있는 사람은 나왔는데 그쪽도 해결을 못한거 같고..
로그켓을 첨부 합니다 ㅜ
이거 하나만 해결하면 진도 쭉쭉 나갈텐데 진도가 안나가고 있네요 ㅜ 도와 주세요 ㅜ
10-07 10:18:02.991: ERROR/TCP(224): java.lang.ClassNotFoundException: FileFolderPacket
10-07 10:18:02.991: ERROR/TCP(224): at java.lang.Class.classForName(Native Method)
10-07 10:18:02.991: ERROR/TCP(224): at java.lang.Class.forName(Class.java:237)
10-07 10:18:02.991: ERROR/TCP(224): at java.io.ObjectInputStream.resolveClass(ObjectInputStream.java:2604)
10-07 10:18:02.991: ERROR/TCP(224): at java.io.ObjectInputStream.readNewClassDesc(ObjectInputStream.java:1860)
10-07 10:18:02.991: ERROR/TCP(224): at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:840)
10-07 10:18:02.991: ERROR/TCP(224): at java.io.ObjectInputStream.readNewObject(ObjectInputStream.java:2080)
10-07 10:18:02.991: ERROR/TCP(224): at java.io.ObjectInputStream.readNonPrimitiveContent(ObjectInputStream.java:943)
10-07 10:18:02.991: ERROR/TCP(224): at java.io.ObjectInputStream.readObject(ObjectInputStream.java:2299)
10-07 10:18:02.991: ERROR/TCP(224): at java.io.ObjectInputStream.readObject(ObjectInputStream.java:2254)
10-07 10:18:02.991: ERROR/TCP(224): at java.util.ArrayList.readObject(ArrayList.java:674)
10-07 10:18:02.991: ERROR/TCP(224): at java.lang.reflect.Method.invokeNative(Native Method)
10-07 10:18:02.991: ERROR/TCP(224): at java.lang.reflect.Method.invoke(Method.java:521)
10-07 10:18:02.991: ERROR/TCP(224): at java.io.ObjectInputStream.readObjectForClass(ObjectInputStream.java:1551)
10-07 10:18:02.991: ERROR/TCP(224): at java.io.ObjectInputStream.readHierarchy(ObjectInputStream.java:1474)
10-07 10:18:02.991: ERROR/TCP(224): at java.io.ObjectInputStream.readNewObject(ObjectInputStream.java:2153)
10-07 10:18:02.991: ERROR/TCP(224): at java.io.ObjectInputStream.readNonPrimitiveContent(ObjectInputStream.java:943)
10-07 10:18:02.991: ERROR/TCP(224): at java.io.ObjectInputStream.readObject(ObjectInputStream.java:2299)
10-07 10:18:02.991: ERROR/TCP(224): at java.io.ObjectInputStream.readObject(ObjectInputStream.java:2254)
10-07 10:18:02.991: ERROR/TCP(224): at a.b.ListViewExample$TCPclient.run(ListViewExample.java:144)
10-07 10:18:02.991: ERROR/TCP(224): at a.b.ListViewExample$StartRecievSend.start(ListViewExample.java:174)
10-07 10:18:02.991: ERROR/TCP(224): at a.b.ListViewExample$1.onClick(ListViewExample.java:62)
10-07 10:18:02.991: ERROR/TCP(224): at android.view.View.performClick(View.java:2364)
10-07 10:18:02.991: ERROR/TCP(224): at android.view.View.onTouchEvent(View.java:4179)
10-07 10:18:02.991: ERROR/TCP(224): at android.widget.TextView.onTouchEvent(TextView.java:6540)
10-07 10:18:02.991: ERROR/TCP(224): at android.view.View.dispatchTouchEvent(View.java:3709)
10-07 10:18:02.991: ERROR/TCP(224): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
10-07 10:18:02.991: ERROR/TCP(224): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
10-07 10:18:02.991: ERROR/TCP(224): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
10-07 10:18:02.991: ERROR/TCP(224): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
10-07 10:18:02.991: ERROR/TCP(224): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
10-07 10:18:02.991: ERROR/TCP(224): at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1659)
10-07 10:18:02.991: ERROR/TCP(224): at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1107)
10-07 10:18:02.991: ERROR/TCP(224): at android.app.Activity.dispatchTouchEvent(Activity.java:2061)
10-07 10:18:02.991: ERROR/TCP(224): at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1643)
10-07 10:18:02.991: ERROR/TCP(224): at android.view.ViewRoot.handleMessage(ViewRoot.java:1691)
10-07 10:18:02.991: ERROR/TCP(224): at android.os.Handler.dispatchMessage(Handler.java:99)
10-07 10:18:02.991: ERROR/TCP(224): at android.os.Looper.loop(Looper.java:123)
10-07 10:18:02.991: ERROR/TCP(224): at android.app.ActivityThread.main(ActivityThread.java:4363)
10-07 10:18:02.991: ERROR/TCP(224): at java.lang.reflect.Method.invokeNative(Native Method)
10-07 10:18:02.991: ERROR/TCP(224): at java.lang.reflect.Method.invoke(Method.java:521)
10-07 10:18:02.991: ERROR/TCP(224): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
10-07 10:18:02.991: ERROR/TCP(224): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
10-07 10:18:02.991: ERROR/TCP(224): at dalvik.system.NativeStart.main(Native Method)
10-07 10:18:02.991: ERROR/TCP(224): Caused by: java.lang.NoClassDefFoundError: FileFolderPacket
10-07 10:18:02.991: ERROR/TCP(224): ... 43 more
10-07 10:18:02.991: ERROR/TCP(224): Caused by: java.lang.ClassNotFoundException: FileFolderPacket in loader dalvik.system.PathClassLoader@43b8c5e8
10-07 10:18:02.991: ERROR/TCP(224): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)
10-07 10:18:02.991: ERROR/TCP(224): at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
10-07 10:18:02.991: ERROR/TCP(224): at java.lang.ClassLoader.loadClass(ClassLoader.java:532)
10-07 10:18:02.991: ERROR/TCP(224): ... 43 more
혹시
혹시 FileFolderPacket이란 class가
Parcelable로 되어있고, writeToParcel()/FileFolderPacket(Parcel in)을 구현해주고,
FileFolderPacket.aidl생성해서 parcelable FileFolderPacket 넣어주셨는데도 android에서 not found class 나나요?
답변감사합니다.
제가 초보라서 말씀하신 Parcelable은 처음 들어보는것 같군요..
Parcelable로 한번 다시 검색해 보겠습니다 !
아 그리고
FIieFolderPacket class 는 Serializable 로 구현하였습니다. 오브젝트 스트림 이용해야 해서..
요렇게..
자답입니다.
java 서버 측 FileFolderPacket은 자바측 패키지에 포함되어 있었는데
이를 패키지를 제외한 클래스만 복사해다 붙여넣기 해서 발생한 예외였네요
패키지까지 복사한 후 패키지를 import시키니까 해결되는군요 ;;
초보적인 실수였습니다. ㅜ
댓글 달기