-
Notifications
You must be signed in to change notification settings - Fork 308
Open
Description
If this tool convert java interface to proto, it will throw exception

Exception in thread "main" java.lang.RuntimeException: The root object can neither be an abstract class nor interface: "org.cango.demo.service.CarService
at com.dyuproject.protostuff.runtime.RuntimeSchema.createFrom(RuntimeSchema.java:180)
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.RuntimeSchema.getSchema(RuntimeSchema.java:119)
at com.dyuproject.protostuff.runtime.RuntimeSchema.getSchema(RuntimeSchema.java:111)
at net.webby.protostuff.runtime.NestedObjectTest.main(NestedObjectTest.java:28)Code quoted:
public static void main(String[] args) {
Schema<CarService> schema = RuntimeSchema.getSchema(CarService.class);
String content = Generators.newProtoGenerator(schema).generate();
System.out.println(content);
}public interface CarService {
Page<CarModelVO> findModelListBySeriesId(CarModelCondition condition);
}@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class Page<T> {
private Pagination page;
private List<T> results;
public Page(Pagination pagination) {
this.page = pagination;
}
}Metadata
Metadata
Assignees
Labels
No labels