好好排版 hadoop-hdfs 2.7.3 JDK 1.8 需要引入的包? import com.jianwei.collection.entity.qo.ZhudanSourceQO; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileStatus; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.io.IOUtils; import org.apache.hadoop.util.Progressable; import java.io.*; 上传单个文件 ? /** * 拷贝文件 * @param src * @param dst * @param conf * @return * @throws Exception */ public static boolean copyFile(Stri.... java上传文件或文件夹到hdfs Java是世界上最好的语言
引入相关依赖 <dependency> <groupId>com.github.pagehelper</groupId> <artifactId>pagehelper-spring-boot-starter</artifactId> <version>1.2.3</version> <exclusions> <exclusion> <groupId>org.mybatis</groupId> <artifactId>mybatis</artifactId> </exclusion> <exclusion> <groupId>org.mybatis</groupId> <artifactId>mybatis-spring</artifactId> </exclusion> </exclusions> </dependency>.... Springboot整合mybatis-plus分页 Java是世界上最好的语言
从下午 16 点搞到 20 点,一直在搞这一个问题,最后看了一篇 csdn 博客,看人家版本用的哪一个,抄过来,就好了...... 下面记录下具体版本号 解决办法如下: spring-boot-starter-parent 使用 2.1.9.RELEASE 版本, 所有 groupid 为 org.springframework.boot 的,都使用 2.0.0.RELEASE 版本 hadoop.version 2.7.3 spark.version 2.1.0 scala.version 2.11.12 scala.sdk.version scala-sdk-2.11.12 <?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:schemaLocation="http://maven.apache.org/POM/.... spring-boot-starter-parent 与 spark 不兼容 Java是世界上最好的语言
项目中手动引入了日志 jar 包,但是由于是 SpringBoot 项目,里头已经内置了日志组件,所以要去除内置日志组件 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter</artifactId> <exclusions> <exclusion> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-logging</artifactId> </exclusion> </exclusions> </dependency> slf4j-log4j12 与 logback-classic 冲突及解决方式 Java是世界上最好的语言
SpringBoot 会从 classpath 下的/config 目录或者 classpath 的根目录查找 application.properties 或 application.yml!!! 把配置文件的名称改为 application.properties 或 application.yml 就能读取到了 Springboot项目启动时读取不到配置文件怎么办? Java是世界上最好的语言
1.将SpringBoot项目打jar包 pom.xml增加spring-boot-maven-plugin插件 使用右侧maven-Lifecycle-package打jar包 使用java -jar *-1.0.0.jar测试可用 2.新建Dockerfile FROM java:8 VOLUME /tmp ADD love-0.0.1-SNAPSHOT.jar /love.jar ENTRYPOINT["java","-Djava.security.egd=file:/dev/./urandom","-jar","/love.jar"] 3.将jar包拷贝到和Dockerfile同文件夹 4.创建镜像 docker build -f /usr/local/lovecaining/Dockerfile -t lovecaining 5.运行镜像 docker run -d -p 8088:8088 --name lovecaining lovecaining 将SpringBoot项目发布到Docker Java是世界上最好的语言
刚开始特别纳闷,原来 quartz 将方法缓存到了数据库,怪不得我重启服务器,关闭 idea 都不好使,哈哈哈,闹笑话 Quartz applicationContext-quartz.xml 实例demo Java是世界上最好的语言
定时任务与事务合理搭配结构为: @Autowired Y y; @ Scheduled() void xxx(){ y.x(); } class Y { @Transactional x(){ } } 错误示例: @Scheduled(fixedDelay = 5201314) @Autowired public void storeHuaweiData(){ iAgentQueryService.delHwSkillGroups(); int i = 0/1; int i2 = 1/0; iAgentQueryService.addHwSkillGroups(); } 生效示例: @Scheduled(fixedDelay = 5201314) public void storeHuaweiData(){ SkillGroupsTransactional skillGroupsTransactional = new SkillGroupsTransactional(); skillGroupsTransactional.transactional(hwSkillGroups);.... @Scheduled 增加 @Transactional 事务 Java是世界上最好的语言