boot

How do I debug a process that starts at boot time?

送分小仙女□ 提交于 2019-12-03 06:13:50
问题 I am trying to set a breakpoint into a Windows service that starts at boot time. Because of an unfortunate mistake on my end, the service forces the machine into a reboot loop: this means that I can't get to a stable state from which I could deploy a fix, and obviously I can't try to debug the service at a more convenient time. I can use windbg in kernel mode. I'd very much like to break when the service hits the wmain function, but I'm having issues with that. Up to now, I found that I can

springboot常见问题

巧了我就是萌 提交于 2019-12-03 05:39:18
什么是 Spring Boot? 为什么要用 Spring Boot? Spring Boot 的核心配置文件有哪几个?它们的区别是什么? Spring Boot 的配置文件有哪几种格式?它们有什么区别? Spring Boot 的核心注解是哪个?它主要由哪几个注解组成的? 开启 Spring Boot 特性有哪几种方式? Spring Boot 需要独立的容器运行吗? 运行 Spring Boot 有哪几种方式? Spring Boot 自动配置原理是什么? Spring Boot 的目录结构是怎样的? 你如何理解 Spring Boot 中的 Starters? 如何在 Spring Boot 启动的时候运行一些特定的代码? Spring Boot 有哪几种读取配置的方式? Spring Boot 支持哪些日志框架?推荐和默认的日志框架是哪个? SpringBoot 实现热部署有哪几种方式? 你如何理解 Spring Boot 配置加载顺序? Spring Boot 如何定义多套不同环境配置? Spring Boot 可以兼容老 Spring 项目吗,如何做? 保护 Spring Boot 应用有哪些方法? Spring Boot 2.X 有什么新特性?与 1.X 有什么区别? JavaBean是什么时候创建的? SpringBoot框架中,JavaBean都是单例的吗

Spring Boot-开启第一步

孤者浪人 提交于 2019-12-03 05:39:12
Spring Boot开发的目的是为了简化Spring应用的开发,使用Spring Boot可以零配置开启一个Spring应用。这得益于Spring Boot中的自动配置组件,如果开发者觉得默认的配置文件不满足要求, 可以自己配置一个 properties 文件或者 yml 文件,配置文件中填写需要覆盖的配置,来达到定制化的效果 搭建项目 这里使用IDEA工具来生成一个Spring Boot的项目. IDEA创建新项目,选择图片中红框中的内容 点击下一步,填写包名和项目名称等相关信息 下一步后选择需要添加的依赖,这里我们暂时还不需要添加依赖,就不勾选任何依赖 然后选择项目文件的路径,选择finish就可以创建一个简单的Spring Boot应用程序 运行演示 运行启动类的main方法,就可以启动刚刚创建的Spring Boot应用 启动过后,应用会在控制台打印出启动的日志信息 如果没有异常信息,那么这个最简单的Spring Boot应用就成功搭建并运行了 打包部署 Spring Boot创建的应用可以有两个运行方式,一种是将整个项目打包成Jar包直接运行,这是因为Spring Boot中集成了tomcat容器。 另外一张方式就是把项目打包成war包,然后放入tomcat服务器中,运行tomcat来访问应用 简单起见,在这里我们先使用第一中介绍的使用Jar包运行的方式

SpringBoot自动配置的魔法

让人想犯罪 __ 提交于 2019-12-03 05:36:36
Spring自动配置 从@SpringBootApplication注解说起 SpringBoot 会根据类路径下的类自动配置,省去了编写繁琐的 xml 配置文件。原本基于 xml 配置 bean 的方式编程基于Java代码,并且可以条件化配置,根据不同的场景配置也随之不同。是不是很智能 为了清楚 SpringBoot 自动配置的原理,我们从最简单的 SpringBoot 的启动类说起,看一个简单的启动实例 @SpringBootApplication public class Application { public static void main(String[] args) { SpringApplication.run(Application.class); } } SpringBoot 应用的启动很简单,就是一个 main 方法,然后执行 SpringApplication 的run方法。先不关心run方法是怎么执行的。我们先看 SpringBoot 应用的核心注解 @SpringBootApplication @Target(ElementType.TYPE) @Retention(RetentionPolicy.RUNTIME) @Documented @Inherited @SpringBootConfiguration

