ICode9

精准搜索请尝试: 精确搜索
  • Gateway 网关2022-07-20 22:33:01

    Gateway gateway功能: 身份认证和权限校验 服务路由(访问哪一个服务),负载均衡(服务之间Ribbon) 对用户请求限流 gateway的技术实现: gateway zuul *zuul是基于servlet的实现,属于阻塞式编程, *SpringCloudGateway则是基于Spring5中提供的WebFlux,属于响应式编程的实现,具备更

  • 自建redis迁移云报错2022-07-20 17:35:53

    java服务开始使用的自建的redis 将其迁移到腾讯云redis时报错 如下: 14:22:56.048 [localhost-startStop-1] ERROR o.s.web.context.ContextLoader:351 - Context initialization failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name

  • SpringMvc里的RequestBodyAdviceAdapter使用问题2022-07-20 15:34:02

    一、问题 之前写过一篇《springboot修改接口入参出参实现入参加密出参解密》,代码一直跑着都没问题,但是最近发现入参特别长的时候,inputMessage.getBody() 这段代码拿不到完整的入参,会被截断。 看了下源码,好像默认它转换的时候就截断了。 二、解决方法 看了下源码,RequestBodyAdviceA

  • 配置自定义数据源2022-07-20 11:33:56

    package com.huawei.metrics.config; import org.apache.ibatis.session.SqlSessionFactory; import org.mybatis.spring.SqlSessionFactoryBean; import org.mybatis.spring.SqlSessionTemplate; import org.mybatis.spring.annotation.MapperScan; import org.springframew

  • (二)spring的bean自动装配2022-07-19 20:00:31

    spring的bean自动装配主要是通过@Autowired注解实现的 (一) bean源代码解析 @Target({ElementType.CONSTRUCTOR, ElementType.METHOD, ElementType.PARAMETER, ElementType.FIELD, ElementType.ANNOTATION_TYPE}) @Retention(RetentionPolicy.RUNTIME) @Documented public @interfa

  • RabbitMQ消费者消失与 java OOM2022-07-19 15:01:07

    原因: 下午先是收到钉钉告警有一个消费者系统任务积压, 当时以为就是有范围上量没有当回事,后来客服群开始反馈说有客户的数据没有生成。这个时候查看mq的后台,发现任务堆积数量还是很多。 这个时候登录一台消费者系统查看日志,发现OOM [2022-07-09 16:40:34.640] [ERROR] [org.spring

  • org.springframework.web.HttpMediaTypeNotSupportedException: Content type 'multipart/form-data2022-07-18 22:31:10

    报错信息 org.springframework.web.HttpMediaTypeNotSupportedException: Content type 'multipart/form-data;boundary=--------------------------423557816345430760392485;charset=UTF-8' not supported at org.springframework.web.servlet.mvc.method.annotation

  • RabbitMQ 在Spring Boot上的使用2022-07-18 22:02:47

      1.pom <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId>

  • 03-SpringAMQP入门2022-07-18 20:00:30

    三、SpringAMQP SpringAMQP是基于RabbitMQ封装的一套模板,并且还利用SpringBoot对其实现了自动装配,使用起来非常方便 SpringAMQP的官方地址 https://spring.io/projects/spring-amqp AMQP Spring AMQP SpringAMQP提供了三个功能 自动声明队列、交换机及其绑定关系 基于注

  • AJAX请求400,类型转换异常ConversionFailedException2022-07-18 14:34:26

    2022-07-18 问题:前端发送ajax请求,http响应码400,后端tomcat服务报ConversionFailedException: Failed to convert from type [java.lang. String] to type [java.util. Date] 原因:某个字段前端传递的类型是String,而后端接收的是Date类型,类型转换错误 解决: 方案一:在Controll

  • SpringBoot单元测试2022-07-18 14:03:52

    <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <scope>test</scope> </dependency> <dependenc

  • SpringBoot(12)使用控制器通知2022-07-18 00:03:04

    控制器通知   在编写代码时,需要对异常进行处理。进行异常处理的普通的代码是try-catch结构。但在开发业务时,只想关注业务正常的代码,对于catch语句中的捕获异常,希望交给异常捕获来处理,不单独在每个方法中编写。这样不仅可以减少冗余代码,还可以减少因忘记写catch而岀现错误的概率

  • @ConditionalOnMissingBean 如何实现覆盖第三方组件中的 Bean2022-07-16 22:33:09

    1. 自定义一个简单 spring-boot 组件 创建 olive-starter 项目 对应的 pom.xml文件如下 <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:/

  • SpringBoot中如何使用配置禁用swagger呢?2022-07-16 16:34:30

    转自: http://www.java265.com/JavaCourse/202204/2931.html SpringBoot:         Spring Boot是由Pivotal团队提供的全新框架,其设计目的是用来简化新Spring应用的初始搭建以及开发过程。该框架使用了特定的方式来进行配置,从而使开发人员不再需要定义样板化的配置。通过这种方

  • spring-gateway基于数据库 + nacos 的动态路由2022-07-16 09:33:10

    动态路由的实现方式多种多样,研究一下基于数据方式的动态路由。   1. 创建项目,并pom.xml文件引入如下依赖 <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.

  • SSM框架整合2022-07-15 22:00:24

    SSM项目整合 由于SpringMVC是Spring框架中的一个模块,所以SSM框架整合只需要进行Spring与Mybatis和SpringMVC和Mybatis之间的整合 1、导入依赖 <dependencies> <!-- 单元测试整合--> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId&g

  • 关于SSM的整合2022-07-15 15:04:21

    建表语句 -- ssmbuild.`USER` definition CREATE TABLE `USER` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, `name` varchar(100) CHARACTER SET latin1 DEFAULT NULL, `age` int(11) DEFAULT NULL, `birth` date DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB

  • Spring 中的事件机制2022-07-15 13:04:00

    目录前言观察者模式Java 中的事件机制Spring 中的事件机制SmartApplicationListener实现有序的监听Spring 对事件监听机制的注解支持异步事件的支持Spring中的事件机制分析总结 前言 说到事件机制,可能脑海中最先浮现的就是日常使用的各种 listener,listener去监听事件源,如果被监听

  • Spring Boot使用Undertow服务2022-07-14 11:02:29

    Undertow Undertow 是红帽公司开发的一款基于 NIO 的高性能 Web 嵌入式服务器 Untertow 的特点: 轻量级:它是一个 Web 服务器,但不像传统的 Web 服务器有容器概念,它由两个核心 Jar 包组成,加载一个 Web 应用可以小于 10MB 内存 Servlet3.1 支持:它提供了对 Servlet3.1 的支持 WebSocket

  • 记录一下我在ssm踩过的坑之:BeanCreationException: Error creating bean with name 'XXController': Inject2022-07-14 09:01:50

    先上报错信息 org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'deptController': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No q

  • 解决关于程序包org.springframework.XX不存在的问题2022-07-13 23:37:57

    出现的问题如图所示    解决方法   出现的问题可能项目导进来未设置maven运行时的jdk,重新运行后,OK问题已解决  

  • springboot文件下载2022-07-13 21:31:26

    1.创建springboot项目,结构如下:            2. 代码部分 import org.apache.tomcat.util.http.fileupload.IOUtils; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import javax.servlet.ServletOut

  • 1.SpringSecurity 基本原理2022-07-13 01:31:22

    1.SpringSecurity 本质是一个过滤器链: 从启动是可以获取到过滤器链: org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter org.springframework.security.web.context.SecurityContextPersistenceFilter org.springframework.security.web.h

  • IDEA - 创建springboot项目2022-07-12 11:32:00

    1. 创建新项目 刚开始也就点击新建项目 后面的页面都是一样的      2 创建 项目信息  最上面标注的URL 可能不是我这个  原始的下载速度满 需要修改为国内的镜像网站    http://start.aliyun.com       3.这里因为我们新建项目 不需要过多的东西所以首选  这一个就

  • springboot中的任务处理2022-07-12 10:35:09

    springboot中的任务处理 一.异步任务 在开发中有时用户提交的数据,后台需要一定时间才能做出响应,此时用户在前台也不能在等待中,此时就应该先开启异步请求处理,利用多线程,先给前台反馈,后台另一线程去处理数据。 1.创建异步处理请求 package com.springboot.assigment.service; imp

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有