[protobuf] Re: Exceptions when reading protobuf messages in Java which were created in C++

2011-07-06 Thread platzhirsch
and the stack-allocated streambuf looks suspect. If nothing jumps out there, I would first check that the data read from the socket in Java exactly matches the data on the C++ side. On Sat, Jul 2, 2011 at 8:55 AM, platzhirsch konrad.rei...@googlemail.comwrote: Some other exceptions I receive

[protobuf] Exceptions when reading protobuf messages in Java which were created in C++

2011-07-02 Thread platzhirsch
I am using **protobuf** now for some weeks, but I still keep getting exceptions when parsing protobuf messages in **Java**. I use **C++** to create my protobuf messages and send them with **boost sockets** to a server socket where the Java client ist listening. The C++ code for transmitting the

[protobuf] Re: Exceptions when reading protobuf messages in Java which were created in C++

2011-07-02 Thread platzhirsch
Some other exceptions I receive as well: Protocol message tag had invalid wire type. Protocol message end-group tag did not match expected tag. While parsing a protocol message, the input ended unexpectedly in the middle of a field. This could mean either than the input has been truncated or

[protobuf] Cannot deserialize protobuf data from C++ in Java

2011-04-15 Thread platzhirsch
string name = 1; } Which I compile with: protoc -I=. --cpp_out=../cpp/ name.proto and protoc -I=. --java_out=../java/ name.proto In C++ I create the name object this way: Name name; name.set_name(platzhirsch); socket.send(name.SerializeAsString); In Java I read from

[protobuf] Re: Cannot deserialize protobuf data from C++ in Java

2011-04-15 Thread platzhirsch
Right! I think I refactored the whole writing and reading, still I am stuck. However by this I get this Exception: com.google.protobuf.UninitializedMessageException: Message missing required fields: name In C++: Name name; name.set_name(platzhirsch); boost::asio::streambuf b; std::ostream os(b

[protobuf] Re: Cannot deserialize protobuf data from C++ in Java

2011-04-15 Thread platzhirsch
I am sorry, could you clarify this? With destroy you mean call the delete operator? The changes: boost::asio::streambuf b; std::ostream os(b); ZeroCopyOutputStream *raw_output = new OstreamOutputStream(os); CodedOutputStream *coded_output = new CodedOutputStream(raw_output);

[protobuf] Re: Cannot deserialize protobuf data from C++ in Java

2011-04-15 Thread platzhirsch
be reading the data read by SerializeToCodedStream(); you need to consume the WriteLittleEndian32 data separately. On Fri, Apr 15, 2011 at 10:01 AM, platzhirsch konrad.rei...@googlemail.comwrote: I am sorry, could you clarify this? With destroy you mean call the delete operator? The changes

[protobuf] Re: Cannot deserialize protobuf data from C++ in Java

2011-04-15 Thread platzhirsch
Oh, maybe this line was flawed after all: System.out.println(name.newBuilder().build().toString()); Which cannot work, can it? ;-) I changed it to name.getName() and there it is, the data I've sent, thank you! -- You received this message because you are subscribed to the Google Groups