Using a Hessian webservice running on a RIFE back-end can be somewhat tricky...
More specifically when using meta data merged objects that you want to send over the wire, you might run into serialization problems if the webservice client was not started with com.uwyn.rife.test.RunWithEngineClassLoader
.
You basically have two options:
- Start your client application with the com.uwyn.rife.test.RunWithEngineClassLoader, which means that you have to package the rife jar with your client application, or
- Use a custom serializer that will only serialize the bean, instead of the MetaData class that wraps it, be aware that in this case you loose the metadata merge facility on the client.
If you prefer the second scenario, you might want to use the serializer I wrote to solve serialization issues.
Here it is:
import java.io.IOException;
import com.caucho.hessian.io.AbstractHessianOutput;
import com.caucho.hessian.io.AbstractSerializer;
import com.caucho.hessian.io.JavaSerializer;
import com.uwyn.rife.site.MetaData ;
import com.uwyn.rife.site.Validated;
public class MetaDataSerializer extends JavaSerializer {
public MetaDataSerializer(Class cl) {
super(cl);
}
@Override
public void writeObject(Object obj, AbstractHessianOutput out) throws IOException {
MetaData metaData = (MetaData) obj;
Validated validated = metaData.retrieveValidatedBean();
super.writeObject(validated,out);
}
}