Skip to content
Advertisement

Tag: spring

Disable feign encoding of PathVariables

I have the following Feign Client: The items can contains special characters like : or :: which are being encoded. Request URL becomes something like: https://myservice.com/item/a%3Ab%3A%3Ac Rather than: https://myservice.com/item/a:b::c Can anyone help me understand how can we fix this issue? Answer OpenFeign has an issue tracking: https://github.com/OpenFeign/feign/issues/1190 Guess it will be implemented by spring-cloud-feign once its done. Meanwhile, my workaround

How can I fix NoClassDefFoundError when using Spring framework’s WebSocketClient

I am writing a desktop Java application as a web service client. I want to use WebSocket to implement notification “callback” from the server. I am using the Spring framework’s WebSocketStompClient. Below snippet shows how I initialize it: It works perfectly if I run it in IntelliJ IDE, however, if I run by command line “java -cp my.jar MyPackage.MyMainClass”, it

Error processing condition on org.springframework.boot.actuate.autoconfigure.metrics.MetricsEndpointAutoConfiguration

I am a novice Java Spring programmer. I am moving some test code from an older jHipster project to a new one. I added this to the pom.xml to fix a compilation error. This fixed my compilation issue but caused runtime errors. I am now getting these runtime errors. Caused by: java.lang.IllegalStateException: Error processing condition on org.springframework.boot.actuate.autoconfigure.metrics.MetricsEndpointAutoConfiguration Caused by: java.lang.IllegalArgumentException:

How to use blocking queue in Spring Boot?

I am trying to use BlockingQueue inside Spring Boot. My design was like this: user submit request via a controller and controller in turn puts some objects onto a blocking queue. After that the consumer should be able to take the objects and process further. I have used Asnyc, ThreadPool and EventListener. However with my code below I found consumer

package org.springframework.cloud.netflix.zuul does not exist

I am moving some test code from an older jHipster project to a new one. The old project uses the org.springframework.cloud.netflix.zuul library, specifically org.springframework.cloud:spring-cloud-netflix-core:1.3.0.RELEASE . I put the below in my new project’s pom.xml: However, it seems to be pulling in org.springframework.boot:spring-boot:2.2.5.RELEASE. This release does not contain zuul in it however, as this code fails import org.springframework.cloud.netflix.zuul. Does anyone know

Dynamic search term SQL query with Spring JPA or QueryDSL

I am trying to learn QueryDSL in order to return the results of a single search term from Postgres: But I also want to search for any number of search terms, for example, say this is my list of search terms divided by the plus symbol: How can I dynamically create contains(params[0]) AND/OR contains(params[1] AND/OR … contains(params[n]) using either QueryDSL

JPA @PreUpdate @Persist seems not working as expected

I have a problem for filling auditing fields by using @PreUpdate and @PrePersist. For instance When I’d like to update a client entity, the field updatedBy and updatedAt are still null; despite when I debug, the code of preUpdate() which is annotated with @PreUpdate is executed. Below the code of AuditingField which is responsible for creating/updating the auditing fields in

Advertisement