In my application I’ve implemented X.509 authentication I created the following class named X509AuthenticationFilter that extends AbstractPreAuthenticatedProcessingFilter provided by spring security by default. I added my own AuthenticationManager to the class And also included the following setter The bean is initialized in the spring-security.xml like so: The bean named authenticationManager does exist and it’s present in the spring context. However,
Tag: spring
How can I change di job CRON expression in order to run my Spring Batch job twice a week?
in a Spring Batch application on which I am working on I scheduled a job in this way: This works fine and my job is runned every Sunday (day 7) at 01:30 of the night. Ok it is fine but now my client ask me to run it twice in a week (same time but in two different days). Is
What do spring.mvc.view.prefix and spring.mvc.view.suffix have to be?
I created a Spring Boot demo app with Maven using Spring Initializr (that’s my almost the very first usage of Spring). It works, but for some reason doesn’t show any pages besides index.html. If I’m right, that’s because of configuration in application.properties, but I just don’t know, what have I add there. My project’s sources structure: I tried to add
Nested entities contains null after save
I have an entity with some nested entities like this with entity2 and entity3 like this: Both Entity2 and Entity3 have values stored in the database so when I’m doing an insert on MyEntity, I’m doing this: it works fine, the data are stored correctly in the DB with the correct foreign keys BUT… After insert I want to build
Spring WebClient corrupts binary data
I’m sending files containing binary data from service A to service B. When the number of files is relatively small (let’s say 5) everything works well. However, when I try to send more files (let’s say several hundred) it sometimes fails. I tried to check what is happening with this binary data, and it looks like WebClient corrupts it in
BeanCreationException when creating Bean of type org.springframework.web.servlet.LocaleResolver
I’m trying to apply internationalization in a Spring Boot app by following some guide. For some reason, in the guide that I’m following it works but not on my local. I can’t figure out why. The error I am getting in console is : org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘localeResolver’ I am aware that when Spring creates a Bean,
Convert Java object to json string containing a json string property already
Consider a Java object like following: so when we do, I was expecting something like: instead I got it as a json value wrapped into a double quotes and skipped by backslashes as it was double jsonized – if this is actually a verb – Answer I managed to overcome this problem by using @JsonRawValue From documentation https://fasterxml.github.io/jackson-annotations/javadoc/2.5/com/fasterxml/jackson/annotation/JsonRawValue.html it states
Convert nested map fields to snake case
how to convert all the nested fields of the following object rendered as json to snake_case? Given it’s read as a org.bson.Document, jackson object mapper won’t work as it’s designed for POJOs and it’s not possible to have POJOs here as the records are schema-less Answer It can be easily done by adding a custom key serializer to SimpleModule, then
Endpoint overloading in Rest controller
I have a REST Controller in my Spring Boot application as follows: Upon trying to start the application, I get the following error: Upon changing the endpoints(in the getmapping part), this works perfectly. I fail to understand that since it does not recognise one with query param and one without as 2 separate points, then what is the possible fix
An “Error creating bean with name ‘functionBindingRegistrar'” exception every time I start my application
I have a normal spring cloud stream application that simple reads data from Kafka topic and produces messages to another Kafka topic, please find below the configurations: And the following application.proeprties And below is the signature of all defined spring cloud functions Everything works fine, and the application starts and functions as it should, however, in the logs I encounter