搜索:微服务

feign报错java.lang.IllegalStateException: RequestParam.value() was empty on parameter 0

原创 2020-03-26 10:29 阅读(333)次
修改了一下feign接口,原本可以的接口突然报错:org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'cn.com.datu.thirdpartapi.feign.OpodMetaOfProfileFeign': FactoryBean threw exception on object creation; nested exception is java.lang.IllegalStateException: RequestParam.value() was empty...

spring cloud config取不到配置@Value报错: Could not resolve placeholder 'xxxx' in value

原创 2020-01-02 11:28 阅读(761)次
我们项目是使用spring cloud config作为微服务配置管理,使用的是本地文件形式,今天我重新下载了一份配置,修改了配置服务的文件地址,然后config client的项目就启动不了了,一直报错:Could not resolve placeholder 'xxxx' in value "${xxxx}"开始以为是项目配置格式问题,后来想到应该是我改了config server的配置地址:spring: application: name: ms-config-server profiles: active: native c...

Caused by: java.net.BindException: Address already in use: connect

原创 2019-12-05 17:23 阅读(336)次
在用jmeter测试seata性能时,并发到了200多,部分请求能正常访问,部分却报地址被占用Caused by: feign.RetryableException: Address already in use: connect executing POST http://mcu-stock/api/stockInfo/saveStockDetail看了下jmeter请求日志,jmeter自身也在报这个错误java.net.BindException: Address already in use: connect明显这个错误跟我们看到的tomcat端口被占用不一样我服务端feign错误日志...

dubbo项目consumer和provider的启动顺序问题

原创 2019-11-11 12:42 阅读(542)次
dubbo项目服务调用端consumer默认需要服务提供端provider先启动才能启动,否则会报错: Failed to check the status of the service xxxx. No provider available for the service xxxx这是由于consumer端默认会检查项目里服务提供者是否可用,所以这要求dubbo项目之间要有启动顺序,这显然不符合我们日常开发与部署,谁知道微服务中谁调用谁呢,况且项目之间并不是单纯的服务提供者与调用者,可能会杂在一起,不过dubbo已经提供了关闭这个检查的配置它可以配置在@Reference注解上 @...

sprinb boot整合apache dubbo时报错 java.lang.NoClassDefFoundError: org/apache/curator/utils

原创 2019-11-11 12:14 阅读(882)次
搭建spring boot + dubbo微服务时,有个服务工程一直报错:Caused by: java.lang.NoClassDefFoundError: org/apache/curator/utils/DefaultZookeeperFactory at org.apache.curator.framework.CuratorFrameworkFactory.<clinit>(CuratorFrameworkFactory.java:66) ~[curator-framework-4.0.1.jar:4.0.1] at org.apache.dubbo.remoti...

spring boot整合apache dubbo时报错ConfigFileApplicationListener.supportsSourceType(Ljava/lang/Class;)Z

