问题记录整理(持续更新)

Java


SSL
javax.net.ssl.SSLHandshakeException: Remote host terminated the handshake

指向HTTPS证书过期

SpringBoot


Springboot项目配置jar外部静态文件
spring.resources.static-locations=file:/Users/gaojiaqi/Desktop/test,classpath:/META-INF/resources/,classpath:/resources/,classpath:/static/,classpath:/public/
Swagger
java.lang.NumberFormatException: For input string: ""

Swagger的@ApiModelProperty标记Integer属性时,需要指定example值,example默认值是空字符串,如未指定则会报这个问题。

JPA
java.sql.SQLSyntaxErrorException: Table 'cds.hibernate_sequence' doesn't exist

背景:
使用@GeneratedValue后
解决方法:
spring.jpa.hibernate.use-new-id-generator-mappings=false 或 @GeneratedValue(strategy = GenerationType.IDENTITY)

SpringCloud


Gateway 不能使用 web MVC框架
Consider defining a bean of type 'org.springframework.http.codec.ServerCodecConfigurer' in your configuration.

spring-boot-starter-web与spring-cloud-starter-gateway存在jar包冲突
Spring Cloud Gateway 是使用 netty+webflux 实现因此不需要再引入 web 模块。


Feign 每个参数需要指定PathVariable
java.lang.IllegalStateException: PathVariable annotation was empty on param 0.

使用Spring Cloud Feign 的时候,如果参数中带有@PathVariable形式的参数,则要用value=""标明对应的参数,否则会抛出IllegalStateException异常
如:@PathVariable(value = “groupType”) String groupType


漏传参数
java.lang.IllegalArgumentException: Body parameter 0 was null

Spring Cloud Feign 远程调用需要携带参数,但实际上没没有携带


Gateway requestBody 只允许读取一次
java.lang.IllegalStateException: Only one connection receive subscriber allowed.

Spring Cloud Gateway 中,requestBody只允许读取一次,解决方法就是读取后需要在写入一个request。

Dubbo


Dubbo Qos 22222
ERROR org.apache.dubbo.qos.server.Server (Server.java:103) -  [DUBBO] qos-server can not bind localhost:22222, dubbo version: 2.7.3, current host: 192.168.0.1

Qos=Quality of Service,qos是Dubbo的在线运维命令,可以对服务进行动态的配置、控制及查询,Dubboo2.5.8新版本重构了telnet(telnet是从Dubbo2.0.5开始支持的)模块,提供了新的telnet命令支持,新版本的telnet端口与dubbo协议的端口是不同的端口,默认为22222,可以通过配置文件dubbo.properties修改。telnet 模块现在同时支持 http 协议和 telnet 协议,方便各种情况的使用。
在同时启动多个dubbo应用的时候,会报这个错误。

ES相关


节点网络连接问题
None of the configured nodes are available: []

RocketMQ

CODE: 14 DESC: service not available now, maybe disk full, CL: 0.96 CQ: 0.96

RocketMQ磁盘满,需清理磁盘

数据库相关


mysql排序稳定性问题


Timestamp 数据异常
Cause: java.sql.SQLException: Zero date value prohibited
com.mysql.cj.core.exceptions.DataReadException: Zero date value prohibited

数据时区错误,由于数据库字段timestamp类型有时间0000-00-00 00:00:00,修改为正常时间即可。
timestamp的默认值:CURRENT_TIMESTAMP(插入时个更新时间)、ON UPDATE CURRENT_TIMESTAMP(仅在更新时设置时间,插入时赋值)、CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP (创建和修改时都修改此值)


Cause: java.sql.SQLException: Incorrect DECIMAL value: '0' for column '' at row -1
; uncategorized SQLException for SQL []; SQL state [HY000]; error code [1366]; Incorrect DECIMAL value: '0' for column '' at row -1; nested exception is java.sql.SQLException: Incorrect DECIMAL value: '0' for column '' at row -1

根本解法:对数据输入严格校验,避免出现cast转换值为null的情况,或者对于null的情况从逻辑上进行控制


Cause: org.mybatis.spring.MyBatisSystemException: There is no getter for property named 'projectId' in 'class java.lang.String'
<select id="list" parameterType="java.lang.String" resultType="java.lang.String">
    select username from user
    <!--错误用法,正确用法为 _parameter-->
    <if test="id != null">
          where id=#{id}
    </if>
</select>

压测相关

系统的连接端口耗尽
Cause: java.net.NoRouteToHostException: Cannot assign requested address.

前端相关

npm sha256问题

错误提示

npm ERR! errno -66
npm ERR! ENOTEMPTY: directory not empty, rename '/Users/abc/Documents/项目/opensource/webapp/node_modules/acorn-globals' -> '/Users/abc/Documents/项目/opensource/webapp/node_modules/.a-globals-UT9L72cr'

