Skip to content
Advertisement

Tag: spring-boot

Using Spring Boot without Maven

I am trying to write a simple Java program that displays Hello World as a microservice. I am using Spring Boot, but due to security reasons at my company, I am unable to use Maven. Therefore, I have no option but to download the jar files and add them to my project. I have done so, and made sure I

How to handle UsernameNotFoundException spring security

How to handle UsernameNotFoundException ? In spring security when username not found the UserDetailsService implementation throws a UsernameNotFoundException. For example like this: I would like to build a custom “User not found REST response”. How should I catch/handle this exception? I have implemented a handler method in the WebSecurityConfigurerAdapter implementation the handler: But this method should wait for an AuthenticationException

Why is Log4j2 not logging inside Spring Boot Application?

I’m trying to use spring boot starter and spring boot starter web. So far I’ve got what I think is a pretty simple set up. I can see that the application is obviously finding and using the log4j2-spring.xml file so my question is why doesn’t anything from the MyRunner class log via log4j2? It does execute and the System.out.println() statements

How to use Criteria in JPA in Spring boot?

I am using JPA and spring boot. I am new to JPA. I want to retrieve an object by passing the value of the function. But in example, it is done through hibernate config. I have not config sessionFactory bean in my classpath. I want to use JPA to retrieve the object. Here in the example, it is: But I

SpringBoot 2.2.1 groovyMarkupConfigurer exception

I have a SpringBoot application that was developed with JDK8 and was now ported to JDK11. I get the following exception at startup: Here is my pom.xml: I have tried SpringWebStarter from 2.1.8 up to 2.2.1, I am always getting the same error. I cannot use JDK8 again, since the computer has been updated from Windows 7 to Windows 10

Setting up properly SonarQube for Code Coverage

I’m using JUnit5 on a SpringBoot backend application server using Maven. Here is the sonar-project.properties file that is at the root of the project: I use the sonar-scanner command line to run update the project after a build/test. The Overview board on sonar-cloud looks like this: I at least got the unit tests to be recognized, but somehow I’m still

Primary key values are getting updated in Spring boot

I have created a maven project using Spring Boot with MySQL database. I have two entity classes that have a primary key in one entity class and another one has a composite primary key. Customer.java(Has a primary key) ItemId.java (Idclass for Item.java) Item.java (Has a composite primary key) here the problem is when an entity object is persisted through repository

Advertisement