微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

ava.lang.IllegalStateException:com.oembedler.moon.graphql.boot.GraphQLWebAutoConfiguration.graphQLSchemaProvider

如何解决ava.lang.IllegalStateException:com.oembedler.moon.graphql.boot.GraphQLWebAutoConfiguration.graphQLSchemaProvider

我在启动与 graphql 相关的 Spring Boot 应用程序时遇到异常。我是 graphql 的新手并且已经实现了一个示例,并且在尝试测试和启动服务器时出现以下错误。我很困惑,因为我已经在我的 gradle 中实现了所有内容包括依赖项,但仍然看到这个问题并且不确定是什么原因造成的?

private final GraphQL graphQL;

private final GraphQLValidator graphQLValidator;



@Autowired
public GraphQLServiceImpl(GraphQLProviderResolver graphQLProviderResolver,GraphQLValidator graphQLValidator) {


    SchemaParserBuilder schemaParserBuilder = SchemaParser.newParser().scalars(new GraphQLDate()).file("myschema.graphql").
            resolvers(graphQLProviderResolver);
    SchemaParser schemaParser = schemaParserBuilder.build();

    GraphQLSchema schema = schemaParser.makeExecutableSchema();

    GraphQL.Builder graphQLBuilder = GraphQL.newGraphQL(schema);


    this.graphQL = graphQLBuilder.build();
    this.graphQLValidator = graphQLValidator;

}

   //BELOW HOW I EXECUTE THE QUERY FROM THE SCHEMA (THIS IS IN ANOTHER METHOD)
    ExecutionInput executionInput = new ExecutionInput(graphQLRequest.getQuery(),graphQLRequest.getoperationName(),null,graphQLRequest.getvariablesMap());

    ExecutionResult result = graphQL.execute(executionInput);

//graphql GRADLE DEPENDENCY
compile ('com.graphql-java:graphql-spring-boot-starter:5.0.2')
compile ('com.graphql-java:graphql-java-tools:5.2.4')    

错误 失败","logger_name":"org.springframework.boot.SpringApplication","thread_name":"main","level":"ERROR","level_value":40000,"stack_trace":"java.lang.IllegalStateException: com.oembedler.moon.graphql.boot.GraphQLWebAutoConfiguration.graphQLSchemaProvider 上的错误处理条件\n\tat org.springframework.boot.autoconfigure.condition.SpringBootCondition.matches(SpringBootCondition.java:64)\n\tat org.springframework.context .annotation.ConditionEvaluator.shouldSkip(ConditionEvaluator.java:102)\n\tat org.springframework.context.annotation.ConfigurationClassBeanDeFinitionReader.loadBeanDeFinitionsForBeanMethod(ConfigurationClassBeanDeFinitionReader.java:178)\n\tat org.springframework.java:102 (ConfigurationClassBeanDeFinitionReader.java:140)\n\tat org.springframework.context.annotation.ConfigurationClassBeanDeFinitionReader.loadBeanDeFinitions(ConfigurationClassBeanDeFinitionReader.java:116)\n\tat o rg.springframework.context.annotation.ConfigurationClasspostProcessor.processConfigBeanDeFinitions(ConfigurationClasspostProcessor.java:333)\n\tat org.springframework.context.annotation.ConfigurationClasspostProcessor.postProcessBeanDeFinitionRegistry(ConfigurationClasspostProcessor.java:243)\n\tat org.springframework support.PostProcessorRegistrationDelegate.invokeBeanDeFinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:273)\n\tat org.springframework.context.support.PostProcessorRegistrationDelegate.invokebeanfactoryPostProcessors(PostProcessorRegistrationDelegate.java:98)\n\ProcessworkAbc AbstractApplicationContext.java:678)\n\tat org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:520)\n\tat org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebA pplicationCo ntext.java:118)\n\tat org.springframework.boot.SpringApplication.refresh(SpringApplication.java:766)\n\tat org.springframework.boot.SpringApplication.createAndRefreshContext(SpringApplication.java:361)\n\tat org.springframework.boot.SpringApplication.run(SpringApplication.java:307)\n\tat org.springframework.boot.SpringApplication.run(SpringApplication.java:1191)\n\tat org.springframework.boot.SpringApplication.run( SpringApplication.java:1180)\n\tat com.mycom.link.app.Application.main(Application.java:42)\nCaused by: java.lang.IllegalArgumentException: @ConditionalOnMissingBean 注解必须至少指定一个 bean(类型、名称或注释)\n\tat org.springframework.util.Assert.isTrue(Assert.java:68)\n\tat org.springframework.boot.autoconfigure.condition.OnBeanCondition$BeanSearchSpec.validate(OnBeanCondition.java:279) \n\tat org.springframework.boot.autoconfigure.condition.OnBeanCondition$BeanSearchSpec.(OnBeanCondition.java:275)\n\tat org.springframework.boot.autoconfigure.condit ion.OnBeanCondition.getMatchOutcome(OnBeanCondition.java:111)\n\tat org.springframework.boot.autoconfigure.condition.SpringBootCondition.matches(SpringBootCondition.java:47)\n\t... 17个常用帧省略

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。