I’m trying to use Apache Spark/Ignite integration in Azure Databricks. I install the org.apache.ignite:ignite-spark-2.4:2.9.0 maven library using the Databricks UI. And I have an error while accessing my ignite cahces: Here the AbstractApplicationContext is compiled with ReflectionUtils of different spr…
Tag: spring
FilterRegistrationBean url pattern doesn’t work
I am registering a filter as shown below For log output i want url pattern : /*/api/* Answer Since the code registers a Servlet Filter, the URL pattern must conform to the URL mappings supported by Servlets/Filters, as specified in the Servlet Specification: 12.2 Specification of Mappings In the Web applicati…
How to put YML value inside the @Pattern(regexp = “HELLO|WORLD”)
I want to move the “HELLO|WORLD” value to the YML file. Then call the value from YML file inside the regexp. For example, Following is the YAML file YML FILE Java class to get the YAML value Java class that use regex validation Instead of a string, I want to do something similar to this. I have al…
How to create a generic wrapper for just any method call?
I want to create a helper method that can wrap/convert just any sync method call into an async Mono. The following is close, but shows an error: This is my code: Answer First you call Mono.fromCallable with a Callable<Callable<? extend T>>. You need to change the call like this: Mono.fromCallable(…
Spring Data JPA Distinct Returning Duplicate Values
In my Spring boot application I have a query which should return a distinct List of Focus’ (works perfectly in MySQL) However this does not return distinct values, duplicates are contained in the resulting list. Another issue is that I can’t return a whole entity using @Query annotation – ch…
Add database authentication to Spring Data Rest application
I’m creating an application using Spring Data REST with Thymeleaf. Initially I created my models, controllers, dao and services. All worked fine. I’m now trying to add security to my application. Right now I’m just focused on the login/logout. I’ve been able to create an in memory auth…
Choose Controller Bean instance by RequestMapping
I want Spring to create 2 instances of FooController. Requests to /foo should be handled by one of the instances and requests to /bar should be handled by the other instance. I want something like the …
org.mapstruct don’t work with a base class
I have 2 classes. My base class: And my other class. This class extends BaseRequest class. And When I try create a mapper to cast my AddClass to OtherClass: When I run my build I received this error: Error:(22,13) java: No property named “dateTransaction” exists in source parameter(s). Did you mea…
Solr synonym.txt adding at elasticsearch
I have already a working synonym.txt in solr. Now I want to add that same txt file at elasticseach. What can I do for it. At solr it was easy, I just keep that file in system. At elsticsearch I added …
Spring Security returns 403 instead of 401 and creates invalid Redis session cookie
I’m using Spring Security and Spring Data Redis to keep track of user sessions with custom roles and entitlements. When I try to hit a PreAuthorized endpoint without a session cookie in my browser, it should return a 401. Instead a new (invalid) session cookie is created and the endpoint returns a 403. …