On Wed, Apr 13, 2011 at 06:45, J.S. <goo...@juergenschmied.de> wrote: > Hi! > > Passing a buffer with a repeated String from one EJB to another, I > get: > > javax.ejb.EJBException: java.rmi.MarshalException: CORBA BAD_PARAM > 1398079494 Maybe; nested exception is: > java.io.NotSerializableException: WARNING: IOP00100006: Class > com.google.protobuf.UnmodifiableLazyStringList is not Serializable
Protocol buffers are objects to serialize things, but it doesn't really make sense to use Java serialization to serialize their holder objects. What you actually want to do is to use the ProtocolBuffer functionality to serialize it to an byte array and use that to transfer. If you would try to Java serialize the protocol buffer objects, you would loose all the functionality you were probably considering using Protocol buffers in the first place: version independent, fast and platform independent serialization. The object layout might change between each protocol buffer library version or you might just change the proto definition - all of which will create trouble if you use Java serialization; the protocol buffer binary format, however, is stable (and compact, and fast, and platform independent ...) So in this case it was actually good that the UnmodifiableLazyStringList was not Java serializable - it helped you find an improper use. I am not sure what the maintainers think, but I wouldn't add Java 'Serializable' to all classes used within the generated objects - because then these accidental wrong uses would just go unnoticed. Henner -- You received this message because you are subscribed to the Google Groups "Protocol Buffers" group. To post to this group, send email to protobuf@googlegroups.com. To unsubscribe from this group, send email to protobuf+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/protobuf?hl=en.