Category "spring"

Not-null property references a transient value - transient instance must be saved before current operation

I have 2 domain models and one Spring REST Controller like below: @Entity public class Customer{ @Id private Long id; @OneToOne(fetch = FetchType.EAGER) @Joi

Spring , How to have Swagger UI send a request without Hypertext Transfer Protocol

Is there a possibility to instruct Swagger not to send the Hypertext Transfer Protocol (http) in front of a POST or GET request ? As you can see on the screens

Get org.hibernate.LazyInitializationException in spring boot integration test

I'm trying to write integration test for Spring Boot application. I have Product and GalleryImage domain model. They are in one-to-many relationship. public cl

Using @Qualifier and @Bean together in Java Config Spring

I have follow code interface Drivable { } @Component class Bmw implements Drivable { } @Component class Mercedes implements Drivable { } class Driver {

How to disable DefaultSecurityFilterChain in a Spring Boot app?

In my Spring Boot application, I have: @Configuration @EnableWebSecurity public class WebSecurityConfig extends WebSecurityConfigurerAdapter { ... @Ove

How does SecurityContextHolder.getContext().getAuthentication() work?

SecurityContextHolder.getContext().getAuthentication() obtains the currently authenticated principal, or an authentication request token, but in which context s

Fundamentals.How can you use Lazy fetching in Spring+Hibernate+=Vaadin after the session closes

There is the Customer entity which has a one to many relationship to entity Address,so there is a List<Address> getAddress in Customer.Entity Address has

Spring boot security, always redirects to login page, if navigate through address bar

I have a react project, and the security works fine untill I navigate within page - i.e. clicking buttons etc. But, if I refresh page, or input url directly int

Cannot Add Http Headers to Message with Spring's WebServiceTemplate

I have a fairly simple case where I am trying to add HTTP headers (not SOAP headers) to a request I am making using Spring's WebServiceTemplate. I have defined

Setting logback property via spring config + environment variable in spring config

I want to configure logback in such way that some specific appender will work only if system variable LOGGER_ENABLED is set to true. If the variable is not set

Test a method that use a spring service

I have a problem testing a method in Java (I use jUnit 4) and this method to test make a call to a repository and should throw an exception if something is wron

Error java.lang.AssertionError: expected: null<null> but was: java.lang.String<null> what does it mean?

I have this strange issue in my Junit 4.12 test code. The application uses Spring Framework 4.1.6 and Hibernate 4. When comparing two beans coming from differen

Mockito when() method not working and getting null pointer exception

I am writing unit test cases using Mockito and JUnit . But getting NullPointerException when running a test. On debugging I get to know that Mockito on method:

Spring data repository not found at compile time

I am trying to use Spring data and repositories in a Spring Boot application, but I have an error when compiling the project. Here is my Entity : package fr.i

Spring Boot SSH Mysql?

I can successfully connect to my openshift mysql through workbench, how do I do the same through my spring boot application? in my application.properties: # C

Spring Batch Framework - Auto create Batch Table

I just created a batch job using Spring Batch framework, but I don't have Database privileges to run CREATE SQL. When I try to run the batch job I hit the error

HTTP status 404 - Not Found while creating springBoot Application

This a springboot Application. It run perfectly but did not get output (it shows me HTTP Status 404 error in browser) pom.xml <project xmlns="http://maven.

Maven is not using Java 11 - Fatal error compiling: invalid target release: 11

I am trying to compile my project with Java 11. When I try to run the application with Java 8 as the Java version in pom.xml, it works fine. But when I try to r

Why Getting NoClassDefFound error for JedisConnection when using Spring Redis

Hello when trying to use spring-redis i am getting java.lang.NoClassDefFoundError: Could not initialize class org.springframework.data.redis.connection.jedis.

How to change spring session (redis) cookie name?

We have two projects behind same domain ( zuul proxy in front of them ), both uses spring session project with sessions kept in redis. Those two sessions shou