RMI server able to create a Serializable object. But not able to return a Serializable object.
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   HH_JC
Posted On:   Monday, March 26, 2007 03:48 AM

Hi, The servlets in our application is invoking a RMI server to create a serializable object. This object is created in RmiSvrImpl. However when this object is returned to CmdMenu class, it throws java.rmi.UnmarshalException as explained below. Can anyone assist on this. public class RmiSvrImpl extends UnicastRemoteObject implements RmiSvr { public synchronized CoyCd createCoyCdObj(String coyCdName, int status) throws RemoteException { try { CoyCd thCoyCd = new CoyCd(coyCdName, status); System.out.println("CoyCd created with details : " + thCoyCd.toString()); return thCoyCd; } catch (Exception e)    More>>


Hi, The servlets in our application is invoking a RMI server to create a serializable object. This object is created in RmiSvrImpl. However when this object is returned to CmdMenu class, it throws java.rmi.UnmarshalException as explained below.



Can anyone assist on this.




			

public class RmiSvrImpl extends UnicastRemoteObject implements RmiSvr
{

public synchronized CoyCd createCoyCdObj(String coyCdName, int status) throws RemoteException
{
try {
CoyCd thCoyCd = new CoyCd(coyCdName, status);
System.out.println("CoyCd created with details : " + thCoyCd.toString());
return thCoyCd;
}
catch (Exception e)
{
logger.log("Error at createCoyCdObj");
e.printStackTrace();
return null;
}
}

public class CoyCd implements java.io.Serializable
{
}

public class CmdMenu extends Cmd
{
public CmdMenu(String nextPage)
{
super(nextPage);
}


public String execute(HttpServletRequest req) throws Exception
{
............
else if(operation.equals("Enquire")){
System.out.println("CmdMenu.java : execute : create CoyCd obj for Enquire");
coyCd = RmiServer.createCoyCdObj(coyCdText, CoyCd.ENQUIRE);
System.out.println("CmdMenu.java : execute : after create CoyCd obj for Enquire");
}
..............
}
}




at th.rmisvr.RmiSvrImpl_Stub.createCoyCdObj(Unknown Source)
at th.classes.CmdMenu.execute(Unknown Source)
at th.servlet.ServletBase.service(Unknown Source)

   <<Less

Re: RMI server able to create a Serializable object. But not able to return a Serializable object.

Posted By:   HH_JC  
Posted On:   Tuesday, March 27, 2007 09:32 PM


Can anyone assist on this query. The above code was working fine in our server. After we migrated to a new box, the exceptions java.rmi.UnmarshalException are thrown.

About | Sitemap | Contact