Dec 10th, 2009, 07:28 PM
Converting Hibernate collections using HttpInvokerServiceExporter
I'm using HttpInvokerServiceExporter to allow client applications to access server data that is loaded by Hibernate. Because Hibernate has its own collections classes, I have to deploy the Hibernate JAR on client to allow the collections to be deserialized. The clients are loaded with Java Web Start so downloading the 2.5MB Hibernate JAR makes the client very slow to start up. Ideally the collections would be converted to standard Java collections so I don't need Hibernate on the client side.
I don't know what the best way to get rid of the Hibernate collections is.
Issue SPR-1228 in JIRA suggests that it could be done by overriding createObjectOutputStream in HttpInvokerServiceExporter. Has anyone here done that? Does anyone have a working example of a custom ObjectOutputStream?
Alternately, can anyone suggest a better way to strip out Hibernate collections during remoting?