How to solve RuntimeExcepetion --> All fields are either transient/static.?

68 views
Skip to first unread message

chenzhe...@gmail.com

unread,
Mar 7, 2018, 4:25:37 AM3/7/18
to protostuff
I want to serialize generated AST information from Eclipse-JDT parser. 

Exception in thread "main" java.lang.RuntimeException: Not able to map any fields from class net.core.dom.NodeEventHandler.  All fields are either transient/static.
at com.dyuproject.protostuff.runtime.RuntimeSchema.createFrom(RuntimeSchema.java:245)
at com.dyuproject.protostuff.runtime.RuntimeSchema.createFrom(RuntimeSchema.java:156)
at com.dyuproject.protostuff.runtime.IdStrategy.newSchema(IdStrategy.java:129)
at com.dyuproject.protostuff.runtime.DefaultIdStrategy$Lazy.getSchema(DefaultIdStrategy.java:630)
at com.dyuproject.protostuff.runtime.RuntimeMessageField.getSchema(RuntimeMessageField.java:52)
at com.dyuproject.protostuff.runtime.RuntimeUnsafeFieldFactory$13$1.writeTo(RuntimeUnsafeFieldFactory.java:793)
at com.dyuproject.protostuff.runtime.MappedSchema.writeTo(MappedSchema.java:203)
at com.dyuproject.protostuff.ProtostuffOutput.writeObject(ProtostuffOutput.java:373)
at com.dyuproject.protostuff.runtime.RuntimeUnsafeFieldFactory$13$1.writeTo(RuntimeUnsafeFieldFactory.java:793)
at com.dyuproject.protostuff.runtime.MappedSchema.writeTo(MappedSchema.java:203)
at com.dyuproject.protostuff.ProtostuffIOUtil.toByteArray(ProtostuffIOUtil.java:183)
at net.ProtostuffTest.decode(ProtostuffTest.java:16)
at net.ProtostuffTest.main(ProtostuffTest.java:31)

However, the NodeEventHandler class is a normal class full of methods that do nothing.

David Yu

unread,
Mar 7, 2018, 4:28:15 AM3/7/18
to protostuff

--
You received this message because you are subscribed to the Google Groups "protostuff" group.
To unsubscribe from this group and stop receiving emails from it, send an email to protostuff+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
When the cat is away, the mouse is alone.
dyuproject.com

chenzhe...@gmail.com

unread,
Mar 9, 2018, 4:17:59 AM3/9/18
to protostuff
In order to ignore this warning, I just add some general fields for this class and it shows me that exception below.

Exception in thread "main" java.lang.StackOverflowError
at com.dyuproject.protostuff.runtime.DefaultIdStrategy.writeArrayIdTo(DefaultIdStrategy.java:477)
at com.dyuproject.protostuff.runtime.ObjectSchema.writeObjectTo(ObjectSchema.java:708)
at com.dyuproject.protostuff.runtime.IdStrategy$8.writeTo(IdStrategy.java:452)

AST class is a top class which has a lot of children classes. I am not sure that is it the reason of StackOverFlow because of too big class hierarchy.
Reply all
Reply to author
Forward
0 new messages