spring-boot

FCM and self-certificate issue (reopen)

主宰稳场 提交于 2021-02-11 14:49:13
问题 I'm using FCM to send a notification, my code works well when I use HTTP. The issue happened when I enable SSL using self-certificate, I cannot call subscribe/unsubscribe to/from a topic on FCM with error UNKOWN code. Any idea this issues please help I'm trying to debug so I can get access-token but cannot call sub/unsubscribe This is the request to get access-token 2020-12-02T16:06:24.192Z|2|INFO|fcm-demo|c5230eb4f07f582a,9b72559f0d3b8e39,true,|9|task-2|com.google.api.client.http

spring boot : how to set db2 encryption password for column value encryption

时光总嘲笑我的痴心妄想 提交于 2021-02-11 14:49:07
问题 I want to set db2 encryption password command when spring boot starts a connection with my db2. Basically some of the columns in my table are encrypted. I tried hibernate mapper @ColumnTransformer(read="decrypt_char(COLUMN_NAME,'password')",write="encrypt(?,'password')"). That does not work. After some look around I found that I have to set the encryption password with the following command when the database connection is established from spring boot application properties file. SET

An attempt was made to call a method that does not exist. STS

假装没事ソ 提交于 2021-02-11 14:44:11
问题 When i run the STS(SpringBoot) application i get the below error: The attempt was made from the following location: org.apache.catalina.authenticator.AuthenticatorBase.startInternal(AuthenticatorBase.java:1321) The following method did not exist: javax.servlet.ServletContext.getVirtualServerName()Ljava/lang/String; The method's class, javax.servlet.ServletContext, is available from the following locations: jar:file:/home/talha/.m2/repository/javax/servlet/servlet-api/2.5/servlet-api-2.5.jar!

Field todoService in com.springboot.todoController.TodoController required a bean of type 'com.springboot.todo.TodoService' that could not be found

試著忘記壹切 提交于 2021-02-11 14:41:40
问题 I am a new beginner in Spring boot...I encounter a problem When I run my controller, Description: Field todoService in com.springboot.todoController.TodoController required a bean of type 'com.springboot.todo.TodoService' that could not be found. Action: Consider defining a bean of type 'com.springboot.todo.TodoService' in your configuration. below is my code Todo.java package com.springboot.todoBean; import java.util.Date; public class Todo { private int id; private String user; private

How to collect and get connection pool statistics using jetty and spring boot?

时光总嘲笑我的痴心妄想 提交于 2021-02-11 14:39:46
问题 I'm developing simple Spring Boot web application with embedded Jetty server. I'd like to have some statistics on connection pool usage (i.e. how many threads, avg request time. avg queue wait time, queue size etc.) I realized that Spring Boot configures Jetty with QueuedThreadPool which has few basic metrics. Is there more sophisticated bean or module designated for statistics collecting in Spring Boot? How to enable it? 回答1: Have you had a look at Spring boot actuator? It provides you with

Spring Security Pages don't open in Iframe on Chrome

痴心易碎 提交于 2021-02-11 14:19:40
问题 I am using SpringBoot,springsecurity and jdk 1.8. When I am trying to open any secured thymleaf page in iframe on Chrome, then it is rediecting me to login page every time. It is working fine on firefox and IE. And When I try to open the same URL without iframe, it is working fine. I have already given much time to solve ,but could solve it. Below are my spring security conf file code. One more thing both domains are different. @Override protected void configure(HttpSecurity http) throws

Spring @Conditional based on a value in database table

╄→гoц情女王★ 提交于 2021-02-11 14:15:54
问题 Condition evaluation depends on a value provided in data base table @Component public class XYZCondition implements Condition{ @Override public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata) { //based on value defined in DB should return true/false } } As Condition is executing very early, unable to fetch db value is there any alternate way to achieve this ? 回答1: Database values can be changed during application work, while it doesn't seem a good idea to reload

How to create a working TCP Server socket in spring boot and how to handle the incoming message?

佐手、 提交于 2021-02-11 14:14:24
问题 I have tried to implement a TCP server socket with spring integration in an allready existing spring boot application, but I am facing a problem and this problem drives me crazy... The client is sending a message (a byte array) to the server and timesout. That's it. I am not receiving any exceptions from the server. It seems I have provided the wrong port or somthing but after checking the port, I am sure it is the right one. This is my annotation based configuration class: import home.brew

OpenID (OAuth2) Authorization failing using Spring Boot and Spring Security

偶尔善良 提交于 2021-02-11 14:10:42
问题 I'm using authorization of OAUTH2 using Spring Security and Spring boot and getting the following error: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'OAuth2LoginSecurityConfig': Unsatisfied dependency expressed through method 'setContentNegotationStrategy' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.springframework.boot.autoconfigure.web.servlet

Downloading byte array from Spring Boot to Vue frontend

家住魔仙堡 提交于 2021-02-11 14:02:31
问题 I have the following functions, I am trying to read a string from my MongoDB database which is an image decode it and send it to my Vue frontend to be downloaded. @GetMapping(path = "/signature/{signatureId}", produces = MediaType.IMAGE_PNG_VALUE) public byte[] downloadSignature(String signatureId) { Signature signature = routeRepository.findBySignature(signature); byte[] bytes = Base64.getDecoder().decode(signature.getSignature().getBytes(StandardCharsets.UTF_8)); // This try-catch just