Questions tagged [spring-boot]

Spring Boot makes it easy to create Spring-powered, production-grade applications and services with the absolute minimum fuss. It takes an opinionated view of the Spring platform so that new and existing users can quickly get to the bits they need.

0
votes
0answers
9 views

Job Failing on small chunk size

I have job where I am reading data from table 1 and inserting those data to table 2 after processing/validating the data. (Validation includes not nullable for one field (say field1)in main table.). I ...
0
votes
0answers
7 views

Is there a way to load-balance the eureka server (spring boot)

We are using spring boot with eureka for service discovery. Need to understand that Can we use multiple instance of spring boot eureka server behind the load balancer?
0
votes
0answers
6 views

AbstractMethodError: org.apache.bval.jsr303.ConfigurationImpl has missing definition for method getDefaultParameterNameProvider()

I am currently working on upgrading our Spring Boot (2.1.5) Application to gradle version '5.4.1' with JAVA 11. org.springframework.beans.factory.BeanCreationException: Error creating bean with name '...
-1
votes
0answers
9 views

Managing the .war folder structure

I want to deploy my application on Liberty server. On the server I deploy the .war file. As I understand, for security resons server cannot read the files in the static folder of the project that is ...
-1
votes
0answers
11 views

Better Way Putting Indexing Logic in Spring Java Code

I came across @Indexed annotation, which I think is very messy and complicates code. Whenever you want to change indexing, you would deal with code. Why do we use this? Shouldn't we maintain an ...
0
votes
0answers
8 views

@CacheEvict in Spring Boot is not deleting Cache in Redis

I am caching CRUD requests in Spring Boot using @Cacheable annotations. I Cache using Redis. The caching is done successfully. When I insert a new item or update an existing item I want to Evict or ...
0
votes
0answers
16 views

what is the problem with hibernate entity manager remove function doesn't throw exception and not working?

I need to remove an entity with entity manager by remove function but it doesn't remove the entity, however, doesn't throw an exception and the entity exists. @Transactional @Override public void ...
1
vote
0answers
7 views

How to configure DataSource for a Spring-Boot Application in a Standalone (war) and in an embedded Tomcat?

I have a Spring-Boot-Aplication with the following dependencyManagement: <dependencyManagement> <dependencies> <dependency> <!-- Import dependency management from ...
0
votes
0answers
27 views

Configure Spring Security to accept login details from POST body instead of request params

I am building a rest application using Spring boot and Spring security. In the login module I want my code to read username and password, sent from a client, from Post body. But my code reads only ...
0
votes
0answers
6 views

How to create cache key using pageable and object?

