
问题总结
ilifee
学如逆水行舟,不进则退
展开
-
ieda显示services标签栏
ieda显示services标签栏原创 2022-07-07 16:53:14 · 229 阅读 · 0 评论 -
springboot 隐藏并代理远程文件
代码如下:@GetMapping("getImage") public void getImage(HttpServletResponse response) throws IOException { String path = "你的图片网络地址"; URL url = new URL(path); InputStream in = url.openStream(); byte[] buff = new byte[in.avail原创 2021-10-27 10:18:50 · 227 阅读 · 0 评论 -
springboot+mybatis FileNotFoundException
最近升级了springboot的版本<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-dependencies</artifactId> <version>${spring-boot.version}</version></dependency><dependency>原创 2021-09-07 15:24:42 · 311 阅读 · 0 评论 -
No service to register for nacos client...
No service to register for nacos client... 调试代码出现问题调试代码出现问题根据报错排查最后排查到debuger后发现@Value 得到的值为空。排查后,spring.application.name配置没有问题排查发现项目自己添加了注掉这个bean后问题解决。...原创 2021-08-05 15:07:18 · 1200 阅读 · 5 评论 -
高并发下使用Redis生成唯一id
最近使用spirngcloud来搭建分布式项目,遇到插入重复问题,决定用redis生成唯一ID来解决。 /** * 获取唯一Id * @param key * @param hashKey * @param delta 增加量(不传采用1) * @return * @throws BusinessException */原创 2017-11-09 15:32:50 · 24129 阅读 · 2 评论 -
SpringCloud Config 配置中心 svn使用
首先为了稳定和高可用,我采用注册中心的方式去实现。 pom.xml<?xml version="1.0" encoding="UTF-8"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLoca原创 2017-11-09 15:26:42 · 2444 阅读 · 1 评论 -
并发insert情况下会发生重复的数据插入问题
1.背景 用多线程接收推送的订单数据,把接收的订单数据存到一个表中,实现的需求是:如果接收的订单消息在数据库中已经存在,那么执行update操作;如果没有存在,那么执行insert操作 代码逻辑: [java] view plain copy if(该订单在数据库表中存在){ update();转载 2017-10-31 09:52:34 · 6065 阅读 · 0 评论 -
centos安装maven
下载 Maven 首先到 Maven 官网 http://maven.apache.org/download.cgi 下载 Maven 软件,这里下载的是 bin 版本。解压 Maven[root@zn234 testRelease]# tar -zxvf apache-maven-3.5.0-bin.tar.gz 修改配置 Maven[root@zn234原创 2017-10-21 10:18:34 · 436 阅读 · 0 评论 -
redis 集群使用
如果使用的是redis2.x,在项目中使用客户端分片(Shard)机制,已经很久之前的版本,该换新了(此处略过),本文讲解基于redis3.x中的集群,通过两部分来阐述spring boot整合redis,在项目中使用jedisCluster机制。第一部分:spring boot自带整合的redis,比较简单,看下来1>不用多说,pom.xml文件增加redis与sprin转载 2017-10-20 15:22:00 · 497 阅读 · 0 评论 -
解决Redis的Test replication partial resync: ok psync (diskless: yes, reconnect: 1)
■ 问题描述:下午配置一台阿里云的服务器,装完redis, 运行make test 报了这样的一个错误:!!! WARNING The following tests failed:*** [err]: Test replication partial resync: ok psync (diskless: yes, reconnect: 1) in tests/in转载 2017-10-25 09:54:02 · 1362 阅读 · 0 评论 -
spring静态类注入
创建XmppMessageUtil类 static Logger logger = LoggerFactory.getLogger(XmppMessageUtil.class); private static XmppMessageUtil xmppMessageUtil; @Resource(name = "loadBalanced") private Re原创 2017-10-16 20:24:43 · 994 阅读 · 0 评论 -
quartz集群配置是window启动没有问题,centos启动报错问题
Caused by: java.lang.IllegalStateException: Cannot run without an instance id. at org.quartz.impl.StdSchedulerFactory.instantiate(StdSchedulerFactory.java:1179) at org.quartz.impl.StdScheduler原创 2017-12-13 14:04:10 · 659 阅读 · 0 评论 -
springboot mybatis报错问题SpringManagedTransaction.getTimeout()Ljava/lang/Integer
本地运行正常,部署到服务器报错:org.springframework.web.util.NestedServletException: Handler dispatch failed; nested exception is java.lang.AbstractMethodError: org.mybatis.spring.transaction.SpringManagedTransaction...原创 2018-04-09 14:31:19 · 1175 阅读 · 0 评论 -
MySQLNonTransientConnectionException: No operations allowed after connection closed
今天服务器突然报错,接口返回错误,查日志:### Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: No operations allowed after connection closed. at org.apache.ibatis.exceptions.ExceptionFa...原创 2018-04-10 09:13:57 · 1944 阅读 · 0 评论 -
微信支付遇到的坑
支付宝是直接返回字符串可以直接调起支付宝,在微信时返回数据不能调起微信,app调起返回error_code=-1,查看微信支付官方文档: Map<String, Object> map = new HashMap<String, Object>(); String prepay_id = data...原创 2018-04-10 20:22:00 · 446 阅读 · 0 评论 -
window下安装kafka
下载软件:http://mirror.bit.edu.cn/apache/zookeeper/zookeeper-3.4.10/zookeeper-3.4.10.tar.gzhttp://mirror.bit.edu.cn/apache/kafka/1.1.0/kafka_2.11-1.1.0.tgz安装zk:解压zookeeper进入D:\Program Files\zookeeper-3.4....原创 2018-04-26 14:31:22 · 1067 阅读 · 0 评论 -
Error merging: refusing to merge unrelated histories
今天突然想建个项目,git报了个错误无暇fatal: refusing to merge unrelated histories -解决办法:git pull --allow-unrelated-histories原创 2018-09-24 15:38:16 · 9572 阅读 · 2 评论 -
spring boot1.5以上版本@ConfigurationProperties取消location注解后的替代方案
问题在spring boot(版本1.5.1.RELEASE)项目中,当准备映射自定义的配置文件属性到类中的时候,发现原本的@ConfigurationProperties注解已将location属性移除,因此导致无法正常给配置类的属性赋值(spring boot这么做其实也有他的道理,具体可参考https://github.com/spring-projects/spring-boot/iss转载 2017-10-20 15:17:09 · 531 阅读 · 0 评论 -
centos时间网络同步
最近部署集群,发现时间不一致,整理下修改方案1. 安装ntpdate工具# yum -y install ntp ntpdate2. 设置系统时间与网络时间同步# ntpdate cn.pool.ntp.org3. 将系统时间写入硬件时间# hwclock --systohc4.强制系统时间写入CMOS中防止重启失效hw原创 2017-10-19 19:11:00 · 281 阅读 · 0 评论 -
xStream完美转换XML、JSON
xStream完美转换XML、JSONxStream框架xStream可以轻易的将Java对象和xml文档相互转换,而且可以修改某个特定的属性和节点名称,而且也支持json的转换;前面有介绍过json-lib这个框架,在线博文:http://www.cnblogs.com/hoojo/archive/2011/04/21/2023805.html以及Jackson这个框架,在线转载 2015-09-15 09:53:47 · 471 阅读 · 0 评论 -
MyBatis一对多和多对一
在学习MyBatis3的过程中,文档上面一直在强调一个id的东西!在做这个实验的时候,也因为没有理解清楚id含义而导致一对多的“多”中也只有一条数据。id和result的唯一不同是id表示的结果将是当比较对象实例时用到的标识属性。这帮助来改进整体表现,特别是缓存和嵌入结果映射。所以不同数据的id应该唯一区别,不然导致数据结果集只有一条数据。一、表二、实体1.person转载 2015-12-22 09:43:15 · 494 阅读 · 0 评论 -
Dubbo入门示例
. Dubbo是什么?Dubbo是一个分布式服务框架,致力于提供高性能和透明化的RPC远程服务调用方案,以及SOA服务治理方案。简单的说,dubbo就是个服务框架,如果没有分布式的需求,其实是不需要用的,只有在分布式的时候,才有dubbo这样的分布式服务框架的需求,并且本质上是个服务调用的东东,说白了就是个远程服务调用的分布式框架(告别Web Service模式中的WSdl,以服务者与消费者的转载 2016-01-06 14:37:56 · 419 阅读 · 0 评论 -
java二叉树的构建以及遍历
1.把一个数组的值赋值给一颗二叉树2.具体代码1.树的构建方法2.具体代码转载 2016-04-26 16:24:50 · 387 阅读 · 0 评论 -
springmvc +Redis环境搭建
回顾一下redis搭建环境pom加入redis配置 org.springframework.data spring-data-redis 1.4.0.RELEASE redis.clients原创 2016-04-15 14:37:30 · 901 阅读 · 0 评论 -
Sring自动注入Bean
最近新看到自动注入Bean,翻起以前的项目看了下。以前我们使用注解的的配置context:component-scan base-package=”XX.XX”/>这种需要使用繁琐的注解。自动注解配置: 这样每个Bead就不必都去写繁琐的注解。context:exclude-filter标签的含义是:排除扫描到的所有类,不纳入Spring容器中原创 2016-04-19 10:55:26 · 964 阅读 · 0 评论 -
yum安装mysql,迅速上手
第1步、yum安装mysql[root@stonex ~]# yum -y install mysql-server安装结果:Installed: mysql-server.x86_64 0:5.1.73-3.el6_5转载 2016-04-20 14:51:02 · 368 阅读 · 0 评论 -
MyBatis传入参数为集合 list 数组 map写法
foreach的主要用在构建in条件中,它可以在SQL语句中进行迭代一个集合。foreach元素的属性主要有item,index,collection,open,separator,close。item表示集合中每一个元素进行迭代时的别名,index指定一个名字,用于表示在迭代过程中,每次迭代到的位置,open表示该语句以什么开始,separator表示在每次进行迭代之间以什么符号作为分隔符转载 2016-04-22 16:17:18 · 623 阅读 · 0 评论 -
143. Reorder List学习
143. Reorder List Total Accepted: 71015 Total Submissions: 301125 Difficulty: MediumGiven a singly linked list L: L0→L1→…→Ln-1→Ln,reorder it to: L0→Ln→L1→Ln-1→L2→Ln-2→…You must do th原创 2016-08-10 17:06:23 · 372 阅读 · 0 评论 -
git push远程报错问题
使用git push代码出现以下错误 ! [rejected] master -> master (fetch first)error: failed to push some refs to 'git@git.oschina.net:guoshaohua/emi.git'hint: Updates were rejected because the remote contain原创 2016-12-20 10:13:40 · 1555 阅读 · 1 评论 -
elasticsearch 不能root启动
因为安全问题elasticsearch 不让用root用户直接运行,所以要创建新用户第一步:liunx创建新用户 adduser XXX 然后给创建的用户加密码 passwd XXX 输入两次密码。第二步:切换刚才创建的用户 su XXX 然后执行elasticsearch 会显示Permission denied 权限不足。第三步:给新建的XXX赋权限,chmod 777 *转载 2017-02-22 09:27:03 · 2207 阅读 · 0 评论 -
ElasticSearch使用教程四(ElasticSearch查询详解)
一、简介说明注意:以下命令都是使用sense测试(ElasticSearch第二步-CRUD之Sense),且数据都已经使用过IK分词。以下测试数据来源于文档(db_test/person)需要注意的是下面的id是文档的ID,不是elasticsearch生成的_id,删除文档需要用_id{ "id": "0959ab1c-47bf-4417-904c-e5bc转载 2017-03-03 15:42:46 · 587 阅读 · 0 评论 -
将jar包安装到本地仓库
将jar包安装到本地仓库mvn install:install-file -DgroupId=com.answern -DartifactId=com.answern.faceout.service -Dversion=0.0.1 -Dpackaging=jar -Dfile=F:/com.answern.faceout.service.jar c原创 2017-03-16 10:09:27 · 427 阅读 · 0 评论 -
阿里云 centos7.2安装rabbitmq
首先安装二郎神(erlang)依赖环境yum install unixODBC unixODBC-devel wxBase wxGTK SDL wxGTK-glyum install erlang安装rabbitmqwget http://www.rabbitmq.com/releases/rabbitmq-server/v3.6.6/rabbitmq-server-3.6.6-1原创 2017-04-26 14:37:31 · 1593 阅读 · 0 评论 -
zuul报forward错误问题 com.netflix.zuul.exception.ZuulException: Forwarding error
最近使用zuul的时候总出现forward报错的问题,上代码:com.netflix.zuul.exception.ZuulException: Forwarding error at org.springframework.cloud.netflix.zuul.filters.route.RibbonRoutingFilter.handleException(RibbonRoutingFi原创 2017-09-29 15:54:40 · 90756 阅读 · 32 评论 -
Nginx安装
https://www.openssl.org/source/openssl-fips-2.0.16.tar.gzhttp://www.cpan.org/src/5.0/perl-5.24.0.tar.gzhttp://zlib.net/zlib-1.2.11.tar.gzftp://ftp.csx.cam.ac.uk/pub/software/programming/pc原创 2017-10-17 13:51:20 · 401 阅读 · 0 评论 -
socket 乱码解决
最近在做socket相关功能,发现乱码不能解决,经研究客户端BufferedReader is = new BufferedReader(new InputStreamReader( socket.getInputStream(),"gbk"));服务端:PrintWriter os = null; os原创 2015-05-20 14:45:56 · 528 阅读 · 0 评论