- 博客(32)
- 问答 (2)
- 收藏
- 关注
原创 Rocketmq 发送消息报错create mapped file failed, server is busy or broken.
jdk版本问题,我64位的win10,装的网上随便下载的jdk8,结果是32位的,换成64位的官网下载的jdk就可以了
2022-02-28 15:22:59 494
转载 AOP核心概念及术语
切面(aspect):封装各种横切关注点的类,即@Aspect注解标记的那个类 连接点(joinpoint):是指那些可以被拦截到的点。连接点是一个虚拟的概念,可以理解为所有满足切点扫描条件的所有的时机,就是spring允许你使用通知的地方. 那可真就多了,基本每个方法的前,后(两者都有也行),或抛出异常时都可以是连接点,spring只支持方法连接点.其他如aspectJ还可以让你在构造器或属性注入时都行,不过那不是咱关注的,只要记住,和方法有关的前前后后(抛出异常),都是连接点。 具体举个例子:比如开
2021-10-07 07:20:40 223
原创 linux IO模型
IO模型分为同步阻塞,同步非阻塞,同步多路复用,异步阻塞(没有此情况),异步非阻塞.当用户调用chanel.read和stream.read后,会切换到操作系统内核态来完成真正的数据读取。而数据读取又分为两个阶段:等待数据阶段 复制数据阶段阻塞IO(同步模式): 调用read后,网络上还没数据过来,read方法就阻塞住,一直等到linux内核有数据返回,并复制数据结束才继续执行。非阻塞IO(同步模式): 调用read后,网络上还没数据过来,立即返回,循环多次调用,直到有数据为止,然后.
2021-09-18 19:19:43 73
原创 socket各阻塞模式示例代码
同步阻塞 server端: public class Server { public static void main(String[] args) throws IOException { ServerSocketChannel ssc=ServerSocketChannel.open(); ssc.bind(new InetSocketAddress(8000)); List<SocketChannel> channels=new
2021-09-18 17:24:28 179
原创 NIO零拷贝
文件大小:1.46 GB (1,568,946,426 字节)使用transferTo零拷贝,代码如下,耗时12116ms public static void main(String[] args) throws IOException { long start=System.currentTimeMillis(); FileChannel inputChannel=new FileInputStream(new File("E:\\video\\第1阶段.
2021-09-17 21:00:56 108
原创 ByteBuffer
1.ByteBuffer的正确使用姿势:2.ByteBuffer的属性:* limit:ByteBuffer的读写限制* capacity:ByteBuffer的容量,即ByteBuffer.allocate(N).N为capacity* position:ByteBuffer读写到哪一个位置.结构如下:put():会一直增加Position的位置,如下: get():会一直减少Postioin的位置,直至0,如下: flip():为读取做准备。会改变两个指针:将Pos...
2021-09-17 08:08:26 238
原创 idea启动卡死的问题
现象:cloud项目,项目启动过程中卡住不动,重启电脑,清理idea缓存都不行,最后发现是断点打在了方法头上,关键是没进入调试模式,也没有任何提示,就是单纯的程序卡住。迅速记录一下...
2021-08-26 15:32:38 592
原创 单机搭建mongoDB集群
配置主从机器: 修改端口: 启动机器: 声明集群配置: var cfg={ _id:"testrs", members:[ {_id:0,host:'192.168.0.101:27007'}, {_id:1,host:'192.168.0.101:27017'}, {_id:2,host:'192.168.0.101:27027'}]}; 生效集群: rs.initiate(cfg) ...
2021-06-08 05:11:24 388
原创 记录一个mybatis特殊符号未转义带来的错
<update id="updateAccounts"> update t_account set mone= mone- #{mone} where id = #{id} and mone>=#{money} </update>
2021-06-08 05:09:49 229
转载 javascript ObjectId转Date
db.getCollection("ser").find().limit(20).forEach(function(item){ var _str = item._id.toString().substr(10, 8); var _date = new Date(Number(parseInt(_str, 16).toString() + '000')); item.createTime = _date; print(_date);})
2020-08-31 11:49:11 232
原创 kettle mongodb input插件根据id查询
{'_id' : {'$gte' : {'$oid': "5ddb8bb224aa9a00066f81ca"}}}
2020-06-29 11:21:56 854 2
原创 linux命令行查看服务器对外IP地址
[root@doctor-common-42 ~]# curl cip.ccIP : 19.35.66.83地址 : 中国 广东 深圳运营商 : 联通数据二 : 广东省深圳市 | 联通数据三 : URL : http://www.cip.cc/19.35.66.83
2020-05-20 10:59:04 1166
原创 nginx设置跨越
proxy_set_header Cookie $http_cookie; proxy_pass_header Set-Cookie; add_header Access-Control-Allow-Origin *; #add_header Access-Control-Allow-Origin http://abc.com; add_header Access-Control-Allow-Credentials tru...
2020-05-19 10:03:23 207
原创 Windows环境下 Hadoop Error: JAVA_HOME is incorrectly set. 问题
好了,先说问题在win10上配置好了JAVA_HOME和HADOOP_HOME,并将两者的bin都配置到了path中,然后在cmd中执行hadoop命令,报错如下:C:\Users\Administrator>hadoop系统找不到指定的路径。Error: JAVA_HOME is incorrectly set. Please update D:\soft\ha...
2020-04-26 06:36:45 500 1
原创 让feign支持文件传输
公司用的spring cloud项目,需要用到feign上传文件到另一个服务。首先,默认feign是不支持文件传输的,需要给feign增加插件1. 首先给feign加入maven支持: <dependency> <groupId>io.github.openfeign.form</groupId> <art...
2020-03-12 22:53:51 812
原创 mongodb中的ObjectId转当前时间
java示例代码如下: public static void main(String[] args) { Date date = new Date(Long.parseLong(Integer.parseInt("5da175492ab79c00085d556c".substring(0, 8), 16) + "000")); System.out.pr...
2020-02-27 14:03:51 474
原创 MongodbDriver or查询
java mongodb驱动"$or"查询示例 BasicDBObject filter = new BasicDBObject().append( "$or", new BasicDBObject[] { new B...
2020-02-26 15:21:44 306
原创 mongoddb对集合数据作精确统计
count()函数有时候统计会不准备,需要用aggregate做精确统计(反正我是经常遇到不准备的情况,被count坑了N次,所以用博客记下来)db.getCollection("collectionName").aggregate( [ { $group : { _id : null, co...
2020-02-25 20:35:15 102
原创 c# 生成连续MAC地址
class Program { public static void Main(String[] args) { String filePath = "f://mac.txt"; genPatchMAC("00:00:00:00:00:00", 100, filePath); Con...
2019-08-31 15:18:01 834
原创 关于用stream API报Failed to read candidate component class:xxx的错
最近开发由于用了StreamAPI,遇到一个很奇怪的错, org.springframework.beans.factory.BeanDefinitionStoreException: Failed to read candidate component class: file [E:\Javapfp\.metadata\.plugins\org.eclipse.wst.server.cor...
2018-08-18 19:24:06 488
原创 Tomcat中用环境变量灵活定义spring数据库文件路径
相信很多公司都是基于window做JAVA开发,然后生产环境却是在Linux下,这样导致的一个问题就是JDBC配置文件路径不一致. Spring项目中一般用PropertyPlaceholderConfigurer类在ApplicatonContex.xml中进行配置文件定义,如下: <bean id="propertyConfigurer" class="org.spr
2017-08-25 13:06:41 632
原创 springmvc 配置swagger
springmvc 配置swagger环境:spring 4.1.6 jdk:1.8.0_661.首先导入swagger依赖 <dependency> <groupId>io.springfox</groupId> <artifactId>springfox-swagger2</artifactId> <vers
2017-08-24 16:20:49 273
原创 apns code
Status code Description0No errors encountered1Processing error2Missing device token3Missing topic4Missing payload5Invalid token size6Invalid topic size7Invalid payloa...
2015-02-11 15:57:41 145
原创 tomcat配置jmx
tomcat 配置 jmx时,我的tomcat8.0.18/bin/catalina.sh里顶行设置为#!/bin/shJAVA_OPTS="-Dcom.sun.management.jmxremote.port=8999 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authentica...
2015-02-06 10:30:58 90
原创 android报错:This Android SDK requires Android Developer Toolkit version 22.6.1 or above 解决方法
Error Message : This Android SDK requires Android Developer Toolkit version 22.6.1 or above
2014-05-06 14:41:29 469
空空如也
rabbitmq mqtt adapter 没办法做ssl证书验证
2015-03-06
apns经常超时,求解决方案
2015-02-10
TA创建的收藏夹 TA关注的收藏夹
TA关注的人