i am debugging a target that uses springframework. i want to save the "container" or the "context" -which is inside the later- as xml or json. i tried several plugins and Gson but they cant handle custom types.
i found this piece of code which works great with simple types:
new com.google.gson.GsonBuilder().setPrettyPrinting().create().toJson( MY_OBJ );
but it needs TypeAdapter to be able to parse "context" object which is of type "AnnotationConfigApplicationContext"
error: Failed making field 'java.lang.module.Configuration#parents' accessible; either increase its visibility or write a custom TypeAdapter for its declaring type.
searching spring documentation; there are some "serialize" solutions but i couldn't apply them. googling trying some Intellij plugins. trying to implement Gson TypeAdapters to no avail.