I ran into a problem, when Mina client on android tried to de-serialized an object, the ClassNotFoundException occured. The stack is shown below:
04-13 01:56:21.521:
04-13 01:56:21.521: D/RegisterTask(299): Caused by: org.apache.mina.filter.codec.ProtocolDecoderException: java.lang.ClassNotFoundException: com.geoxy.message.agent.user.RegisterResponse (Hexdump: 12 00 00 2A 00 00 00 DA 12 04 00 02 00 00 00 D2 AC ED 00 05 73 72 01 00 2D 63 6F 6D 2E 67 65 6F 78 79 2E 6D 65 73 73 61 67 65 2E 61 67 65 6E 74 2E 75 73 65 72 2E 52 65 67 69 73 74 65 72 52 65 73 70 6F 6E 73 65 78 72 01 00 1D 63 6F 6D 2E 67 65 6F 78 79 2E 63 6F 6D 6D 6F 6E 2E 52 65 73 70 6F 6E 73 65 42 61 73 65 78 72 01 00 1C 63 6F 6D 2E 67 65 6F 78 79 2E 63 6F 6D 6D 6F 6E 2E 4D 65 73 73 61 67 65 42 61 73 65 78 70 12 04 00 02 73 72 01 00 2D 63 6F 6D 2E 67 65 6F 78 79 2E 63 6F 6D 6D 6F 6E 2E 4D 65 73 73 61 67 65 42 61 73 65 24 4D 65 73 73 61 67 65 53 69 67 6E 61 74 75 72 65 78 70 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 00 71 00 7E 00 03 00 70 00 00 00 00 00 00 00 03)
04-13 01:56:21.521: D/RegisterTask(299): at org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecFilter.java:251)
04-13 01:56:21.521: D/RegisterTask(299): at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:434)
04-13 01:56:21.521: D/RegisterTask(299): at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$5(DefaultIoFilterChain.java:429)
04-13 01:56:21.521: D/RegisterTask(299): at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:796)
04-13 01:56:21.521: D/RegisterTask(299): at org.apache.mina.core.filterchain.IoFilterAdapter.messageReceived(IoFilterAdapter.java:119)
04-13 01:56:21.521: D/RegisterTask(299): at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:434)
04-13 01:56:21.521: D/RegisterTask(299): at org.apache.mina.core.filterchain.DefaultIoFilterChain.fireMessageReceived(DefaultIoFilterChain.java:426)
04-13 01:56:21.521: D/RegisterTask(299): at org.apache.mina.core.polling.AbstractPollingIoProcessor.read(AbstractPollingIoProcessor.java:715)
04-13 01:56:21.521: D/RegisterTask(299): at org.apache.mina.core.polling.AbstractPollingIoProcessor.process(AbstractPollingIoProcessor.java:668)
04-13 01:56:21.521: D/RegisterTask(299): at org.apache.mina.core.polling.AbstractPollingIoProcessor.process(AbstractPollingIoProcessor.java:657)
04-13 01:56:21.521: D/RegisterTask(299): at org.apache.mina.core.polling.AbstractPollingIoProcessor.access$9(AbstractPollingIoProcessor.java:654)
04-13 01:56:21.521: D/RegisterTask(299): at org.apache.mina.core.polling.AbstractPollingIoProcessor$Processor.run(AbstractPollingIoProcessor.java:1141)
04-13 01:56:21.521: D/RegisterTask(299): at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:64)
But I don't understand, the missing class "com.geoxy.message.agent.user.RegisterResponse" is actually included in the message.jar, which I have put the message.jar under the project buildpath. (and the server also used the same message.jar to serialize the class.)
And I also have checked the project .classpath, it included the message.jar.
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="gen"/>
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
<classpathentry kind="lib" path="libs/dumpcatcher.jar"/>
<classpathentry kind="lib" path="libs/common-0.1.jar"/>
<classpathentry kind="lib" path="libs/log4j-1.2.16.jar"/>
<classpathentry kind="lib" path="libs/slf4j-android-1.6.1-RC1.jar"/>
<classpathentry kind="lib" path="libs/message-0.1.jar"/> <!---here is it.-->
<classpathentry kind="lib" path="libs/mina-core-2.0.4.jar"/>
<classpathentry kind="output" path="bin/classes"/>
</classpath>
Please help, are there any other reasons caused the ClassNotFoundException? Thank you very much. I also put some information in this post: Run (synchronize) mina client on Android, how to resolve ClassNotFoundException