Verifying that classes on server and client are identical
In a 开发者_JAVA百科Java RMI Client/Server application, is there a way to verify that the classes on the server and client are identical?
Use the codebase feature so that they are single-sourced from the codebase server.
Well, you always have access to the bytes that make up the class (thru getResourceAsStream), and so if you really needed to, you can grab the bytes on the client and send them to the server, and compare.
Not sure why you need to go to this extent, normally all you care about is the serialization formats which is verified by the serialVersionUID value in the serializable class.
精彩评论