[ERRAI-370] RuntimeException looking up enum referenced by field of class in errai.marshalling.serializableTypes of ErraiApp.properties Created: 15/Aug/12  Updated: 06/Nov/13  Resolved: 11/Dec/12

Status: Closed
Project: Errai
Component/s: ErraiMarshalling
Affects Version/s: 2.1.0.CR1, 2.2.0.CR1
Fix Version/s: 2.1.1.Final, 2.2.0.CR2

Type: Bug Priority: Major
Reporter: Jared Olhoft Assignee: Unassigned
Resolution: Done Votes: 0
Labels: marshalling
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


While attempting to map a 3rd party library's class in the ErraiApp.properties of my gwt project I get an error when the DefinitionsFactoryImpl tries to look up an enum type that is referenced by a field of the mapped class.
ErraiApp.properties snippet:
errai.marshalling.serializableTypes=com.sencha.gxt.data.shared.SortInfoBean \

I've tried with and without the SortDir listed, but have the same result either way.

End of StackTrace:
Caused by: java.lang.RuntimeException: cannot marshal an abstract class or interface: com.sencha.gxt.data.shared.SortDir
at org.jboss.errai.marshalling.rebind.api.impl.defaultjava.DefaultJavaDefinitionMapper.map(DefaultJavaDefinitionMapper.java:52)
at org.jboss.errai.marshalling.rebind.DefinitionsFactoryImpl.loadCustomMappings(DefinitionsFactoryImpl.java:289)
at org.jboss.errai.marshalling.rebind.DefinitionsFactoryImpl.<init>(DefinitionsFactoryImpl.java:80)
at org.jboss.errai.marshalling.rebind.DefinitionsFactorySingleton.newInstance(DefinitionsFactorySingleton.java:41)
at org.jboss.errai.marshalling.rebind.DefinitionsFactorySingleton.<clinit>(DefinitionsFactorySingleton.java:26)
... 31 more
[ERROR] Errors in 'jar:file:/C:/Users/jxolhoft/.gradle/caches/artifacts-13/filestore/org.jboss.errai/errai-marshalling/2.1.0-SNAPSHOT/jar/869666af21df7ac6071555886ab53a8c84f55357/errai-marshalling-2.1.0-SNAPSHOT.jar!/org/jboss/errai/marshalling/client/api/MarshallerFramework.java'
[ERROR] Line 42: Rebind result 'org.jboss.errai.marshalling.client.api.MarshallerFactoryImpl' could not be found
[ERROR] Cannot proceed due to previous errors

In debugging I see that enums that get mapped to GWTClass evaluate as isEnum()==true and isAbstract()==true which is why the throw RuntimeException executes.

I'm unable to determine how to make an enumeration mapped as a GWTClass to behave similar to the way that the enum's mapped as the JavaReflectionClass representations do (with isAbstract()==false).

Comment by Christian Sadilek [ 16/Oct/12 ]

This is fixed now. Thanks for reporting the issue.

Comment by Jared Olhoft [ 11/Dec/12 ]

Sorry to re-open, if I need to file a repeat of this same defect I will under the 2.2.0-SNAPSHOT please let me know.

After trying to enable marshalling of the SortInfoBean class I am again getting the same error that I can't marshal an abstract class.

We really need to be able to marshal this Class. The problem is that one of the fields is an Enum with an abstract method so, as previously stated it get's reported as both isEnum and isAbstract. It seems that this should be able to be marshalled.

Comment by Christian Sadilek [ 11/Dec/12 ]

Thanks for re-opening. The latest 2.2.0 snapshots fix this problem.

Generated at Tue Nov 20 13:55:55 EST 2018 using Jira 7.12.1#712002-sha1:609a50578ba6bc73dbf8b05dddd7c04a04b6807c.