spring boot 1.5.10.RELEASE ,spring boot admin 1.5.7 添加 security

拈花ヽ惹草 提交于 2019-12-03 04:40:40
生产环境的客户端actuator最好是加上security校验,不然配置信息不登录就能直接获取到 server端配置 ,参考官方 文档, https://codecentric.github.io/spring-boot-admin/1.5.7/#getting-started 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:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.xx</groupId> <artifactId>spring-boot-admin</artifactId> <version>0.0.1</version> <packaging>jar</packaging> <name>spring-boot-admin</name> <parent> <groupId>org

Spring Boot Maven Plugin打包异常及三种解决方法:Unable to find main class

自作多情 提交于 2019-12-03 04:38:05
参考文章: Spring Boot Maven Plugin打包异常及三种解决方法:Unable to find main class ------------------------------------------ 1、maven默认打的war内的MANIFEST.MF文件中,只包含Main-Class,且是main方法所在的类。 2、而通过spring-boot:repackage对默认war包处理后,MANIFEST.MF就包含了Main-Class和Start-Class,并且原来的Main-Class变成了新的Start-Class,而新增加的Start-Class与打包的类型有关,分别问org.springframework.boot.loader.WarLauncher和org.springframework.boot.loader.JarLauncher。 3、默认的Main-Class和新的Start-Class,可以通过pom.xml进行设置, 根节点<project>下的<properties>元素和插件spring-boot-maven-plugin下的<configuration>元素都可以进行设置。但配置项名称不同,<properties>下是通过<start-class>进行配置,<configuration>是通过<mainClass>进行配置

Spring Boot with JNDI Data Source

匿名 (未验证) 提交于 2019-12-03 03:06:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a new Spring Boot web application that I want to connect to a JNDI data source (a MySQL database defined in Tomcat's context.xml). However when I attempt this, I always get the following exception; org.springframework.beans.factory.BeanCreationException: Cannot determine embedded database url for database type NONE. If you want an embedded database please put a supported on on the classpath. This is despite my pom.xml containing the MySQL connector <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0

SpringBoot: Unable to find a single main class from the following candidates

匿名 (未验证) 提交于 2019-12-03 03:03:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I've generated a Spring Boot web application using Spring Initializer, embedded Tomcat, Thymeleaf template engine.Technologies used: Spring Boot 1.4.2.RELEASE, Spring 4.3.4.RELEASE, Thymeleaf 2.1.5.RELEASE, Tomcat Embed 8.5.6, Maven 3, Java 8 I have an SpringBoot app. with these 2 classes: @Profile("!war") @SpringBootApplication @Import({SecurityConfig.class ,PersistenceConfig.class, ServiceConfig.class}) public class BookApplication { public static void main(String[] args) { SpringApplication.run(BookApplication.class, args); } } @Profile(

java.lang.NoSuchMethodError on Kafka Consumer with spring-kafka 2.1.0 and SpringBoot 1.5.9

匿名 (未验证) 提交于 2019-12-03 03:02:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am trying to setup Kafka Consumer using SpringBoot(1.5.9) and Spring-kafka(2.1.0). However when I start my app I get java.lang.NoSuchMethodError: org.springframework.util.Assert.state(ZLjava/util/function/Supplier;)V on Kafka MessagingMessageListenerAdapter. I tried with Spring-Kafka(1.2.0) and that error went away. Has anyone else experienced this version incompatibility? Here is my config class @EnableKafka @Configuration public class ImporterConfigs{ static Logger logger = Logger.getLogger(ImporterConfigs.class); @Value("${kafka

Reduce boot time in ionic-2 app

匿名 (未验证) 提交于 2019-12-03 02:59:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I am new to ionic-2 project.I just want to know how to reduce boot time of app.Because after 3 sec of splash screen , it shows white screen and takes 9 sec to start. 回答1: Try to put this on the second line of your main.ts file import { enableProdMode } from '@angular/core'; then before the bootstrap line put enableProdMode(); also when building use --prod so ionic build android --prod 回答2: Please follow below steps to reduce splash screen time:- First, delete your node_modules folder Delete any Temp Folder Delete Plugins Folder