Category "spring"

Can't figure out how to change Prometheus content type header

So my metrics all appear in one line at my end-point, not in new line per metric. I use micrometer, spring, prometheus and scala. My controller: @RequestMapping

Spring batch: How to output list as output for RepositoryItemReader

Hi I have a use case where I should read data from DB and try to combine rows. For example I have one order and many orderDetails. The output of my SQL Query is

How can we assign a field of user table say id that is primary key, to another table as a primary key? using hibernate

See I dont want any mapping but what I want is just a simple thing that is.... I have two Entity Tasks(taskid,taskname.....,userId) User_Credentials(userId,pass

Spring: Not-null property references a null or transient value

I have an entity(Car) and i want to add records belong this entity with postman. My entity has one relational connection with User entity. When i want to add a

required a bean of type 'org.springframework.cloud.netflix.ribbon.SpringClientFactory' that could not be found

I have this test project which I would like to migrate to more recent version: @Configuration public class LoadbalancerConfig extends RibbonLoadBalancerClient

Spring Repository query by multi-valued property

Trying to solve a problem where I have a class Student. public class Student { @Id UUID id; String name; Long year; List<Attribute> at

Rest API response as XML format, calling from Spring Boot with Resttemplate

I have created Rest API using Spring Boot & Data JPA. It's working fine if requested from Postman responds as JSON format, but when I request from coding us

useAbstractionForFiles OpenAPI WebClient not working

I am using OpenAPI generator (Gradle plugin version 5.4.0) to generate a few API calls. One of said calls, revolves a file download from an external service i.e

How to register a ApplicationEnvironmentPreparedEvent in Spring Test

I have a @SpringBootTest and I need to notified via ApplicationEnvironmentPreparedEvent to create a database file if it not exists, because my application datab

Spring Cloud Contract with Wiremock - how to choose Scenario manually?

Im working in a project using Spring Cloud Contract and Wiremock to create integration tests. Everything was fine until we need to add multiple responses to the

Pass custom parameter to ConstraintValidator

I'm working on this springboot application where I need to do some validations on values passed from http call and I'm using class level validation as explained

Using Rate Limiting doesn't add Header to response and gets CORS error in client

I'm trying to adapt this tutorial to my server using the Bucket4j Spring Boot Starter. I'm using an application.properties file. I can limit the api queries wit

Hibernate produces broken query

I have an entity that is mapped to the database table by Hibernate: @Entity @NoArgsConstructor @Getter @Setter @FieldNameConstants public class Set extends Abs

package org.springframework.beans.factory does not exist error

I try to implement a simple hello world program using Spring framework. I have tried the following example in Windows environment without using IDE. In Eclipse

Creating a configurable JUnit library to test same features across several microservices

A set of tests should be run on every microservice. Current solution is to have an abstract class and extend in every service, providing the necessary propertie

Why Spring @Autowired doesn't work in abstract class?

I am doing this way in abstract class @Autowired lateinit var fileContract: FileContract with error kotlin.UninitializedPropertyAccessException: lateinit prop

Custom message for Type Mismatch validation error while using Spring Boot and Hibernate Validator

Controller public String dummyAction(@Valid @ModelAttribute DummyInputData inputData) { return "success"; } Entity public class DummyInputData {

Can we implement a Java library by using Java Frameworks like Guice or Spring?

I am creating a new java library and will make the package as a jar file and have another JAVA application that can use it in terms of a JAVA library. So, is it

How to override custom Jackson deserializer in child project?

In our company library (say lib-a) we have an interface: public interface MyInterface { ... } and its default implementation: public enum DefaultMyImpl imp

Optional fields in Java DTO with validation constraint

I've created a DTO with some properties with validation constraint (like all the properties must be present in JSON Object). Now, I want to make that DTO in a w