Java has some mysterious RMI exception one of them is java.rmi.MarshalException: CORBA MARSHAL, which was bothering me from last couple of days while working. I thought to put this solution post similar to my earlier post How to solve OutofMEmroyError in Java and Fixing ClassNotFoundException in Java. RMI is still used in many places and many times it create too much problem and chew-up your lot of time to find exact cause and solution.
What is Marshal Exception in Java
Recently I am working on one project and there we are using java RMI there we are getting marshalException which inspire me to write the solution as one article. Let start with
What is marshalException in Java?
Marshal Exception occurs during the remote method call known as RMI when marshaling is not done and argument or return value will not reach to remote method or we can say to the server.
One another reason for occurring this Exception if protocol we are using in RMI is different version on sender and receiver side
Signature : public class MarshalException extends RemoteException
Java.rmi.MarshalException: CORBA MARSHAL Example
java.rmi.MarshalException: CORBA MARSHAL 0 No; nested exception is:
org.omg.CORBA.MARSHAL: Unable to read value from underlying bridge:
Mismatched serialization UIDs
Solution: we can use following solution to solve the problem
This is a known problem and results from the way that Java generates the serialized version UID for EJB classes. This problem can be corrected by modifying the last 3 or 4 digits of the serialVersionUID that was generated for the bean and primary key classes. Change the last 3 or 4 digits to some unique value, generate the deployed code, and export the jar file and restart the server.
Related Java Tutorial
Tidak ada komentar:
Posting Komentar