Category "spring"

Why method print() of my class CustomDateFormatter using with my custom spring annotation is never called?

I have a issue with creation of custom annotation in springboot application: I've got a form with few fields with datepicker. Dates must have to be parsed in 2

Spring error "Bean named 'x' is expected to be of type 'y', but was actually of type [com.sun.proxy.$Proxy]"

I am trying to implement a DAO based authentication in an application using Spring Security. When I tried to log in to the application with a user I got this er

Constructor parameter in configuration class required a bean of type 'StratusAuthenticationEntryPoint' that could not be found

Parameter 0 of constructor in ResourceServerConfiguration required a bean of type 'StratusAuthenticationEntryPoint' that could not be found. I am using spring b

Spring boot WebSecurityConfigurerAdapter basic authentication user password validation issue

I'm writing a simple REST API using Spring Boot and I want to enable basic authentication. Therefore I have used the WebSecurityConfigurerAdapter as shown below

bean creation error when starting spring boot application

When i try to run my spring boot application i get this Exception: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'conf

A way to update multiple records together?

I am trying to see if there is a way to improve the way data is inserted and updated. I am using ORACLE DB with JDBC. The current way i'm doing is to update (e.

Spring cloud config server ssh to bitbucket problem

I'm trying to get the spring cloud config server connected to a bitbucket repo using ssh. I've found lots of posts about the key needing to be rsa format. I'v

Forwarding message to Message Channel manually - Spring Integration

Am able to send the message successfully using the below from my FirstHandler messageChannel.send(MessageBuilder.withPayload(pa).build()); But, the flow is wait

Running Cucumber in Springboot with Maven in executable JAR

Hello fellow engineers! I have run into a problem when trying to create a FAT jar to execute the Cucumber tests. Initially, I have followed the guide to set up

SAX Feature Not Supported in Spring Boot 2.6.1

Spring boot 2.6.1 supports logback 1.2.7 I've added the following dependencies in project <dependency> <groupId>ch.qos.logback&l

Spring AMQP - RabbitMQ connection is not created on application startup

I have a Spring Boot application and my goal is to declare queues, exchanges, and bindings on application startup. The application will produce messages to vari

How to properly use JPA/Hibernate?

I'm trying to understand annotations better with JPA / Hibernate and SQL Server. I created a simple project: an abstract class named "Articles". Two classes inh

spring security authorization error 401 unauthorized

I'm new to spring security and I am trying to create a web application with Jwt Token the problem is that i cant authenticate it always give me 401 error with i

Convert ByteArray to Base64 in Kotlin

I am trying to convert a ByteArray to Base64 in a Spring project, written in Kotlin. I have checked existing posts but they didnt help me. Actually I am trying

Mockito mockStatic cannot resolve symbol

I'm using Spring Boot and in a unit test, I'm trying to mock the Files.delete(myFile.toPath()) method. To do so I'm trying to use the Mockito.mockStatic() metho

Implement own in memory cache mechanism in spring boot

I was asked to implement an in memory cache mechanism in my spring boot application. My application is related to social media. User can register and login User

How to set a variable for Controller from HttpInterceptor? [closed]

I am building a Spring Boot application. I like to set a variable for the Spring Boot application. This variable should be set in an HTTP inte

Is there a better way of writing native SQL query with EntityManager Java Spring Boot application?

My current code look like this. I am not using any ORM framework like Hibernate. I need to use this raw SQL query. public List<String> getEndcodedKeyByLen

Post request with content type application/x-www-form-urlencoded not working in Spring

I'm using OpenAPI generator to generate Spring REST APIs. Here is a fragment: openapi: 3.0.2 info: version: 1.0.0 title: Auth paths: '/auth/v1/token':

Spring jar can't see resources

I have Spring Boot web app which work on IntelliJ. I build jar file from maven. Jar starts but css, js and img "blocked" in Chrome console show error 404, Firef