IntelliJ IDEA

idea部署tomcat启动报错java.lang.NoClassDefFoundError: Could not initialize class org.springframework.be...

痴心易碎 提交于 2020-04-06 06:27:28
这一次的启动错误,让我花了整整两天解决(未完全解决),导致都没有产出,的确让人抓狂,必须来一篇博客记载,方才去除一波疼痛。 先贴一下错误日志: java.lang.NoClassDefFoundError: org.springframework.beans.FatalBeanException at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:527) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294) at org.springframework.beans.factory.support

分布式系统的Raft算法-一致性算法

给你一囗甜甜゛ 提交于 2020-04-06 00:12:21
原文出处: https://www.jdon.com/artichect/raft.html 过去, Paxos一直是分布式协议的标准,但是Paxos难于理解,更难以实现,Google的分布式锁系统Chubby作为Paxos实现曾经遭遇到很多坑。   来自Stanford的新的分布式协议研究称为Raft,它是一个为真实世界应用建立的协议,主要注重协议的落地性和可理解性。   在了解Raft之前,我们先了解Consensus一致性这个概念,它是指多个服务器在状态达成一致,但是在一个分布式系统中,因为各种意外可能,有的服务器可能会崩溃或变得不可靠,它就不能和其他服务器达成一致状态。这样就需要一种Consensus协议,一致性协议是为了确保容错性,也就是即使系统中有一两个服务器当机,也不会影响其处理过程。   为了以容错方式达成一致,我们不可能要求所有服务器100%都达成一致状态,只要超过半数的大多数服务器达成一致就可以了,假设有N台服务器,N/2 +1 就超过半数,代表大多数了。   Paxos和Raft都是为了实现Consensus一致性这个目标,这个过程如同选举一样,参选者需要说服大多数选民(服务器)投票给他,一旦选定后就跟随其操作。Paxos和Raft的区别在于选举的具体过程不同。   在Raft中,任何时候一个服务器可以扮演下面角色之一: Leader: 处理所有客户端交互

application.properties提示Cannot resolve configuration property 'xxxx'

守給你的承諾、 提交于 2020-04-05 23:20:51
1 问题描述 在IDEA的Spring Boot工程中的application.properties文件中,如果自定义属性会如下提示: Cannot resolve configuration property 'xxxx' 2 解决方式一 这其实是一个警告,可以不用理会,正常运行, @Value("${}") 可以正常获取到值,最暴力的方法就是关闭这个检查: 进入设置中的Editor-->Inspection-->Spring-->Spring Boot-->Spring Boot application properties,去掉右边勾选. 3 解决方式二(推荐) 这里提示Defind Configuration key a,然后按Alt+Shift+Enter后,就会创建一个addtional-spring-configuration-metadata.json的文件: 这里name是指定属性名字,type是类型,可以加上defaultValue指定默认值: 这样就不会有警告了: 来源: oschina 链接: https://my.oschina.net/u/4231975/blog/3213773

IDEA Gradle配置与使用

痴心易碎 提交于 2020-04-05 22:00:32
1.安装Gradle,并添加环境变量。 https://www.cnblogs.com/NyanKoSenSei/p/11458953.html 2.在IDEA中设置Gradle: 3.选中项目中的.gradle文件,右键选择"Import Gradle Project"。 4.接下来会弹出一个界面,Import Module From Gradle。 注意:Create separate module per source set这个不要勾选,不然一个module会分成多个部分。 5.成功导入依赖后,可以通过IDEA最右边的侧栏进行快捷操作。 点击刷新按钮,可以重新导入所有的依赖。 点击+号,并选中相关的.gradle文件,可以导入新的module。 6.在打开项目时,如果module还缺少某些依赖,可以直接在对应的类里面按alt+enter自动导入。 也可以点击File,打开Project Structure里面,点击Modules,点击dependencies,点击+号,导入jar包或者其他的module,如下所示: 7.在.gradle文件中添加新依赖,dir表示的是文件名,include中为jar包,如下: dependencies { compile fileTree(dir: trd, include: 'guava*.jar') compile fileTree

Class JavaLaunchHelper is implemented in two places

主宰稳场 提交于 2020-04-05 20:22:04
Mac 上的老bug,jdk版本 java version "1.8.0_144", 在java启动时使用了-javaagent参数时会触发。 此问题通过升级jdk版本即可。 You can find all the details here: IDEA-170117 "objc: Class JavaLaunchHelper is implemented in both ..." warning in Run consoles It's the old bug in Java on Mac that got triggered by the Java Agent being used by the IDE when starting the app. This message is harmless and is safe to ignore. Oracle developer's comment: The message is benign, there is no negative impact from this problem since both copies of that class are identical (compiled from the exact same source). It is purely a cosmetic issue. The

性能调试过程中经常使用的Intellij IDEA 快捷键

