0
点赞
收藏
分享

微信扫一扫

错误踩坑记录

笙烛 2022-07-29 阅读 108


文章目录

  • ​​linux相关​​
  • ​​mvnw: Permission denied​​
  • ​​curl请求ipv6接口​​
  • ​​ide相关​​
  • ​​修改idea编译器堆内存​​
  • ​​thrift相关​​
  • ​​Springboot相关​​
  • ​​单测​​
  • ​​websocket​​
  • ​​Nginx相关​​
  • ​​nginx自动过滤下滑线的header​​

linux相关

mvnw: Permission denied

​​解决​​

chmod +x mvnw

curl请求ipv6接口

在Linux中我们常常使用curl去请求接口

curl

这是没问题的,但是我们针对ipv6同样这样请求

curl

会报错:

curl: (3) IPv6 numerical address used in URL without brackets

​​解决​​

curl -X GET http://[ipv6]:port/addr/

ide相关

修改idea编译器堆内存

编译报错:OOM

javac OutOfMemoryError when compiling IDEA 7

​​解决​​ On the Mac this is another way to get there: Application menu > Preferences > Compiler

thrift相关

thrift编译错误

错误踩坑记录_spring


版本0.9.3

之前这个thrift文件在0.9.2下编译是没问题

​​解决​​

错误踩坑记录_nginx_02

Springboot相关

单测

在使用mockMvc时遇到这个问题:

SpringBootTest : No qualifying bean of type 'org.springframework.test.web.servlet.MockMvc' available:

​​解决​​

@RunWith(SpringRunner.class)
@SpringBootTest
public class ApplicationTest {

@Autowired
private WebApplicationContext webApplicationContext;
private MockMvc mockMvc;

@Before
public void setUp() {
mockMvc = MockMvcBuilders.webAppContextSetup(webApplicationContext).build();
}

websocket

在websocket中无法注入service

错误踩坑记录_spring_03

解决

上述方式尝试后发现只能注入一个bean还是有注入失败的情况

​​解决​​

Nginx相关

nginx自动过滤下滑线的header

nginx代理服务器,app发出的请求头被直接过滤了,当时想到nginx会自动过滤掉带有_的请求头信息,所以直接改了Nginx的配置当然也可以将app的request中header中的_改为-

修改nginx配置,在http中增加

vi /usr/local/nginx/conf/nginx.conf

underscores_in_headers on;

vhost中的配置也贴下吧

 location / {
proxy_set_header Host $host:80;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header x-forwarded-for $remote_addr;
proxy_pass http://xxxxxxx:51001;
}


举报

相关推荐

flink 踩坑记录

踩坑记录一

vue 踩坑记录

TabLayou踩坑记录

Docker踩坑记录

RabbitMq踩坑记录

jenkins踩坑记录

0 条评论