I have the below function public Iterable<PageLayout> getAll(final Pageable pageable, PageLayout entity, List<String> exactSearchingFields, boolean ignoreOrga) { return super....
-2
votes
0answers
15 views

How to make serverStatus() query via spring data in mongoDb

I got database with several collections in micorservice, so there's controllers which works fine. But I need to collect statistics from servers, including database. There's a good query serverStats() ...
0
votes
0answers
14 views

How to effectively update a record using hibernate & jparepository

I'm trying to implement a method for updating a database record. So far, I created this one: public Optional<User> update(final Integer id,final UpdateUserDto dto) { userRepository....
0
votes
1answer
33 views

Does Spring support OpenJDK 12

We are planning to migrate our application from Oracle JDK 8 to OpenJDK 12. Currently we are using Spring Boot version 1.4.5.RELEASE. I have read many articles saying that from Spring Boot 2.2.X, we ...
0
votes
0answers
6 views

How to use LDAP authentication in Oauth2 flow

I need to build an Ouath2 sever with Spring boot. It's OK if I use Database to store User's information (Username, password). But now I need to store that information in LDAP. I just want to ask how ...
1
vote
3answers
32 views

Java EE - RESTful provide different entity representations

In advance, I'm not speaking of Content Negotiation. Let's assume I've a simple JPA entity, by the way it is convertible with a related DTO it doesn't matter. @Entity public class User { ... ...
0
votes
0answers
19 views

How to configure Spring Boot that it permits Wicket's file upload?

I use Spring Boot and Apache Wicket in a web application. I have to add file upload. In the below code Wicket's Form component's onSubmit method is fired but "uploads" is empty. @Override ...
-3
votes
0answers
16 views

Slack Bot WARNING symbol [on hold]

Why am i getting the warning symbol in slack app for my bot , when i am clicking on the button which i am getting with the rich message layout list? Click on this link to see the screenshot where i ...
1
vote
1answer
22 views

@AutoConfigureWebTestClient(timeout = “600000”) has no effect

I'm using WebTestClient to do some integration testing of a controller. If I set a breakpoint inside the controller I hit the standard timeout of 5s of the WebTestClient. The solution to this is to ...
1
vote
1answer
16 views

Redis Cache memory Status

I need to create a page where I can show the Redis cache Memory status like How much memory it has been assign and how much it is using. Is there any way using spring boot we can get all this ...
0
votes
0answers
4 views

401 Unauthorized when accessing openshift 3.11 api

I am creating a spring resttemplate client which make calls to OpenShift 3.11 api end point. After successful authentication and when subsequent call is made to OpenShift api by passing autherization ...
0
votes
1answer
27 views

How to provide External Configuration resources (Database properties and XML files) to classpath in Spring Boot linux

I have been facing the issue with external configuration files to the classpath in spring boot, But it's not picking application.properties, application-dev properties from the external config folder. ...
0
votes
0answers
12 views

How to make Spring boot webflux to start on default Netty rather than Jetty while testing

I have a somewhat similar gradle and spring webflux config up as described in Why spring webflux is choosing jetty by default and then failing? But our goal is to have in memory Amazon dynamo db + ...
0
votes
0answers
10 views

could not resolve plugin artifact 'org.springframework.boot:org.springframework.boot.gradle.plugin:2.1.6.RELEASE'

Gradle command throwing below Exception: FAILURE: Build failed with an exception. Where: Build file '/Users/abel/Desktop/work/gundam/build.gradle' line: 2 What went wrong: Plugin [id: 'org....
0
votes
2answers
45 views

How does Java runtime find my main class?

I am learning Spring Boot. I made a simple Spring Boot project that can output a hello world string at http://localhost:8080/welcome I use Maven to build my project that would output a jar file. To ...
0
votes
1answer
12 views

Spring STS not loading environment variables but running maven works

I'm using Mac OS Mojave with Spring STS version 3.9.7. So I'm trying to load some environment variables such as database username & password into my application.properties file but Spring fails ...
1
vote
0answers
32 views

Java - SpringBoot + Feign + Eureka (Feign not resolving URL from Eureka)

I have an Eureka server already running and I have a Microservice registered there (account-server -> Service B). The issue is when trying to use Feign from Service A. Let's say I have a class in ...
0
votes
0answers
14 views

OAuth 2 client for JWT bearer grant using Spring OAuth

In the Spring OAUTH library under org.springframework.security.oauth2.client.token.grant package we have grants for client, code, implicit and password. There are some extension grants like jwt-...
0
votes
0answers
12 views

How to return collections based on neo4j node labels?

I am not sure how to write a neo4j query that finds all nodes including the labels in a shortest path, and groups them by label in the output. EDIT: The shortestPath includes links between Tags->...
0
votes
1answer
11 views

Configuring spring validation and hibernate validation

Problem already solved here but didn't work for me (not same spring boot version i guess) this Trying to code a custom constraint validator, to check whether account email exists before persisting. @...
0
votes
0answers
16 views

Cors error with spring security in safari

I have a spring boot rest service protected with spring security and there is a node js ui trying to access this service . Calls are working fine in chrome browser , but when the ui is accessed from ...
0
votes
0answers
14 views

SpringDataMongoDB - Cannot find Persistent Entity for type class when using multiple MongoDB Connectors

I am creating rest API which is connecting to 2 MongoDB Database server. I have to disable to Springboot AutoConfiguration and create config class to access both the DB server. The rest API will ...
2
votes
1answer
24 views

How can I get 3 thread pool using multiple datasource?

Help please. I have a class that is responsible for config to the database: @Getter @Setter @ConfigurationProperties(value = "spring") public class DatabaseConfig { @NotEmpty private Map<...
0
votes
1answer
36 views

Unable to understand the behavior of Spring security

I am using spring boot 2.1.4 with dependencies of actuator. I wanted to configure separate authentication and authorization mechanisms for actuator and my application. I read the Multiple HttpSecurity ...
0
votes
1answer
17 views

How can I show the same page (a form of inputs) with the errors in a restfull api in java?

I have an input form which has many inputs.When click the submit button I want to save the data to my mongodb but check first if the name exist or not.If exist I don't want to save the data and ...
0
votes
0answers
12 views

Accessing and displaying stored image, document coming back null, no image displaying

I have two java/spring-boot apps that are connected via database and logins. In one app, it is a database of information. I then am using the second app to share only pertaining information to each ...
0
votes
0answers
13 views

MVC - losing model attribute value

My current working approach - all in one controller class: @Controller @SessionAttributes("userLogin") public class HomeController { private CustomerService customerService; private ...
0
votes
1answer
25 views

Send image with difference data type from angular 7 to Rest API in spring boot 2.0.5

I searched a lot in "stack overflow" and in other sites, no answer resolve my problem. Angular html file: <form (ngSubmit)="submit"> <div> <input type="file" [(ngModel)]="data....
0
votes
1answer
26 views

Unable to Autowire Component with Request Scope in Servlet Filter

I have a request filter that sits in front of a controller. This filter retrieves a user profile and sets the properties on a userProfile Component with Request Scope and then passes on to the next ...
0
votes
0answers
12 views

PayPal Access Token not found in cache 401 live

So I wrote the paypal checkout controller method, I set it up to a button, and when you press the button on the website, it loads to the paypal checkout site, you can login and pay, and it works fine, ...
0
votes
1answer
29 views

java.lang.NullPointerException error on accessing page linked to controller class

I am running a spring mvc application with classes annotated as @controller,@service,@component and for the view layer thymeleaf is used. However on navigating to the path localhost:8080/owners no ...
0
votes
0answers
28 views

Cannot infer type arguments for ResponseEntity<>

I want to implement Spring endpoint in which I can return XML object NotificationEchoResponse and http status code. I tried this: @PostMapping(value = "/v1/notification", produces = "application/xml")...
1
vote
2answers
28 views

Spring boot : configuration inheritance

I have package com.parent.spring; public abstract class ParentConfig { @Bean public String bParent() { return "parent bean"; } then package com.child.spring; public class ChildConfig extends ...
-3
votes
1answer
31 views

Auto inject in Spring between two bean without annotation?

I read somewhere about auto injecting between two bean.I lost this article.. This magic is done without @inject and other. This is example: @Bean Person person() { Some code } @Bean Job job() { In ...
0
votes
0answers
21 views

Java BeanDefinitionStoreException on Spring Boot 2

I'm trying to rewrite an application using Spring Boot 2 (specifically 2.1.5.RELEASE). Previous version used 1.5.7.RELEASE. We are switching database platforms, thus the rewrite. The startup class in ...
0
votes
1answer
15 views

Spring Boot JPA One-to-One mapping generates StackOverflow Error

Trying to run Spring-Boot JPA on MySQL and literally followed this tutorial here : https://spring.io/guides/gs/accessing-data-mysql/ All went well as expected. However, moment I brought in a new ...
0
votes
0answers
12 views

Error creating bean with name 'jobOperator' defined in class path resource [org/springframework/boot/autoconfigure/batch/BatchAutoConfiguration.class]

I am getting the below error in my console:- 2019-06-26 13:48:18.733 WARN 1380 --- [ main] s.c.a.AnnotationConfigApplicationContext : Exception encountered during context initialization - ...
0
votes
1answer
8 views

Circumvent Boostrap-Table from rendering 100+ rows slowly

I'm rendering a list of state objects (with Spring and Thymeleaf) on my view page: <table id="state-table" data-toggle="table" data-pagination="true" data-pagination-v-align="top" data-search="...
0
votes
0answers
11 views

Custom Spring Security Filter Test with MockMvc always returns 404

I am trying to test a custom filter using MockMvc and it always returns status 404 instead of the actual status returned from the filter class. The filter class looks as follows: public class ...
0
votes
0answers
16 views

Global error handling using Spring boot + WebFlux

I am asking myself a question, how can we handle exceptions globally when using reactive programming in Spring boot rest controller. I would assume that @ControllerAdvice will not work because I have ...
-1
votes
0answers
12 views

How to passing Thymeleaf template exception?

I want my view will render this as a empty and the Output at console still throw exception It's equivalent "spring.freemarker.settings.template_exception_handler=ignore" in freemarker the detail: ...