解决: 删除package-lock和node_modules,强制清空缓存再执行

rm -r package-lock.json node_modules && npm cache clean --force && npm install
浏览器Long长度大于17会精度丢失,解决办法是后台将Long转为String,原因是js number的局限

跨域问题

Http ResponseHeader 中的自定义属性,如果浏览器请求抓包可以看到,但是js中获取不到,则需要检查跨域配置

解决: 响应头Access-Control-Expose-Headers,配置自定义属性,然后就可以获取到了。

问题请求:angular1.6 $http.post
原文:http://www.it1352.com/886056.html
参考:跨域资源共享 CORS 详解


在react中,setState是异步操作,赋值后不能马上生效。


The value of the 'Access-Control-Allow-Origin' header in the response must not be the wildcard '*' when the request's credentials mode is 'include'. 

当看到此错误时注意,当前端请求配置credentials: "include"时,后端需要配置"Access-Control-Allow-Credentials"为true,这样才能使带credentials的CORS请求成功。
SpringBoot2.0下对跨域的处理方式可以为使用@CrossOrigin注解或者编写配置类实现WebMvcConfigurer接口的addCorsMappings方法。

    @Override
    public void addCorsMappings(CorsRegistry registry) {
        registry.addMapping("/**")
                .allowedHeaders("*")
                .allowedMethods("POST","GET")
                .allowedOrigins("*")
                .allowCredentials(true);
    }
React Eslint 报错与警告

Do not use setState in componentDidMount
componentDidMount 执行是在DOM渲染完成后,在这里面使用setState会触发重绘,相当于进行了两次渲染,因此建议在constructor或者componentWillMount中把准备工作做好。当然在componentDidMount 周期异步获取数据并通过setState赋值是正确逻辑。


Arrow function should not return assignment.

<div ref={(el) => { this.myCustomEl = el }} />

在使用箭头函数的时候,不应当返回赋值语句。


JSX props should not use arrow functions
A bind call or arrow function in a JSX prop will create a brand new function on every single render. This is bad for performance, as it may cause unnecessary re-renders if a brand new function is passed as a prop to a component that uses reference equality check on the prop to determine if it should update.
https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-bind.md


Expected to return a value in arrow function array-callback-return


res操作可能存在异步调用

问题描述:Cannot set headers after they are sent to the client
发生了两次res的返回,原因可能是因为存在异步调用,异步后又尝试使用res.send,将异步方法改为同步可以解决这个问题。

Linux及生产环境问题

磁盘没有空间

磁盘没有空间:Error: ENOSPC: no space left on device, write
解决方案:增大磁盘空间或删除迁移没用文件,如日志文件


Git问题

两个分支历史不匹配,无法合并

Could Not Merge origin/sprint2-mjk: refusing to merge unrelated histories
解决办法:git merge origin/sprint2-mjk --allow-unrelated-histories


Docker问题

resource is denied,需要登录harbor

denied: requested access to the resource is denied
解决办法: docker login $harbor --username admin --password $harbor_password

  • 2
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 4
    评论
整理软件开发文档是一个非常重要且细致的过程。首先,我会浏览整个gjb438b软件开发文档,了解其结构和内容。接着,我会进行逐个模块的整理和分析。 在整理gjb438b软件开发文档时,我会按照以下步骤进行: 1. 阅读需求文档:我会仔细阅读需求文档并提炼出功能模块和用户需求。然后,我会将这些需求整理成清晰、有逻辑的文档,以便于后续参考和开发。 2. 总结设计文档:根据设计文档,我会提取出软件的整体架构设计和各个模块的设计思路。我会整理记录这些设计,以便于开发人员了解项目整体结构和模块之间的关系。 3. 整合测试文档:测试文档对于软件开发过程非常重要。我会检查测试人员编写的测试用例和测试结果,并整理成易于理解的文档。这样,开发人员可以快速了解软件的缺陷和问题,并及时调整开发策略。 4. 编写用户文档:用户文档是软件发布后的重要组成部分。我会整理并编写详细的用户文档,包括软件安装说明、使用方法、常见问题解答等。这样,用户可以轻松上手并优雅地使用软件。 5. 更新和维护文档:软件开发是一个持续迭代的过程,在开发周期中,文档可能会不断发生变化。我会定期回顾和更新文档,确保其与软件开发保持一致。同时,我也会根据用户反馈和软件更新的需求进行相应的文档维护。 通过以上步骤,我会整理gjb438b软件开发文档,并确保其内容准确、易懂、完整。整理软件开发文档是一个井然有序的过程,它有助于保证软件开发的顺利进行,同时也为用户提供了更好的使用体验。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值