首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >TypeMappingException:为具有不同返回类型的操作"opName“检测到的多个方法

TypeMappingException:为具有不同返回类型的操作"opName“检测到的多个方法
EN

Stack Overflow用户
提问于 2020-07-09 13:41:31
回答 1查看 350关注 0票数 0

在使用graphql和Spring时,我试图运行该项目,但我遇到了以下情况:

代码语言:javascript
复制
exception:org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'graphQLSchema' defined in class path resource 
[io/leangen/graphql/spqr/spring/autoconfigure/SpqrAutoConfiguration.class]: 
Bean instantiation via factory method failed; 
nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate 
[graphql.schema.GraphQLSchema]: Factory method 'graphQLSchema' threw exception; 
nested exception is io.leangen.graphql.metadata.exceptions.TypeMappingException: 
Multiple methods detected  for operation "defaultInstanceForType" with different 
return types. Types found: [com.google.protobuf.Message, com.google.protobuf.MessageLite]. 
If this is intentional, and you wish GraphQL SPQR to infer the most common super type automatically, see 
https://github.com/leangen/graphql-spqr/wiki/Errors#operation-with-multiple-resolver-methods-of-different-types 

我被重定向到这里寻求帮助:https://github.com/leangen/graphql-spqr/wiki/Errors#operation-with-multiple-resolver-methods-of-different-types

我没有多个名称相同的方法来触发我,异常中的URL没有帮助,甚至不能被编辑或注释。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2020-07-09 13:41:31

删除protobuf时间戳字段解决了问题!

在更改了返回对象之后,我不得不重构com.google.protobuf.Timestamp,LocalDate,甚至字符串,并且它工作得很好。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/62816261

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档