Skip to main content
Filter by
Sorted by
Tagged with
1118 votes
65 answers
1.2m views

How do I configure the TCP/IP port listened on by a Spring Boot application, so it does not use the default port of 8080.
Paul Verest's user avatar
  • 64.7k
555 votes
25 answers
744k views

I want to log SQL statements to a file. I have the following properties in application.properties: spring.datasource.url=... spring.datasource.username=user spring.datasource.password=1234 spring....
Oleg Pavliv's user avatar
  • 21.3k
460 votes
20 answers
554k views

I want to run code after my spring-boot app starts to monitor a directory for changes. I have tried running a new thread but the @Autowired services have not been set at that point. I have been ...
stewsters's user avatar
  • 4,775
395 votes
17 answers
488k views

After upgrading to JDK 21, I have the following compilation error in my Spring Boot project: Fatal error compiling: java.lang.NoSuchFieldError: Class com.sun.tools.javac.tree.JCTree$JCImport does not ...
Honza Zidek's user avatar
  • 21.7k
389 votes
55 answers
1.3m views

I am working on a Spring Boot Batch example with MongoDB and I have already started the mongod server. When I launch my application, I am getting the error below. Any pointers for this issue? ******...
Jeff Cook's user avatar
  • 9,024
358 votes
11 answers
621k views

How can I configure and use two data sources? For example, here is what I have for the first data source: application.properties #first db spring.datasource.url = [url] spring.datasource.username = [...
juventus's user avatar
  • 3,582
337 votes
20 answers
633k views

I have 5 environments: - local (my development machine) - dev - qc - uat - live - staging I want different application properties to be used for each environment, so I have the following ...
dleerob's user avatar
  • 5,451
315 votes
22 answers
537k views

I'm wondering what the best way to load initial database data before the application starts? What I'm looking for is something that will fill my H2 database with data. For example, I have a domain ...
Lithicas's user avatar
  • 4,053
300 votes
34 answers
674k views

I use Spring boot+JPA and having a problem while starting the service. Caused by: java.lang.IllegalArgumentException: Not an managed type: class com.nervytech.dialer.domain.PhoneSettings at org....
user1578872's user avatar
  • 9,268
293 votes
29 answers
447k views

Is there any annotation for a Filter class (for web applications) in Spring Boot? Perhaps @Filter? I want to add a custom filter in my project. The Spring Boot Reference Guide mentioned about ...
janetsmith's user avatar
  • 8,740
284 votes
4 answers
188k views

When creating tests and mocking dependencies, what is the difference between these three approaches? @MockBean: @MockBean MyService myservice; @Mock: @Mock MyService myservice; Mockito.mock() ...
Doug's user avatar
  • 6,535
251 votes
55 answers
992k views

I am getting the following error: *************************** APPLICATION FAILED TO START *************************** Description: Parameter 0 of method setApplicant in webService.controller....
Mike3355's user avatar
  • 12.2k
242 votes
36 answers
626k views

This is the error that is thrown when trying to run my web app: [INFO] WARNING: Nested in org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework....
quarks's user avatar
  • 35.7k
241 votes
16 answers
308k views

I'm trying to run a simple Junit test to see if my CrudRepositories are indeed working. The error I keep getting is: Unable to find a @SpringBootConfiguration, you need to use @ContextConfiguration ...
Thomas Billet's user avatar
228 votes
28 answers
330k views

I can't get my Spring Boot project to serve static content. I've placed a folder named static under src/main/resources. Inside it, I have a folder named images. When I package the app and run it, it ...
Vinicius Carvalho's user avatar
219 votes
11 answers
244k views

Execution default of goal org.springframework.boot:spring-boot-maven-plugin:1.0.1.RELEASE:repackage failed: Unable to find a single main class from the following candidates My project has more than ...
Thilo's user avatar
  • 264k
215 votes
25 answers
418k views

I am getting this exception java.lang.NoClassDefFoundError: Could not initialize class org.codehaus.groovy.vmplugin.v7.Java7 and java.lang.NoClassDefFoundError: Could not initialize class org....
user3365200's user avatar
  • 2,311
211 votes
13 answers
328k views

I am using Spring Boot to develop two applications, one serves as the server and other one is a client app. However, both of them are the same app that function differently based on the active profile....
yuva's user avatar
  • 3,378
205 votes
11 answers
379k views

When I deploy my Spring application via Spring Boot and access localhost:8080 I have to authenticate, but what is the username and password or how can I set it? I tried to add this to my tomcat-users ...
Gustavo's user avatar
  • 3,821
202 votes
4 answers
212k views

I'm a little bit confused about Filter and Interceptor purposes. As I understood from docs, Interceptor is run between requests. On the other hand Filter is run before rendering view, but after ...
rpieniazek's user avatar
  • 2,380
199 votes
9 answers
289k views

I am getting below exception while running Spring Boot application during start up: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'testController': Injection ...
Khuzi's user avatar
  • 2,922
196 votes
5 answers
239k views

I tried using env variables in my application.yml configration like: spring: main: show_banner: false --- spring: profiles: production server: address: $OPENSHIFT_DIY_IP port: $...
Marcel Overdijk's user avatar
186 votes
16 answers
261k views

I have a Spring Boot application with dependency spring-boot-starter-data-jpa. My entity class has a column annotation with a column name. For example: @Column(name="TestName") private ...
Kamil's user avatar
  • 2,318
184 votes
12 answers
177k views

I have a Spring Boot application. I've added a lot of dependencies (unfortunately, looks I need all of them) and the startup time went up quite a lot. Just doing a SpringApplication.run(source, args) ...
steady rain's user avatar
  • 2,336
183 votes
29 answers
450k views

I am trying to adapt the REST Controller example on the Spring Boot website. Unfortunately I've got the following error when I am trying to access the localhost:8080/item URL. { "timestamp": ...
mchlfchr's user avatar
  • 4,318

1
2 3 4 5
3014