spring mvc + openfeign 中使用 @GetMapping 传 object 问题: 如果 定义的后端服务 中有 @GetMapping("/list") List<String> list( @NotNull @Valid TenantPageDto page ); 1234 @GetMapping("/list") List<String> list( @NotNull @Valid TenantPageDto page ); 通过 f… Read More
Spring MVC @RequestParams Map 该怎么传 queryString 问题: @GetMapping("/list") public PageVo<String> list(@NotNull PageDto page) { } public class PageDto { @ApiModelProperty("当前页码,从1开始 [1..n]") private int pageNo; @ApiModelProperty("每页的大小") private int pageSize; @ApiModelProperty("排序列表,多个使用逗号隔开,") private String sort; @ApiModelProperty("排序类型,descending,asc") private String order; @ApiModelProperty("筛选列表") private Map<String, Object> filter; } 1234567891011121314151617 @GetMapping("/list") public PageVo<String> list(@NotNull PageDto page) {} public class PageDto { @ApiModelProperty("当前页码,从1开始 [1..n]") private int pageNo; @ApiModelProperty("每页的大小") private int pageSize; @ApiModelProperty("排序列表,多个使用逗号隔开,") private String sort; @ApiModelProperty("排序类型,descending,asc") private String order; @ApiModelProperty("筛选列表") private Map<String, Object> filter;} 该怎么传 queryS… Read More
Spring Cloud OpenFeign 备忘 问题: 解决: @FeignClient(name="service1",url="http://localhost:8080/") class UserAPI { @GetMapping("/ocm/user") void getUser(); } @FeignClient(name="service1",url="http://localhost:8080/") class ProfileAPI { @GetMapping("/ocm/profile") void getUser(); } 12345678910111213 @FeignClient(name="service1",url="http://localhost:8080/")class UserAPI { @GetMapping("/ocm/user") void getUser(); } @FeignClient(name="service1",url="http://localhost:8080/")class ProfileAPI { @GetMapping("/ocm/profile") void getUser(); } … Read More
docker 跑 rabbitmq 问题: 解决: docker run -d -p 5672:5672 -p 15672:15672 --restart=on-failure --name rabbitmq_city -e RABBITMQ_DEFAULT_USER=aa -e RABBITMQ_DEFAULT_PASS=123456 rabbitmq:3-management 1 docker run -d -p 5672:5672 -p 15672:15672 --restart=on-failure --name rabbitmq_city -e RABBITMQ_DEFAULT_USER=aa -e RABBITMQ_DEFAULT_PASS=123456 rabbitmq:3-management … Read More
Error creating bean with name ‘mvcResourceUrlProvider’: Requested bean is currently in creation 问题: Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguration$EnableWebMvcConfiguration': Unsatisfied dependency expressed through method 'setConfigurers' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'apiSecurityConfig': Unsatisfied dependency expressed through field 'apiGlobalInterceptor'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'apiGlobalInterceptor': Unsatisfied dependency expressed through field 'oAuthService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'OAuthServiceImpl': Unsatisfied dependency expressed through field 'tokenClient'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.telsafe.common.auth.api.TokenClient': FactoryBean threw exception on object creation; nested exception is org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'mvcResourceUrlProvider': Requested bean is currently in creation: Is there an unresolvable circular reference? at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredMethodElement.inject(AutowiredAnnotationBeanPostProcessor.java:723) ~[spring-beans-5.2.10.RELEASE.jar!/:5.2.10.RELEASE] at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:130) ~[spring-beans-5.2.10.RELEASE.jar!/:5.2.10.RELEASE] at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:399) ~[spring-beans-5.2.10.RELEASE.jar!/:5.2.10.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1420) ~[spring-beans-5.2.10.RELEASE.jar!/:5.2.10.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:593) ~[spring-beans-5.2.10.RELEASE.jar!/:5.2.10.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:516) ~[spring-beans-5.2.10.RELEASE.jar!/:5.2.10.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:324) ~[spring-beans-5.2.10.RELEASE.jar!/:5.2.10.RELEASE] 12345678 Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguration$EnableWebMvcConfiguration': Unsatisfied dependency expressed through method 'setConfigurers' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'apiSecurityConfig': Unsatisfied dependency expressed through field 'apiGlobalInterceptor'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'apiGlobalInterceptor': Unsatisfied dependency expressed through field 'oAuthService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'OAuthServiceImpl': Unsatisfied dependency expressed through field 'tokenClient'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.telsafe.common.auth.api.TokenClient': FactoryBean threw exception on object creation; nested exception is org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'mvcResourceUrlProvider': Requested bean is currently in creation: Is there an unresolvable circular reference? at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredMethodElement.inject(AutowiredAnnotationBeanPostProcessor.java:723) ~[spring-beans-5.2.10.RELEASE.jar!/:5.2.10.RELEASE] at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:130) ~[spring-beans-5.2.10.RELEASE.jar!/:5.2.10.RELEASE] at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:399) ~[spring-beans-5.2.10.RELEASE.jar!/:5.2.10.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1420) ~[spring-beans-5.2.10.RELEASE.jar!/:5.2.10.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:593) ~[spring-beans-5.2.10.RELEASE.jar!/:5.2.10.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:516) ~[spring-beans-5.2.10.RELEASE.jar!/:5.2.10.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:324) ~[spring-beans-5.2.10.RELEASE.jar!/:5.2.10.RELEASE] 解决: … Read More
OpenFeign Ambiguous mapping exception 问题: Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'documentationPluginsBootstrapper' defined in URL [jar:file:/C:/Users/tangfh/.m2/repository/io/springfox/springfox-spring-web/3.0.0/springfox-spring-web-3.0.0.jar!/springfox/documentation/spring/web/plugins/DocumentationPluginsBootstrapper.class]: Unsatisfied dependency expressed through constructor parameter 1; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'webMvcRequestHandlerProvider' defined in URL [jar:file:/C:/Users/tangfh/.m2/repository/io/springfox/springfox-spring-webmvc/3.0.0/springfox-spring-webmvc-3.0.0.jar!/springfox/documentation/spring/web/plugins/WebMvcRequestHandlerProvider.class]: Unsatisfied dependency expressed through constructor parameter 2; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'requestMappingHandlerMapping' defined in class path resource [org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration$EnableWebMvcConfiguration.class]: Invocation of init method failed; nested exception is java.lang.IllegalStateException: Ambiguous mapping. Cannot map 'com.telsafe.provider.basic.api.tenant.TenantClient' method com.telsafe.provider.basic.api.tenant.TenantClient#create(TenantDto) to {POST /tcm/v1/tenants/posttenant}: There is already 'tenantResource' bean method com.telsafe.service.basic.rest.TenantResource#create(TenantDto) mapped. 1234 Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'documentationPluginsBootstrapper' defined in URL [jar:file:/C:/Users/tangfh/.m2/repository/io/springfox/springfox-spring-web/3.0.0/springfox-spring-web-3.0.0.jar!/springfox/documentation/spring/web/plugins/DocumentationPluginsBootstrapper.class]: Unsatisfied dependency expressed through constructor parameter 1; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'webMvcRequestHandlerProvider' defined in URL [jar:file:/C:/Users/tangfh/.m2/repository/io/springfox/springfox-spring-webmvc/3.0.0/springfox-spring-webmvc-3.0.0.jar!/springfox/documentation/spring/web/plugins/WebMvcRequestHandlerProvider.class]: Unsatisfied dependency expressed through constructor parameter 2; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'requestMappingHandlerMapping' defined in class path resource [org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration$EnableWebMvcConfiguration.class]: Invocation of init method failed; nested exception is java.lang.IllegalStateException: Ambiguous mapping. Cannot map 'com.telsafe.provider.basic.api.tenant.TenantClient' method com.telsafe.provider.basic.api.tenant.TenantClient#create(TenantDto)to {POST /tcm/v1/tenants/posttenant}: There is already 'tenantResource' bean methodcom.telsafe.service.basic.rest.TenantResource#create(TenantDto) mapped. 解决: … Read More