ngs-doo / dsl-json

High performance JVM JSON library
https://dsl-platform.com
BSD 3-Clause "New" or "Revised" License
1.01k stars 106 forks source link

Unable to serialize provided object runing java8 example #110

Open freakrobot opened 5 years ago

freakrobot commented 5 years ago
Exception in thread "main" java.io.IOException: Unable to serialize provided object. Failed to find serializer for: class com.dslplatform.maven.Example$Model
    at com.dslplatform.json.DslJson.serialize(DslJson.java:2874)
    at com.dslplatform.maven.Example.main(Example.java:243)

I tried mavenjava8 example,and got this. Same problem when I working on my own.

zapov commented 5 years ago

Can you provide more info? Which Java? Which maven? From IDE? How do you run it?

freakrobot commented 5 years ago

Can you provide more info? Which Java? Which maven? From IDE? How do you run it? Sorry for the late reply.

I got the message with jdk1.8.0_191 using eclipse2018-9 and it's built-in maven, running with debug as

zapov commented 5 years ago

It seems Eclipse has it's own build methodology to run stuff ;( You could enable annotation processor from project properties and configure it all, or you can right click pom.xml and run as Maven install After that project should run as expected.

I'll look if there is some tweak which can be done so Eclipse copes better with DSL-JSON, but it seems to be a common problem ;( https://stackoverflow.com/questions/14869771/how-to-run-annotation-processor-in-eclipse-on-save

zapov commented 5 years ago

I didn't have time to look into it for v1.8.5 It would be great if someone more knowledgable about Eclipse looks into it and recommends something to improve