- 博客(43)
- 收藏
- 关注
原创 go语言使用grpc入门笔记(2)----gateway的简单使用
使用场景:希望同时提供grpc接口和restful接口,又不想重复写两遍代码获取资源:1.安装grpc-gateway插件 go get github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway2.修改proto,首先在proto中导入googleapi的proto,然后在具体的方法中增加http相关注解syntax = "proto3"; //语法声明option go_package..
2022-03-13 16:55:11
1152
原创 java中使用grpc入门笔记
一.通过maven导入所需jar包 <!--grpc服务--> <dependency> <groupId>io.grpc</groupId> <artifactId>grpc-netty-shaded</artifactId> <version>1.28.0</version> </
2022-03-03 16:00:23
3897
1
原创 记录一次git拉取报错:fatal:uable to access ‘https://github.com/grpc/grpc-java.git/‘
报错信息如下:最简单的解决方案:将https替换成git其他方案:git clone出现 fatal: unable to access 'https://github.com/...'的解决办法(亲测有效)_Dashi_Lu的博客-CSDN博客github - Unable to connect to git remote repository - Stack Overflow...
2022-03-03 14:47:22
599
原创 docker安装redis笔记(单机版)
一.获取redis镜像#获取最新版的redis,如果需要拉去指定版本的镜像,可自行指定docker pull redis二.在自己宿主机上指定位置创建redis.conf文件,可以直接从官网下载daemonize no#用守护线程的方式启动bind 192.168.1.1 #注释掉这部分,使redis可以外部访问requirepass password#给redis设置密码appendonly yes#redis持久化tcp-keepalive 5 #防止出现远程主机强迫关闭了一个
2022-02-26 18:21:37
762
原创 Springboot集成swagger报错:Failed to start bean ‘documentationPluginsBootstrapper‘; nested exception is j
一.报错信息:2022-02-17 09:18:16,969 ERROR [bootstrap,,,] 41848 --- [RMI TCP Connection(3)-127.0.0.1] o.s.boot.SpringApplication : Application startup failedorg.springframework.context.ApplicationContextException: Failed to start bean 'documen
2022-02-17 14:05:10
1056
原创 学习笔记:controller使用常见问题(一)
一.成功进入controller,返回json对象,但是页面上报404原因:@Controller不可以返回json数据方案:(1)使用@RestController代替@Controller注解(2)也可以在具体的方法前添加@ResponseBody注解,搭配@Controllerps:跟swaager没啥关系,顺带记录一下二.未传某个参数时报错Required String parameter 'categoryId' is not
2022-02-17 13:27:28
634
原创 使用win11自带内核安装ubuntu
1.开启开发者模式2.勾选上适用于Linux的Windows子系统3.在微软商店下载要安装的linux版本4.如果win11遇到下面报错打开power shell,输入wsl --set-default-version 15.创建用户,设置密码,登录自己创建的用户,修改密码sudo passwd6.切换root用户,su - root,使用刚才设置的密码登录,然后修改root密码即可...
2022-02-15 16:02:10
2982
2
原创 学习笔记:springboot集成swagger2
1.pom.xml文件引入jar包 <dependency> <groupId>io.springfox</groupId> <artifactId>springfox-swagger-ui</artifactId> <version>2.7.0</version> </dependency> <dependency> <groupId>
2021-12-23 16:29:02
302
原创 报错:signer information does not match signer information of other classes in the same package
报错信息:SecurityHandlersManager strange error with builtin handlers: class "org.bouncycastle.asn1.DEREncodable"'s signer information does not match signer information of other classes in the same package28-Sep-2021 14:07:14.553 INFO [Thread-65] org.apache
2021-09-29 10:06:31
1494
原创 微博授权流程
1.申请成为微博开发者2.创建应用,获取App Key和App Secret3.在高级信息里面设置授权回调页,这里的回调页可以是jsp,也可以是servlet,或者一个请求地址,或者填写微博提供的默认地址,用于获取code参数...
2021-09-23 15:42:01
858
原创 微博api调用报错: error:appkey not bind domain! error_code:10017/2/statuses/share.json
报错信息:weibo4j.model.WeiboException: 400:The request was invalid. An accompanying error message will explain why. This is the status code will be returned during rate limiting. error:appkey not bind domain! error_code:10017/2/statuses/share.json at wei
2021-09-23 15:41:43
1233
原创 微博调用api报错:error:Insufficient app permissions! error_code:10014/2/statuses/update.json
报错信息:weibo4j.model.WeiboException: 403:The request is understood, but it has been refused. An accompanying error message will explain why. error:Insufficient app permissions! error_code:10014/2/statuses/update.json at weibo4j.http.HttpClient.httpRequ
2021-09-23 15:38:30
851
原创 微博报错:Ip Limit, request ip is not contained in safety ip error_code:10004/2/status
微博授权后,测试发送时报错:Caused by: weibo4j.model.WeiboException: 400:The request was invalid. An accompanying error message will explain why. This is the status code will be returned during rate limiting. error:Ip Limit, request ip is not contained in safe.
2021-09-22 17:24:14
991
2
原创 使用vmware创建虚拟机,并安装系统(1)
一 准备:1.下载VMvare,百度获取激活码2.虚拟机系统镜像,以windows10为例,获取地址:下载 Windows 10 (microsoft.com)二 安装VMware虚拟机并激活后,创建新的虚拟机1.点击创建虚拟机2. 无特殊需求,傻瓜操作,下一步即可3.选择事先准备好的系统镜像4.继续下一步,直到安装完成。三 虚拟机创建完成后安装系统安装教程:手动安装客户机操作系统 (vmware.com)...
2021-09-15 20:37:51
251
原创 java处理http请求时报错:Attempted read from closed stream.
报错信息:Attempted read from closed stream.原因:EntityUtils.toString(HttpEntity entity, String defaultCharset)方法中操作的是流数据,流数据是一次性数据所以同一个HttpEntity不能使用多次该方法,即使是在编译器的变量监控里也不行,我就是在idea的debugger中加了这个变量进行监控,导致报错方案:删除重复的代码,用变量存储数据...
2021-08-17 15:44:17
618
原创 IDEA启动项目报错:Unable to open debugger port(127.0.0.1:64238):java.net.SocketException“socket closed
报错信息如下:解决方案:修改端口号为60157
2021-04-20 09:17:08
423
原创 html转pdf问题记录,中文不显示,中文不换行,css样式无效
代码示例:public static void htmlToPDF(String pdfPath, String htmlPath) throws Exception { try { ITextRenderer renderer = new ITextRenderer(); ITextFontResolver fontResolver = renderer.getFontResolver(); OutputStre
2021-04-20 09:00:59
5359
4
原创 使用itext,html转pdf使用报错:java.lang.NoSuchMethodError: com.lowagie.text.pdf.BaseFont.getCharBBox(C)
参考文章:1.https://download.csdn.net/download/u010154779/9422443?utm_medium=distribute.pc_relevant.none-task-download-2%7Edefault%7EBlogCommendFromMachineLearnPai2%7Edefault-3.control&dist_request_id=1331989.11359.16187985183088423&depth_1-utm_source
2021-04-19 10:40:48
2677
原创 IDEA,tomcat启动报错:Failed to initialize component [Connector[HTTP/1.1-8080]],Address already in use:
报错信息:19-Apr-2021 09:34:33.330 严重 [main] org.apache.catalina.core.StandardService.initInternal Failed to initialize connector [Connector[HTTP/1.1-8080]] org.apache.catalina.LifecycleException: Failed to initialize component [Connector[HTTP/1.1-8080]] a
2021-04-19 09:56:55
1819
原创 发送邮件报错:java.lang.UnsupportedOperationException: Method not yet implemented
现象:在本地调试时,可以正常发送邮件,将变更记录放到服务器上报了下面的错误原因:geronimo-spec-javamail jar包冲突,本地的pom文件中配置忽略此jar包,服务器上仍有此jar包 <exclusion> <groupId>geronimo-spec</groupId> <artifactId>geronimo-.
2021-02-03 16:17:55
500
原创 jdk1.6升级到1.8遇到的问题记录
报错信息:2020-11-10 09:38:58,779 [localhost-startStop-1](ContextLoader.java:355)org.springframework.web.context.ContextLoader ERROR - Context initialization failedjava.lang.NoSuchMethodError: org.springframework.core.annotation.AnnotationAwareOrderComparat
2020-11-12 14:53:53
912
1
原创 驱动程序无法通过使用安全套接字层(SSL)加密与 SQL Server 建立安全连接 解决方案
报错信息:驱动程序无法通过使用安全套接字层(SSL)加密与 SQL Server 建立安全连接环境:jdk1.8解决过程:经过百度后,进行了以下操作第一步:下载两个jar包--------------------->bcprov-ext-jdk15on-1.54.jar和bcprov-jdk15on-1.54.jar点击下载jar包第二步:将下载的两个JAR文件复制到:JDK安装目录\jre\lib\ext下,例如我的就是F:\JDK\jdk6\jre\lib\ex
2020-11-11 16:48:22
8734
1
原创 bug:provisional headers are shown 解决方案
最近在做项目的时候遇到一个小bug,大致流程是:1.通过ajax发送请求,去执行A操作2.请求成功后,在回调函数里去再次发送请求去执行B操作代码如下:function A(){ $.ajax({ type:'get', dataType:'json', url:url, success:function(data){
2020-09-19 16:50:00
617
原创 EasyUI常用取值和赋值方式
1.textbox<input class="easyui-textbox w150" type="text" id="a" maxlength="3" min="1" name="a" />取值:$("#a").textbox('getValue')赋值:$("#a").textbox('setValue','new value')2.datetimebox<input class="easyui-datetimebox w200" data-optio..
2020-09-15 17:51:19
1325
原创 java通过mkdir()方法创建文件夹未创建成功
创建文件夹有两种方法,mkdir()和mkdirs(),这两种方法的区别在于:1.mkdir()只能创建一级目录,且父目录必须存在2.mkdirs()可以直接创建多级目录mkdir源码如下: public boolean mkdir() { SecurityManager security = System.getSecurityManager(); if (security != null) { security.checkWrit
2020-08-14 10:32:13
6145
原创 org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 7; The processing instruction target mat
现象:原因:web.xml第一行有空格
2020-08-12 11:14:13
481
原创 java获取自增的id
情景:在执行完一条插入语句后,需要获取自增的id代码如下:String sql="select @@IDENTITY as id";id即插入操作产生的自增id
2020-04-10 16:40:03
966
原创 jQuery根据id修改class
需求:给id为login的div,添加class属性1.html代码如下:<div id="login">登录</div>2.js代码如下:$("#login").attr("class","login");
2020-04-09 17:53:36
2051
转载 sql中in后面使用占位符(转载)
select * from table where id in ? : 这种形式报错select * from table where id in (?) 这种形式只能查询第一条改用 select * from table whereFIND_IN_SET(id,?) 完美解决...
2020-03-30 15:07:27
2107
原创 linux数据库操作(执行sql脚本,导出)
1.登录数据库,在bin目录下输入./mysql -u user_name -p示例:./mysql -u root -p //用户名为root2.执行sql脚本show databases; //查看所有数据库use database_name; //选中数据库source file_path file_name示例:source /root/...
2020-03-26 18:27:46
1300
原创 使用SimpleDateFormat类实现时间String和Date类型的互相转化
1.将Date转成String字符串Date now = new Date(); //获取当前时间SimpleDateFormat sdf1=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); //24小时制SimpleDateFormat sdf2=new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); ...
2020-03-25 17:31:43
487
原创 linux文件操作命令入门笔记(tar,cp,mv,zip,scp)
1.复制 cp,将temp.tar.gz文件从/home1/root1目录下复制到/home2/root2下面cp /home1/root1/temp.tar.gz /home2/root22.移动mv,将temp.tar.gz文件从/home1/root1目录下复制到/home2/root2下面mv /home1/root1/temp.tar.gz /home2/root23...
2020-03-19 19:02:08
321
原创 oracle中查找某张表中所有用户的最新记录
表结构如下:CREATE TABLE TABLE_NAME( ID NUMBER NOT NULL, NAME VARCHAR(100), TIME DATE, STATE VARCHAR(100))需求:查找所有用户最新的一条数据一开始我想到是用group by分组,但是遇到了这样的报错:百度了发现group by之后的字段得和select...
2020-03-19 14:49:13
1127
原创 ORACLE数据库中通过自增序列和触发器实现id的自增
1.创建表,表名TABLE_NAMEDROP TABLE TABLE_NAME;CREATE TABLE TABLE_NAME( ID NUMBER NOT NULL, NAME VARCHAR(100));2.创建序列,序列名SEQ_NAMEcreate sequence SEQ_NAMEminvalue 1maxvalue 999999start with 1...
2020-03-10 13:16:18
176
原创 java读取properties配置文件(1)
方法一: 1.配置文件student.propertiesname:张三age:20sex:man2.配置文件读取工具类StudentUtil.javapublic class StudentUtil{ private static Properties props = new Properties(); static { try { props...
2020-02-27 23:20:05
129
原创 jquery修改css
1.html中插入代码块<div class="chares"> demo</div>2.添加jquery引用3.获取要修改的对象,修改样式<script type="text/javascript"> $().ready(function() { //修改指定div的背景颜色 ...
2020-02-27 22:50:16
137
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人