I found the problem,
I use java type Serializable for service interface's parameter type.
so Serialize is right, but deserialize is wrong.

I change the interface's parameter type from Seriazable to Object, the
problem is resolved.

but i think i must need more research to understand why this is happen.

Regard.


On Thu, Dec 30, 2010 at 5:35 PM, Jet Knight <dolt131...@gmail.com> wrote:
> Hi, all
>
>    I use Hessian (Version 4.0.7) to transfer a HashMap that contain a
> JavaBean and two ArrayList.
>
> but there is a exception when Deserialize:
>
> 17:26:42,892 ERROR [ContainerBase:271] Servlet.service() for servlet
> default threw exception
> com.caucho.hessian.io.HessianProtocolException:
> com.caucho.hessian.io.ObjectDeserializer: unexpected object
> java.lang.String (userGroupIdList)
>        at 
> com.caucho.hessian.io.AbstractDeserializer.error(AbstractDeserializer.java:150)
>        at 
> com.caucho.hessian.io.AbstractDeserializer.readMap(AbstractDeserializer.java:102)
>        at 
> com.caucho.hessian.io.HessianInput.readObject(HessianInput.java:1029)
> ...............
>
> I have tracker and read the source code:
>
> com.caucho.hessian.io.AbstractDeserializer.readMap:
> <code>
>
>  public Object readMap(AbstractHessianInput in)
>    throws IOException
>  {
>    Object obj = in.readObject();
>
>    String className = getClass().getName();
>
>    if (obj != null)
>      throw error(className + ": unexpected object " +
> obj.getClass().getName() + " (" + obj + ")");
>    else
>      throw error(className + ": unexpected null value");
>  }
>
> </code>
>
> It seems that it will always throw a exception whether the obj is null
> or not null,
>
> Why?
>
> does there some problem about transfer HashMap????
>
> How to resolve this problem?
>
> Thank you.
>
>
>
> Regard.
>
>
> --
> Jet Knight
>



-- 
Jet Knight


_______________________________________________
hessian-interest mailing list
hessian-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/hessian-interest

Reply via email to