![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
FAQ
弘宇的IT屋
千里之行,始于足下
展开
-
idea npm : 无法将“npm”项识别为 cmdlet、函数、脚本文件或可运行程序的名称。请检查名称的拼写,如果包括路径,请确保路径正确,然后再试一次。
安装node时,执行环境变量设置在系统环境变量中,使用一般用户找不到该命令,只需要在用户环境变量中新增一个node安装路径环境变量即可在此电脑-》高级系统属性里面设置环境变量原创 2022-04-10 22:36:17 · 4678 阅读 · 0 评论 -
Ubuntu tomcat工程一键发布
#!/bin/bashpath=/home/ubuntubackpath=/home/work/back#admin api webservername="admin"function updateVersion(){ makedirBack backUpdateVersion}function backUpdateVersion(){ #修改servername 需要启动的服务 for i in $servername; do ech.原创 2022-04-06 19:56:27 · 1148 阅读 · 0 评论 -
Linux tomcat shell自重启
#!/bin/bashcurrentpath=/home/ubuntu/servename="admin api"npa=npafunction startsh(){ for i in $servename; do num=`ps -ef | grep $npa/$i | grep -v grep | wc -l` echo "当前数量:".$num if [ $num -eq 0 ]; th.原创 2022-04-06 19:53:03 · 686 阅读 · 0 评论 -
Do you want to continue? [Y/n] Abort.
install指令的后面加上 -y原创 2021-07-21 11:00:08 · 427 阅读 · 0 评论 -
ValueError: {‘code‘: -32000, ‘message‘: ‘only replay-protected (EIP-155) transactions allowed over R
签名出来的hash在无法发送,报错。检查发现是没有添加chainId.在java签名中新加chainID JSONObject jsonObject = JSONObject.parseObject(inputTransaction); BigInteger nonce = jsonObject.getBigInteger("nonce"); BigInteger gasPrice = jsonObject.getBigInteger("gasPrice原创 2021-07-12 17:27:59 · 1360 阅读 · 1 评论 -
Handler dispatch failed; nested exception is java.lang.NoSuchFieldError: TLS_ECDHE_ECDSA_WITH_CHACHA
产生问题,web3j 5.0.0高版本应用okhttp版本过低出现:替换更高级的okhttp<dependency> <groupId>com.squareup.okhttp3</groupId> <artifactId>okhttp</artifactId> <version>4.8.0</version> <scope>compile</scope></d原创 2021-07-12 17:22:25 · 1585 阅读 · 0 评论 -
node.js历史版本下载
https://nodejs.org/en/blog/release/原创 2021-02-03 15:57:43 · 3174 阅读 · 0 评论 -
solidity合约调用合约方法的方式
1.通过接口的形式pragma solidity >=0.7.0 <=0.8.0; // SPDX-License-Identifier: MITinterface IRC20 { function depositEther() external payable; function withdraw(uint256 amount) external; function getBalance(address addr) external .原创 2021-01-20 14:26:20 · 3498 阅读 · 1 评论 -
If you intended this as a fallback function or a function to handle plain ether transaction
solidity 出现 If you intended this as a fallback function or a function to handle plain ether transaction,use the "fallback" keyword or the "receive" keyword instead.原因是solidity升级版本,不支持function。function() public payable {}修改为fallback() external paya.原创 2021-01-19 12:02:36 · 771 阅读 · 0 评论 -
Solidity 中 revert(), assert() 和 require()
函数assert和require可以用于检查条件,如果条件不满足则抛出异常。assert():函数只能用于测试内部错误,检查不变量,正常的函数代码永远不会产生Panic, 甚至是基于一个无效的外部输入时。 如果发生了,那就说明出现了一个需要你修复的 bug。如果使用得当,语言分析工具可以识别出那些会导致 Panic 的assert条件和函数调用。想象为一个过于自信的实现方式,即使有错误,也会执行并扣除 gas。下列情况将会产生一个Panic异常: 提供的错误码编号,用来指示Panic的类..原创 2021-01-16 16:56:09 · 1095 阅读 · 1 评论 -
solidity 内联汇编 操作符
操作码 标记 解释 stop - 停止执行,相当于返回(0,0) add(x,y) x + y sub(x,y) x - y mul(x,y) x * y div(x,y) x / y sdiv(x,y) x / y ,对于有符号数,用补码 mod(x,y) x % y smod(x,y) x % y,对于有符号数,用补码 exp(x,y...原创 2021-01-15 14:56:07 · 700 阅读 · 0 评论 -
solidity 关于ERC677标准
ERC677 标准是 ERC20 的一个扩展,它继承了 ERC20 的所有方法和事件。前述:ERC20要将代币转移到合约,通常需要三步,比较繁琐。a.代币提币,必须要申请合约授权。b.告诉合约,代理已获得授权。c.运行合约代码,提取代币。ERC223运用transfer(address,uint256,bytes)解决了这个问题,但也引入了其它的问题。ERC223通过改变ERC20的tansfer方法,指定转移到未实现onTokenTransfer的合约,应抛出...原创 2021-01-14 16:40:14 · 413 阅读 · 1 评论 -
solidity 引用类型memory,storage,calldata
引用类型包括结构,数组和映射,变量的存储有三种类型,memory,storage和calldata。memory(值传递)即数据在内存中,因此数据仅在其生命周期内(函数调用期间)有效。不能用于外部调用。storage(指针传递) 状态变量保存的位置,只要合约存在就一直存储。calldata 用来保存函数参数的特殊数据位置,是一个只读位置。是不可修改的、非持久的函数参数存储区域,效果大多类似memory。是外部函数的参数所必需指定的位置,但也可以用于其他变量。局部变量/状态变量 默认是..原创 2021-01-14 11:58:06 · 1176 阅读 · 0 评论 -
springboot method breakpoints may dramatically show down debugging
1.debug启动springboot出现method breakpoints may dramatically show down debugging解决方法:点击 viewbreakpoints,取消断点原创 2020-12-24 17:26:59 · 215 阅读 · 1 评论 -
IDEA 自动格式化java
1.安装google-java-formatFiles-->Settings->Plugins搜索2.安装save action3.重启后设置原创 2020-10-30 10:58:54 · 1491 阅读 · 0 评论 -
springboot java 方法直接跳转mapper.xml
在File->settings->Plugins安装nybatisx插件原创 2020-09-21 16:22:59 · 693 阅读 · 0 评论 -
springboot集成Eureka
Eureka是Netflix开源的一个RESTful服务,主要用于服务的注册发现,他由服务器和客户端组成。Eureka服务器用作服务注册服务器。Eureka客户端用来简化与服务器的交互、作为轮询负载均衡器,并提供服务的故障切换支持。Netflix在其生产环境中使用的是另外的客户端,它提供基于流量、资源利用率以及出错状态的加权负载均衡。1.pom引入依赖 <dependencyManagement> <dependencies> .原创 2020-09-14 11:08:01 · 494 阅读 · 0 评论 -
mysql常见问题汇总
1.指定用户访问指定数据库grant all privileges on imserver.* to 'imserver'@'%' identified by '1204';flush privileges;原创 2020-09-09 10:36:14 · 265 阅读 · 0 评论 -
Slave failed to initialize relay log info structure from the repository
mysql主从配置之后,重启后出现Slave failed to initialize relay log info structure from the repository解决方法:在start slave之前,先启用reset slave原创 2020-09-09 10:23:07 · 5131 阅读 · 1 评论 -
springboot mysql实现读写分离
mysql主从设置参考:mysql主从设置1.pom设置spring: data: master: driver-class-name: com.mysql.jdbc.Driver jdbc-url: jdbc:mysql://192.168.1.47:3306/im-block?autoReconnect=true&useUnicode=true&allowMultiQueries=true&am.原创 2020-08-14 11:34:53 · 262 阅读 · 0 评论 -
springboot常见问题
1.Warning:java: 未知的枚举常量 javax.annotation.meta.When.MAYBE 原因: 找不到javax.annotation.meta.When的类文件引入guava包 <guava-version>29.0-jre</guava-version> <dependency> <groupId>com.google.guava</groupId> <artifactId>..原创 2020-08-08 11:04:48 · 726 阅读 · 0 评论 -
idea 常见问题
1.property出现中文乱码修改File->Settings->Editor -> File Encodings原创 2020-08-05 10:25:02 · 128 阅读 · 0 评论 -
java.lang.NoSuchMethodException:tk.mybatis.mapper.provider.base.BaseSelectProvider.<init>()
springboot启动类修改导入修改import org.mybatis.spring.annotation.MapperScan;为:import tk.mybatis.spring.annotation.MapperScan;原创 2020-08-04 20:19:35 · 159 阅读 · 0 评论 -
java.lang.NoSuchMethodError: com.google.common.collect.FluentIterable.concat
springboot打war包部署到tomcat出现: org.apache.catalina.LifecycleException: Failed to start component [StandardServer[7005]] at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167) at org.apache.catalina.startup.Catalina.start(Catalina.java:68原创 2020-07-31 13:27:54 · 6345 阅读 · 0 评论 -
springboot jedis配置以及集群(第五篇) redis-cli集群操作说明
1.基本命令2.具体命令操作2.1创建redis-cli -a password --cluster create 192.168.1.47:8082 192.168.1.47:8083 192.168.1.47:8084 192.168.1.47:8085 192.168.1.47:8086 192.168.1.47:8087 --cluster-replicas 12.2查询信息check--cluster-search-multiple-owners检查是否...原创 2020-07-30 10:54:37 · 352 阅读 · 0 评论 -
ubuntu16 安装redis6.0
1.卸载匹配ubuntu16的redis 3.0版本apt-get remove redis-server //删除服务apt-get remove --purge redis-server //清除配置rm -rf /etc/redis //删除redis相关文件2.添加源以便下载add-apt-repository ppa:chris-lea/redis-server -yapt-get updateapt-get install redis-ser...原创 2020-07-29 16:37:24 · 493 阅读 · 0 评论 -
springboot jedis配置以及集群(第四篇) 实现redis单机和集群
1.引入pom<dependency> <groupId>redis.clients</groupId> <artifactId>jedis</artifactId> <version>3.3.0</version></dependency>2.实现自动配置导入2.1定义yml内容redis: cluster: nodes: 192.168.1.47:80...原创 2020-07-28 21:27:08 · 1569 阅读 · 0 评论 -
springboot jedis配置以及集群(第三篇) ubuntu16实现redis集群
第二篇 ubuntu16设置redis主从备份第三篇 ubuntu16设置redis集群1.安装环境apt-get install rubyapt-get install gemsgem install redis2.集群部署设置 设置多台主机redis部署,这里设置了6台,自动配置3主3从 分别以不同端口号命名redis配置文件,copy原始redis.conf到各个端口号文件内,并按照一下修改。 daemonize yes //后台启动 ...原创 2020-07-28 20:55:14 · 258 阅读 · 0 评论 -
ubuntu16 常见问题合集
1.E: Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarily unavailable)报错处理方法:rm /var/lib/dpkg/lock原创 2020-07-28 11:27:00 · 228 阅读 · 0 评论 -
java实现PDF模板替换
1.引入pom <dependency> <groupId>com.itextpdf</groupId> <artifactId>itextpdf</artifactId> <version>5.5.10</version> </dependency> <dependency> <groupId>com.itextpdf</groupId&.原创 2020-07-20 14:48:19 · 2031 阅读 · 0 评论 -
springboot引入easyexcel
1.pom支持 <dependency> <groupId>com.alibaba</groupId> <artifactId>easyexcel</artifactId> <version>2.1.6</version> </dependency>2.实现导出:2.1导出配置类public class ExcelUtils { public static..原创 2020-07-20 14:37:19 · 649 阅读 · 0 评论 -
ubuntu16 ufw使用说明
1.ufw常用命令2.命令使用2.1防火墙开启关闭:ufw status查询防火墙状态ufw enable打开防火墙ufw disable关闭防火墙ufwdefault deny/allow deny关闭所有外部对本机的访问,但是本机访问外部正常。2.2开启关闭规则ufw allow | denyservice开启关闭规则ufw allow 22和ufw allow ssh 效果是一样的ufw allow form 192.168....原创 2020-06-11 17:04:42 · 417 阅读 · 0 评论 -
springboot jedis配置以及集群(第二篇) 实现redis主从复制
1.主从服务器安装redis-server apt-get install redis-server2. 设置master redis-server配置项vim /etc/redis/redis.conf修改bind绑定IP修改默认值为本机IP:bind 127.0.0.1bind 0.0.0.0是全网都可访问,这里绑定本机IP或者直接注释掉统一全网访问设置密码:requirepasspasswd(设置需要修改值)重启redis:/etc/...原创 2020-06-10 20:47:44 · 385 阅读 · 0 评论 -
ubuntu16 mysql实现主从备份
1.环境选择 1.1ubuntu16.04 1.2 mysql 5.71.2 设置mysql环境 修改/etc/mysql/mysql.conf.d/mysqld.cnf 打开binlogserver-id = 1log_bin = /var/log/mysql/mysql-bin.log 重启mysql/etc/init.d/mysql restart1.3master指定slave账号CREATE USER 'sl...原创 2020-06-09 18:03:05 · 212 阅读 · 0 评论 -
tomcat实现前端压缩
<Connector port="9683" protocol="HTTP/1.1" connectionTimeout="20000" maxThreads="30000" redirectPort="8443" compression="on" ...原创 2020-04-01 17:52:06 · 218 阅读 · 0 评论 -
实现tomcat简便多项目,ssl部署
1.准备tomcat版本与jdk版本 tomcat版本:apache-tomcat-8.5.38.tar.gz jdk版本:jdk-8u121-linux-x64.tar.gz 部署脚本:tomcatconfig.sh ssl以及tomcat配置目录config2.脚本#!/bin/bashtomcatzip=apache-tomcat-8.5...原创 2020-03-14 19:18:31 · 184 阅读 · 0 评论 -
nginx反向代理,隐藏服务IP
1.配置nginx.conf添加如下代理设置:proxy_connect_timeout 300s; proxy_read_timeout 300s;proxy_send_timeout 300s;proxy_buffer_size 64k; proxy_buffers 4 32k;proxy_busy_buffers_size 64k;proxy_temp_file_write...原创 2020-03-11 15:55:44 · 10996 阅读 · 1 评论 -
AWS S3 设置存储桶外部访问
1. 设置公共访问,将阻止关闭2. 设置访问权限3.设置存储桶策略{ "Version": "2012-10-17", "Id": "Policy", "Statement": [ { "Sid": "Stmt", "Effect": "Allow", "Pri...原创 2020-02-16 21:55:12 · 3221 阅读 · 0 评论 -
nginx Access-Control-Allow-Origin 跨域设置
在被调取的配置文件中修改confserver{ listen 8082; server_name localhost; # index index.html index.htm; location / { root /test/; add_header Access-Control-Allo...原创 2020-02-05 11:52:18 · 1262 阅读 · 0 评论 -
idea 下载maven 依赖过慢
1.在C:\Users\jacky\.m2\settings.xml中新建settings.xml<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="ht...原创 2020-01-30 21:43:18 · 271 阅读 · 0 评论