原创 2019-11-10 23:24 阅读(988)次
spring boot整合apache dubbo时报错:Exception in thread "main" java.lang.AbstractMethodError: org.springframework.boot.context.config.ConfigFileApplicationListener.supportsSourceType(Ljava/lang/Class;)Z at org.springframework.context.event.GenericApplicationListenerAdapter.supportsSourceType(Ge...

spring cloud gateway 获得响应body记录日志问题

原创 2019-10-30 11:07 阅读(516)次
通常在spring cloud微服务架构中,需要在网关gateway中记录日志,比如需要记录响应的body,今天我也是一直遇到响应体记录不完整的问题,body被分段,对于响应报文大一点的请求中,在响应ServerHttpResponseDecorator包装中一次取得body只能取的一段。有问题的代码如下: ServerHttpResponse originalResponse = exchange.getResponse(); DataBufferFactory bufferFactory = originalResponse.bufferFactory(); Serve...

seata并发测试报错:get global lock fail, xid:192.168.64.1:18091:2025291279, lockKeys:stock_info:1

原创 2019-10-20 22:42 阅读(783)次
我在做seata并发测试时报如下错误,并发只有3个,其中一个报获得全局锁失败:2019-10-20 22:07:21.548 INFO 22228 --- [nio-8092-exec-2] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring DispatcherServlet 'dispatcherServlet' 2019-10-20 22:07:21.548 INFO 22228 --- [nio-8092-exec-2] o.s.web.servlet.DispatcherServlet : ...

feign报错:cannot retry due to redirection, in streaming mode

原创 2019-10-18 17:13 阅读(870)次
feign调用报错:Caused by: feign.RetryableException: cannot retry due to redirection, in streaming mode executing POST http://G-PC-PERSON-CENTER/person/privilege/doSendOrderPayStatus at feign.FeignException.errorExecuting(FeignException.java:132) at feign.SynchronousMethodHandler.executeAndDecode(Sync...

feign接口类扫瞄找不到的问题,required a bean of type 'xx.xx.xxxFeignClient' that could not be found

原创 2019-09-24 17:40 阅读(630)次
在搭建spring cloud微服务时经常会遇到如下错误:Description: Field orderInfoFeignClient in com.mcu.stock.service.StockService required a bean of type 'com.mcu.common.feign.order.OrderInfoFeignClient' that could not be found. The injection point has the following annotations: - @org.springframework.beans.factor...

修改seata server启动服务端口

原创 2019-09-24 09:46 阅读(1193)次
下载地址:https://github.com/seata/seata/releases里面都是linux、windows都同时可以用的绿色版安装包直接双击seata-server.bat就可以默认启动,默认端口为8091,如果想修改端口,也可以用配置项启动,参数如下:Options: --host, -h   The host to bind.   Default: 0.0.0.0 --port, -p   The port to listen.   Default: 8091 --storeMode, -m   log store mode...

spring cloud+feign+mybatis中使用seata0.9实现分布式事务

原创 2019-09-23 17:11 阅读(1367)次
seata前身叫fescar,是阿里开源的实现分布式事务中间件。官网地址:https://github.com/seata/seata中文文档:https://github.com/seata/seata/wiki/Home_Chinese原理就不说了,话不多说,直接分享代码:首先需要安装seata服务,下载地址:https://github.com/seata/seata/releases里面都是linux、windows都同时可以用的绿色版安装包1.启动seata服务默认以file形式注册,直接可以启动,启动端口默认为8091sh seata-server.sh -p 8091加上-p参数...

spring cloud集成分布式事务中间件seata报错 not support register type: null

原创 2019-09-23 11:50 阅读(1198)次
在启动seata中的RM端时报错:Caused by: io.seata.common.exception.NotSupportYetException: not support register type: null at io.seata.config.ConfigurationFactory.buildConfiguration(ConfigurationFactory.java:87) at io.seata.config.ConfigurationFactory.getInstance(ConfigurationFactory.java:71) at io.seata.s...

feign加入熔断器之后转发不了token等header信息

原创 2019-07-26 11:53 阅读(752)次
feign加入hystrix熔断器之后转发不了token等header信息,我把熔断注释了,就可以转发。但这不是我想要的答案。转发代码如下:@Configuration public class FeignConfig implements RequestInterceptor { @Override public void apply(RequestTemplate requestTemplate) { ServletRequestAttributes attributes = (ServletRequestAttributes)RequestCont...

spring cloud中Feign调用诡异报错MethodNotAllowed: status 405 reading

原创 2019-07-24 13:14 阅读(1391)次
微服务中使用feign内部调用报错:Caused by: feign.FeignException$MethodNotAllowed: status 405 reading VisitorFeignClient#login(String) at feign.FeignException.errorStatus(FeignException.java:100) at feign.FeignException.errorStatus(FeignException.java:86) at feign.codec.ErrorDecoder$Default.decode(ErrorDecoder.jav...

spring cloud gatewayThe ‘Access-Control-Allow-Origin’ header contains multiple values

原创 2019-07-16 20:53 阅读(1145)次
在spring cloud gateway网关中加入了跨域支持,但是报了:The ‘Access-Control-Allow-Origin’ header contains multiple values “*, *”, but only one is allowed.错误显示设置了两次Access-Control-Allow-Origin:*,但我的代码我确定只设置了一次,怀疑是哪出了问题,找了一上午问题,百度到说是gateway的bug我的版本:spring cloud gateway:2.1.2spring cloud: Greenwich.SR2解决办法如下:设置跨域:imp...

spring cloud gateway报错Only one connection receive subscriber allowed

原创 2019-07-08 11:06 阅读(836)次
spring cloud网关报错:reactor.core.Exceptions$ErrorCallbackNotImplemented: java.lang.IllegalStateException: Only one connection receive subscriber allowed. Caused by: java.lang.IllegalStateException: Only one connection receive subscriber allowed. at reactor.ipc.netty.channel.FluxReceive.startRecei...

openfeign与gateway中的httpClient类声明冲突

原创 2019-07-06 12:27 阅读(881)次
启动spring cloud中的网关,报错:***************************APPLICATION FAILED TO START***************************Description:The bean 'httpClient', defined in class path resource [org/springframework/cloud/openfeign/ribbon/HttpClientFeignLoadBalancedConfiguration$HttpClientFeignConfiguration.class], could not...

通过xshell建立隧道代理服务器solr端口

原创 2018-02-08 18:19 阅读(435)次
在我们把solr部署到linux正式服务器里后,出于对数据安全的保护,我们不希望谁都能访问到我们的solr,否则数据被人篡改或者删除了,就完蛋了。于是我们通常会把solr在正式服务器的端口禁止外网访问。在今天之前,不知道如何使用隧道,所以我要连接服务器里的solr都是临时打开8983端口,用完再立马禁止掉。在这之间总是担心被人扫到端口,把数据给删除了。。。现在好了今天终于把隧道配置成功了。。。1.首先把solr的端口在防火墙中禁了2.打开xshell,连接你要代理的服务器,然后在xshell中选择文件--连接--SSH--隧道--添加然后配置如下图:我是把服务器的solr8983端口代理到本地...
网站安全检测平台