匆匆过客 提交于 2020-04-05 19:38:59
最近解决性能测试之后的各种性能问题,解决问题的过程中快捷键能够快速帮助我解决并修复问题,提升解决问题的效率。下面是几种常见常见问题的快捷键 01,标记代码位置 (1) 利用 Bookmarks Command + 2 打开 Favorities 窗口,将光标移动到某个 bookmark 上之后,按下 Enter 键选中,按下 ESC 将光标移动到 Editor 中对应的位置。 F3 向 Bookmarks 添加一个代码记录。 (2) 利用 Todo 插件 当看到多处代码需要修改时,可以利用 Todo插件来快速标记记录,然后逐个 Todo 来消除。 插件的使用就是直接键入 todo 关键词,自动生成格式化的注释,此时只需要添加重构说明就可以了。 Command + 6 打开 Todo 列表,选中后逐个重构。 02,编译运行 (1) 编译并检测 完成小块代码之后 Command + 0 打开 Terminal 窗口,通过 alias 为 gcb 来编译运行代码检测和单元测试。(gcb=./gradlew clean build) (2) 启动项目 为项目添加本地config,然后打开 Run/Debug Configurations 窗口,配置 Tasks为 runBoot ,Environment variables 为 SPRING_PROFILES_ACTIVE=local

SharePoint Online Administrator

谁说胖子不能爱 提交于 2020-04-05 19:31:17
SharePoint Online Administrator SharePoint Online 系列课程学习,本系列学习 是为有兴趣在Office 365环境中提高SharePoint Online管理员技能的个人设计的。本课程将带您进入与SharePoint Online相关的Office 365管理空间。知道如何管理SharePoint Online的背景(例如安全权限),为网站集管理员建立网站集以及使用搜索设置对于任何希望利用SharePoint Online功能的组织都至关重要。 本系列课程,学习内容如下。 了解架构的工作原理 建立网站集 建立用户权限 使用搜索并使其价值最大化 使用生产力功能以根据组织的需要最大化协作 学习计划和目标; Make the Best Use of It I'm developing an information system with Sharepoint, so the reason I would like to learn through this course is to hinder myself from misunderstanding the environment and miss the best use of it for something else. Power User- Willing to learn

Zookeeper源码编译(Zookeeper 3.4.11)并IDEA启动

那年仲夏 提交于 2020-04-05 17:55:34
一、 准备工作 1.下载Ant并安装 由于Zookeeper是由Ant编译,需下载Ant并安装配置 下载地址:https://ant.apache.org/bindownload.cgi 2.安装Ant: 解压: 配置环境变量: Path D:\devople\apache-ant-1.10.6\bin 输入ant -version验证: 出现Unable to locate tools.jar. Expected to find it in xxx 是由于本地JAVA_HOME未配置,配置完JAVA_HOME就可以了。 再次验证: 至此Ant安装成功。 3.下载Zookeeper源码 下载地址: https://github.com/apache/zookeeper https://github.com/apache/zookeeper 由于地址连接是最新版本的Zookeeper源码,本次选用的是Zookeeper 3.4.11版本。 下载zip文件。 解压: 二、编译Zookeeper源码 ant eclipse 编译 编译出错: 下载ant-eclipse-1.0.bin.tar.bz2失败 解决办法: 将bulild.xml中的 get src="http://downloads.sourceforge.net/project/ant-eclipse/ant-eclipse

IDEA 编译运行 Spring Boot 2.0 源码

寵の児 提交于 2020-03-27 11:44:24
3 月,跳不动了?>>> 下载代码切换分支 首先到 GitHub 上 clone 下 Spring Boot 的代码: git clone https://github.com/spring-projects/spring-boot.git 由于 Spring Boot 的发布版本代码都在 tag 上,所以需要使用 git tag 命令查看所有的 tag : git tag 然后切换到名为 v2.0.0.RELEASE 的 tag 上: git checkout -b v2.0.0.RELEASE v2.0.0.RELEASE 这样,代码就被保存到本地分支 v2.0.0.RELEASE 上了。 源码编译 Spring Boot 官方建议使用 ./mvnw clean install 或者标准的 mvn clean install 命令来编译源代码,如果要使用标准的 mvn 命令的话, Maven 的版本要求在 3.5.0 或以上。导入 IDEA 源码视图如下: 接着切换到 spring-boot 根目录下,执行如下命令,我这里使用的 Maven 版本是 3.5.4 : mvn -Dmaven.test.skip=true clean install 以上命令对 Spring Boot 源码打包并安装到本地 maven 仓库,在打包过程中会忽略测试,因为运行单元测试时间特别长

idea 注释模板

人盡茶涼 提交于 2020-03-26 09:47:18
3 月,跳不动了?>>> 1、方法注释 简写: * /* * @Description: $description$ * @Param: $params$ * @ return : $returns$ * @Author: Lsp * @Date: $date$ */ params: groovyScript("def result=''; def params=\"${_1}\".replaceAll('[\\\\[|\\\\]|\\\\s]', '').split(',').toList(); for(i = 0; i < params.size(); i++) {if(params[i] == '') return result;if(i==0) result += '\\n'; result+=' * @param ' + params[i] + ((i < params.size() - 1) ? '\\n' : '')}; return result", methodParameters()) returns: methodReturnType() date: date() 来源: oschina 链接: https://my.oschina.net/u/3211737/blog/3211665