hrift does not support polymorphic data types

hrift does not support polymorphic data types

Exception in thread "main" com.facebook.swift.codec.metadata.MetadataErrorException: Error: Metadata extraction encountered 1 errors and 0 warnings
	at com.facebook.swift.codec.metadata.MetadataErrors.throwIfHasErrors(MetadataErrors.java:73)
	at com.facebook.swift.codec.metadata.ThriftStructMetadataBuilder.build(ThriftStructMetadataBuilder.java:99)
	at com.facebook.swift.codec.metadata.ThriftCatalog.extractThriftStructMetadata(ThriftCatalog.java:502)
	at com.facebook.swift.codec.metadata.ThriftCatalog.getThriftStructMetadata(ThriftCatalog.java:367)
	at com.facebook.swift.codec.metadata.ThriftCatalog.getThriftType(ThriftCatalog.java:259)
	at com.facebook.swift.service.metadata.ThriftMethodMetadata.<init>(ThriftMethodMetadata.java:124)
	at com.facebook.swift.service.metadata.ThriftServiceMetadata.<init>(ThriftServiceMetadata.java:73)
	at com.facebook.swift.service.ThriftServiceProcessor.<init>(ThriftServiceProcessor.java:79)
	at com.facebook.swift.service.ThriftServiceProcessor.<init>(ThriftServiceProcessor.java:68)
	at com.stono.thrift.annotation.server.ServerMain.main(ServerMain.java:15)
	Suppressed: com.facebook.swift.codec.metadata.MetadataErrorException: Error: ThriftStruct class 'com.stono.thrift.annotation.server.User' is not final (thrift does not support polymorphic data types)
		at com.facebook.swift.codec.metadata.MetadataErrors.addError(MetadataErrors.java:95)
		at com.facebook.swift.codec.metadata.AbstractThriftMetadataBuilder.verifyClass(AbstractThriftMetadataBuilder.java:181)
		at com.facebook.swift.codec.metadata.ThriftStructMetadataBuilder.<init>(ThriftStructMetadataBuilder.java:45)
		at com.facebook.swift.codec.metadata.ThriftCatalog.extractThriftStructMetadata(ThriftCatalog.java:501)
		... 7 more

 

如果出现这样的错误,是没有在类上面添加final修饰;

 

点赞