在src/main/resources下创建applicationContext-service.xml ,内容如下: <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-insta
Spring Boot Actuator 是 Spring Boot 的一个子项目。通过它,可以很轻易地为应用提供多种生产级服务。本教程中,你将通过构建一个应用来学习如何添加这些服务。 1. 你需要构建什么 本教程将带你使用 Spring Boot Actuator 创建一个 “hello world” RESTful Web 服务。你需要构
org.hibernate.engine.jdbc.spi.SqlExceptionHelper 131 - [TxId : f68db5f5b-qmgnc^1561639897640^271530 , SpanId : 360544073895766848] The incoming tabular data stream (TDS) remote procedure call (RPC) protocol stream is incorrect. Too many parameters were pr
综合概述 Redis是一个开源免费的高性能key-value数据库,读取速度达110000次/s,写入速度达81000次/s。Redis支持丰富的数据类型,如Lists, Hashes, Sets 及 Ordered Sets 数据类型。Redis的所有操作都是原子性的,要么成功执行要么失败完全不执行。另外还可以通过MULTI和EXEC指令包起来支
以前使用springmvc项目时,整合quartz框架多用配置文件的形式,使用springboot后,可以完全用注解来整合quartz。 首先创建一个简单的maven项目,然后修改pom配置文件,引入需要用到的依赖 <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-p
spring service层 循环引用问题。 报错信息如下: Error creating bean with name 'smsCodeApiController': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: privat
1.pom.xml加入log4j2,并同时把spring boot默认的logging去掉,注意一定要全部排除否则会报错。 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-jdbc</artifactId> <exclusions>
Feign是一个声明式的Web Service客户端,它的目的就是让Web Service调用更加简单。Feign提供了HTTP请求的模板,通过编写简单的接口和插入注解,就可以定义好HTTP请求的参数、格式、地址等信息。 Feign = Ribbon(按顺序调用) + RestTemplate pom.xml添加的配置 <dependencies> <d
Spring 配置标签——util标签 一、配置applicationContext.xml <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:c="http://www.springframework.org/schema/
六月 29, 2019 5:42:45 下午 org.apache.catalina.core.AprLifecycleListener init信息: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: D:\OM_HOME\native\WIN32;D:\OM_H
1.ssm框架springmvc-servlet配置 <?xml version="1.0" encoding="UTF-8"?><beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="
先看一下问题: 1.在web.xml中配置Spring 加载Spring mvc的时候配置如下: <!--配置SpringMVC的前端控制器--> <servlet> <servlet-name>DispatcherServlet</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</
介绍:在lettuce那一篇里面写了用lettuce连接数据库,并且操作redis数据库 结构图: 1.依赖包 <!-- https://mvnrepository.com/artifact/org.springframework.data/spring-data-redis --><dependency> <groupId>org.springframework.data</groupId> <artifactId>spring
1.导入web项目,创建authentication模块,并修改pom.xml文件 2.将profiles文件粘贴到authentication模块中,profiles文件夹里面有两个文件database.properties和redis.properties文件 修改database.properties中的数据库连接属性(用户名,密码,数据库名称等),修改redis.properties文件redis属
方法一 application.yml 里设置 server: port: 80 servlet: session: tracking-modes: cookie cookie: http-only: true 方法二 启动类继承SpringBootServletInitializer 类,重写 onStartup 方法 import org.springframework.boot.SpringApplication; i
bean的生命周期 bean的生命周期:bean创建---初始化----销毁的过程容器管理bean的生命周期;我们可以自定义初始化和销毁方法;容器在bean进行到当前生命周期的时候来调用我们自定义的初始化和销毁方法-----一共四种方式 构造(对象创建) 单实例:在容器启动的时候创建对象多实例:在每次获取的
这是官网给出的例子: 先上pom文件: <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&qu
ylbtech-Java-Class-@I:org.springframework.validation.annotation.Validated 1.返回顶部 2.返回顶部 1、 package com.ylbtech.api.controller.operation;import cn.hutool.core.date.DateUtil;import com.ylbtech.api.core.response.Result;import co
课设做了个使用websocket在线聊天的小demo,在websocket调用service层时,报空指针异常,底层程序员就只会百度了~ 记下这个解决办法吧。 首先创建一个类 import org.springframework.beans.BeansException;import org.springframework.context.ApplicationContext;import org.springfra
redis 安装参考: https://blog.csdn.net/u013792404/article/details/93873585 nginx安装参考: https://mp.csdn.net/postedit/93863306 springboot 版本:2.0.6 maven依赖: spring-boot-starter-data-redis 和 spring-session-data-redis <?xml version="1.0" e
ylbtech-Java-Class-C:org.springframework.http.converter.StringHttpMessageConverter 1.返回顶部 1.1、 import org.springframework.http.converter.StringHttpMessageConverter; 1.2、 restTemplate.getMessageConverters().set(1, new StringHttpMessageConve
ylbtech-Java-Class-C:org.springframework.http.HttpHeaders 1.返回顶部 1.1、 import org.springframework.http.HttpHeaders; 1.2、 //请求头 HttpHeaders headers = new HttpHeaders();headers.setContentType(MediaType.APPLICATION_JSON); 1.3、 2.返回顶
1、添加pom依赖: 注意:建议不要使用spring-boot-starter-redis,此包Jun, 2017后已停止维护 示例: <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-cache</artifactId> <version>${spring-boot.version}&l
前置环境需要的配置: disconf环境搭建:https://blog.csdn.net/qq_37598011/article/details/93619525 SpringBoot与Disconf整合 pom文件 这里我用的是SpringBoot2.0 <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0&qu
<?xml version="1.0" encoding="UTF-8"?><beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframew