spring Questions

10

I am trying set Spring Cloud Config Server, but the service config server, it the running on port 8888 which is correct, and another service should run on port 18060, but for reason when I startup,...
Zebrawood asked 17/5, 2017 at 2:39

8

I am trying to build a web application, I didn't add any classes or packages I have just ran the app but it says java.lang.NullPointerException: Cannot invoke "org.hibernate.engine.jdbc.spi.Sq...
Forerunner asked 1/11, 2023 at 22:30

2

Solved

I have a Spring Security version 3.2.3 application that listens to both HTTP and HTTPS. I want any request to the HTTP port to be redirected to HTTPS. How do I configure that using Java only? Spri...

3

I am fighting trough one day with one problem. So Lets get started. I have 3 classes like tags, offers and animals @Data @Builder @AllArgsConstructor @NoArgsConstructor @Entity @Table(name = "anim...
Lichenin asked 18/1, 2019 at 12:39

2

Solved

As stated in the Spring Boot 3 Migration Guide the server.max-http-header-size property has been deprecated. You can use the server.max-http-request-header-size property to set the max http request...
Achondroplasia asked 15/2, 2023 at 13:32

3

Solved

I have an issue with loading data into an in-memory database on application initialization. I have created schema.sql and data.sql files containing table structure and initial data. schema.sql : ...
Potiche asked 24/1, 2017 at 23:55

3

Solved

I am upgrading my project from springboot 2.7.7 to springboot 3.1.1 and java 11 to 17 I have spring-boot-starter-mail included as a dependency and I try to send mail as follows @Service public clas...
Terenceterencio asked 3/7, 2023 at 2:1

4

Solved

I've just added Spring Security to my project. I've also added this configuration: @Configuration @EnableWebSecurity public class WebSecurityConfig extends WebSecurityConfigurerAdapter { @Overri...
Woehick asked 12/5, 2020 at 20:40

4

I'm having trouble setting null as a property value. This is how the value is defined in YAML file: my-property: null This is how I inject it in code: @Value("${my-property}") private St...
Discover asked 23/11, 2020 at 18:53

2

How can you specify a defaultValue when mapping a DTO using MapStruct? The following constructs did not work @Mapping(target = "used", defaultValue = "0") MyDTO toDto(MyEntity entity); @Mapping(t...
Glossitis asked 26/12, 2019 at 6:19

4

Solved

Requirements: Spring Boot application with Springfox Add BASIC authentication to Swagger Pass on all other requests Code: implemented @EnableWebSecurity @Configuration public class SecurityCo...
Paulita asked 25/4, 2018 at 14:2

1

Solved

I have a WebClient configured as below. In main runtime, webClient is used in a kafka listener started thread. So out of http servlet context. And it is failing as I noticed we should use Authorize...
Berner asked 2/8, 2024 at 13:42

1

The Spring doc states @RequestParam relies on type conversion via a registered Converter or PropertyEditor while @RequestPart relies on HttpMessageConverters taking into consideration the 'Content-...
Etheline asked 28/8, 2022 at 18:45

3

Some times interfaces are annotated with @Component annotation. Then my obvious reasoning was that classes that implement such interface will be treated as components as well. But if I am right tha...

3

Solved

In Spring 3.3 I have an entity which is mapped to a database table. In this entity class I have all properies annotated with @JsonProperty, for instance @JsonProperty("ID"). Stepping into the cont...
Lookthrough asked 25/9, 2013 at 20:7

5

I am fetching the byte array using Spring Framework RestTemplate. But I also need to fetch the media type of the fetched result. The media type of this byte array can be of any type. The code used ...
Shadoof asked 4/11, 2016 at 16:1

6

Solved

I'm currently working on a Spring MVC application and I need to add a custom field to my Spring Security log-in user right when I log in (I insert username, password, custom value). This value need...
Thorn asked 20/1, 2017 at 18:27

8

Solved

I'm trying to use SpringFox. Spring Boot version: 'org.springframework.boot:3.0.0-SNAPSHOT' build.gradle dependencies { ... implementation 'io.springfox:springfox-petstore:2.10.5' implementation ...
Raffo asked 20/3, 2022 at 18:42

6

I use AbstractRoutingDataSource to change data source dynamically and ThreadLocal to set up currentLookupKey. It works nice when I use only one data source per http request. I use JpaRepository @C...
Uzia asked 1/6, 2016 at 6:42

6

Solved

I am trying to use QueryDSL in my eclipse maven project. These are the dependencies. <properties> <!-- The main class to start by executing java -jar --> <start-class>my.app.ma...
Carrier asked 21/8, 2017 at 9:49

11

Solved

I have Spring Cloud gateway running on separate server with the following configuration: spring: cloud: gateway: globalcors: cors-configurations: '[/*]': (I also tried '[/**]':) allowedOrigin...
Foreandaft asked 3/1, 2022 at 3:58

8

Solved

I am having the property file with the following values. I want to read all the properties with same prefix excluding others using spring mvc. test.cat=cat test.dog=dog test.cow=cow birds=eagle ...
Gazette asked 18/12, 2017 at 17:6

4

I have a custom repository declared like below(written in Kotlin): interface FooRepository : JpaRepository<Foo, Int> { fun findByFoo(foo: String): List<Foo> fun findByBar(bar: String...
Burdock asked 5/4, 2022 at 7:18

3

Solved

We are using the org.apache.commons.dbcp.BasicDataSource as parent class for our datasources in Spring. Is it possible to specify which schema to use in either the "url" or in another property in ...
Shogun asked 1/4, 2011 at 6:24

4

Solved

I'm using spring-boot with WebClient, which is autowired as a bean. Problem: when writing a junit integration test, I have to use okhttp MockWebServer. This mock always starts up on a random port,...
Cashier asked 24/7, 2019 at 15:55

© 2022 - 2025 — McMap. All rights reserved.