Discover spring boot redis configuration, include the articles, news, trends, analysis and practical advice about spring boot redis configuration on alibabacloud.com
Problem 1: Serialization and deserialization problem
Org.hibernate.LazyInitializationException:failed to lazily initialize a collection could not initialize Proxy-no On
This problem occurs because of the use of JPA in spring boot, the massive use of @manytomany, @ManyToOne, @OneToMany, while the Java Persistence API (JPA) in spring
Spring Boot attribute configuration and custom attribute Configuration
In the process of using spring boot, we can find that the project can complete the corresponding functions with only a few configurations, thanks to the modula
Play Spring Boot Custom configuration, import XML configuration and external configurationHere I'll give you a full description of how to customize the configuration in spring boot, cha
To understand the spring-boot of this technique, you should know Spring-boot's core profile application.properties, and of course you can customize the profile **.properties information through annotations.
I. Reading the contents of the core profile information Application.properties
A core profile is a application.properties or application.yml
Https://github.com/xetorthio/jedis explains how to add Jedis dependencies to spring boot.
Add the following code under Pom.xml
Adding in the main function
Jedis Jedis = new Jedis ("localhost");
Scanner in=new Scanner (system.in);
while (true) {
String name = In.next ();
String value = jedis.get (name);
System.out.println (value);
}
First install the
();Usefunctionservice.setfunctionservice (Functionservice ());return Usefunctionservice;}}5. OperationThe main code is as follows:/***Run the Portal */public class Main { public static void main (string[] args) { Annotationconfigapplicationcontext context = new Annotationconfigapplicationcontext (Javaconfig. Class) Usefunctionservice Usefunctionservice = Context.getbean (Usefunctionservice. Class) System. out.println (Usefunctionservice.sayhello ( "java config")) ; Context.close ()
interface and specifies the type of event to listen on. Public voidOnapplicationevent (Demoevent event) {//the message is accepted for processing using the Onapplicationevent method. String msg =event.getmsg (); System.out.println ("Bean-demolistener received a message from Bean-demopublisher:" +msg); }}3. Event Publishing class. Packagecom.ecworking.event;Importorg.springframework.beans.factory.annotation.Autowired;ImportOrg.springframework.context.ApplicationContext;Importorg.springframe
Org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate ( Runaftertestmethodcallbacks.java:86) at Org.springframework.test.context.junit4.statements.SpringRepeat.evaluate (SpringrepeatInitially thought to be its own configuration problem, after the check found no errorMay be a jar package conflict after analysisUpgrade the Spring-orm jar package to a higher version problem r
Since spring boot was used, it was forgotten that the XML configuration in spring MVC was something that could never be returned. Why spring boot so good, the convention is larger than the con
Gradual, from easy to difficult, so that more fun. Overview
This article began to continue on the basis of the content, this article mainly introduces Spring-session implementation configuration using Redis cluster, there will be two ways to configure, one is Redis-cluster, one is
The configuration of the data source can be followed by the example of Spring boot Learning (vii) Web applications using the Datasourceconfig implementation of JdbcTemplate multiple data source configuration. Add the JPA configuration for the first data source, note the two
SpringDataSource# Local Libraryurl:jdbc:mysql://192.168.18.7:3306/shiptrackersmart?useunicode=truecharacterencoding=utf-8 Zerodatetimebehavior=converttonull# Official Library# url:jdbc:mysql://192.168.3.141:3306/shiptrackersmart?useunicode=truecharacterencoding=utf-8 Zerodatetimebehavior=converttonullUsername:rootPassword:rootDriver-class-name:com.mysql.jdbc.driverType:com.alibaba.druid.pool.DruidDataSourceDruidMax-active:20Initial-size:1Min-idle:3max-wait:60000time-between-eviction-runs-millis:
Generally in a project, there will always be a lot of environments. Like what:
Production environment, pre-release environment, test environment, development environment
The configuration files on each environment are always different, and even the environment of each developer in the development environment may be a little differently, and configuring reading is a bit of a headache.Spring Boot
Spring Boot Property configuration and use
Spring Boot allows you to use the same application code in different environments via an external configuration, simply by injecting the properties into the
OverviewThis article mainly writes about some common configurations of spring boot.
Spring Boot Basic Configuration Entry class:Spring boot usually has an entry class named *application, and the entry class has a Main met
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.