Need help integrating protostuff

341 views
Skip to first unread message

Jon Winn

unread,
May 30, 2015, 1:23:45 AM5/30/15
to proto...@googlegroups.com
My apologies for the generic new topic, but I'm not sure where else to start. It's been a long time since I've done Java, but I have a project that requires it. Specifically, it's using google's protocol buffers (protobuf). I need to serialize/deserialize XML and am trying to utilize protostuff...but I don't know a thing about Maven. I've posted on stackoverflow  and was wondering if someone here might be able to help?

I think I've managed to have protostuff compile my proto (example from here) but am struggling to integrate the generated code with my app in Eclipse. I'm not sure what other information would help but I'll gladly provide whatever is needed.

Kostiantyn Shchepanovskyi

unread,
May 30, 2015, 5:41:04 AM5/30/15
to proto...@googlegroups.com
Hi,

Sorry for inconvenience, but information on website is little bit outdated. 
Starting from version 1.1, package was changed from "com.dyuproject.protostuff" to "io.protostuff".

P.S. I will update web-site and create sample (hello-world) github project.

субота, 30 травня 2015 р. 08:23:45 UTC+3 користувач Jon Winn написав:

Kostiantyn Shchepanovskyi

unread,
May 30, 2015, 12:23:47 PM5/30/15
to proto...@googlegroups.com
https://github.com/protostuff/protostuff-examples/tree/master/hello-world

Run "mvn clean package" to build the project. All what you need is under "hello-world" folder.


субота, 30 травня 2015 р. 12:41:04 UTC+3 користувач Kostiantyn Shchepanovskyi написав:

Kostiantyn Shchepanovskyi

unread,
May 31, 2015, 11:14:55 AM5/31/15
to proto...@googlegroups.com


субота, 30 травня 2015 р. 08:23:45 UTC+3 користувач Jon Winn написав:
My apologies for the generic new topic, but I'm not sure where else to start. It's been a long time since I've done Java, but I have a project that requires it. Specifically, it's using google's protocol buffers (protobuf). I need to serialize/deserialize XML and am trying to utilize protostuff...but I don't know a thing about Maven. I've posted on stackoverflow  and was wondering if someone here might be able to help?

Jon Winn

unread,
Jun 1, 2015, 6:28:04 PM6/1/15
to proto...@googlegroups.com
I've been able to successfully serialize/deser a protostuff: compile generated class to/from XML! So thanks for your help! But now I'm trying to do something else and I don't know if it's even possible.

I have a program that is built around some protobuf generated classes and I need to serialize/deser the classes to/from XML and was hoping to use protostuff for that. The protostuff library seems quite vast and being a noob, I could use some help. Can you tell me if it's possible? I can post code of what I've tried and the errors I'm getting if that would help. Thanks!

Kostiantyn Shchepanovskyi

unread,
Jun 2, 2015, 3:01:28 AM6/2/15
to proto...@googlegroups.com
It should be possible, but might be problematic. Please take a look at https://code.google.com/p/protostuff/wiki/ProtostuffRuntime - it allows you to use existing classes and serialize them to any format supported by protostuff.

If you need to support both xml and protobuf serialization format, maybe it makes more sense to completely switch to protostuff (and generate classes from your protos using protostuff-maven-plugin).
Reply all
Reply to author
Forward
0 new messages