首页 > 解决方案 > 当 Spring 应用程序无法通过“'uriComponentContributors' 不能为空”异常启动时

问题描述

我有 Grails 3.0.11 项目(基于 spring boot),升级到 grails 3.3.12 后,它无法通过“ 'uriComponentContributors' 不能为空”IllegalArgumentException 异常启动。错误是这样的:

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mvcUriComponentsContributor' defined in class path resource [org/springframework/web/servlet/config/annotation/DelegatingWebMvcConfiguration.class]: Bean instantiation via factory method failed; 

nested exception is 
org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.web.method.support.CompositeUriComponentsContributor]: Factory method 'mvcUriComponentsContributor' threw exception; nested exception is java.lang.IllegalArgumentException: 'uriComponentsContributors' must not be null
java.lang.IllegalArgumentException: 'uriComponentsContributors' must not be null
    at org.springframework.util.Assert.notNull(Assert.java:134) ~[spring-core-4.3.25.RELEASE.jar:4.3.25.RELEASE]

我想知道“'uriComponentContributors' 不能为空”IllegalArgumentException 何时发生,以及如何调试以找到问题。

谢谢。

标签: springspring-bootgrails

解决方案


推荐阅读