Click here to Skip to main content
15,886,835 members
Everything / Web Development / Spring

Spring

Spring

Great Reads

by vladimir husnullin
Web development using JSON is simple
by vladimir husnullin
Web development using JSON is simple
by Han Bo Sun
In this tutorial, I will introduce the use of Spring JdbcTemplate in a Spring Boot web application. This tutorial will show how to create the necessary configuration for JdbcTemplate. And how it can be used for data insertion and retrieval.
by Grzegorz @ tidyjava.com
List of practices to work effectively on Spring applications. This part focuses on starting a new Spring project.

Latest Articles

by Han Bo Sun
This is a more in-depth tutorial on integrating Lucene search and index engine in Java applications.
by Han Bo Sun
In this tutorial, I will discuss how to add file upload functionality to an Angular web application.
by Han Bo Sun
Loading data in batches and displaying using UI-Grid in an AngularJS based app
by Han Bo Sun
This tutorial will discuss how to configure CORS for Spring Boot web application.

All Articles

Sort by Updated

Spring 

7 Apr 2024 by Office Systems
'm getting this error java.lang.IllegalStateException: Calling [asyncPostProcess()] is not valid for a request with Async state [ERROR] in an API gateway when I'm executing order-service which uploads more than 700,000 records fetched from an API...
21 Mar 2024 by Andre Oosthuizen
Your issue is in the way you are invoking the async 'process_data' method in the 'OrderProcessingService' class. The method is being executed in a separate thread, however, the problem is that your 'process_data' method is not returning anything,...
21 Mar 2024 by UT7
I've resolved this issue, start.spring.io created a package for the main class where the SpringApplication.run method is and I created my other packages on the same level as the package where the main class was instead of creating them directly...
21 Mar 2024 by Office Systems
I'm inserting large volume of data into PostgreSQL database using spring boot approximate about 1 million records, these data comes in batches during API calls and I'm saving each batch as the whole in database but the only challenge facing right...
19 Mar 2024 by Pete O'Hanlon
Without knowing where you were sourcing your data, this is an almost impossible question to answer. There are a few things that do occur from looking at this. You are adding a random UUID but that could easily be auto-generated by the database....
19 Mar 2024 by OriginalGriff
Nobody can guarantee you "a fraction of a second" to add a million rows to a DB, PostgreSQL or not - it will depend on far too many factors: the computer(s) that the DB engine is running on, the activity level on the DB, the connection between...
18 Mar 2024 by Office Systems
I'm having an array list which has more than 1 million of records in it, I want to dump it as the way it is in PostgreSQL database using something built in methods like Copy-manger or any method which will be more faster to import this large...
18 Mar 2024 by Tyler Bakeman
In Eclipse Marketplace (which you can access through the Help button in Eclipse), it shows your plugins (some of them, not all of them), such as M2E. When I switched M2E, to an alternate in Eclipse, it gave me the option to “change”/“disable”...
14 Mar 2024 by Pete O'Hanlon
Assuming that these are separately deployed services, I wouldn't attempt to start them from a central location. What I do is deploy my services in separate containers (Kubernetes on my part, but you could use Docker), and use orchestration to...
14 Mar 2024 by Office Systems
I'm having different micro-services such as configuration service, service registry, order service, customer service, payment service, front-end service, these services they fetch their configurations from config server and they are all connected...
10 Mar 2024 by Pete O'Hanlon
As I don't know what Order looks like, I'm going to make some assumptions in this answer. The big assumption I'm going to make is that you have an Integer id value in the class, which I can get using getId();. I'm also going to assume that the...
10 Mar 2024 by Office Systems
I have two arrays which both have data, what I want to do is to loop through each array and compare the data between the arrays one array is coming from the Post Method and another array has data from the database, so the comparison has to be...
8 Mar 2024 by Han Bo Sun
This is a more in-depth tutorial on integrating Lucene search and index engine in Java applications.
27 Feb 2024 by UT7
Hello everyone, please I can't get SpringMVC project to create a table in MySql database. My entity class is below. @Entity @Table(name="customer") @Data @NoArgsConstructor public class Customer { @Id @GeneratedValue(strategy =...
27 Feb 2024 by Office Systems
I have created a spring boot application of version 3.2.2 which is going to act as a gateway service, the challenge I'm facing at the moment is that whenever I try to add hystrix dependencies for monitoring and for dashboard visualization of up...
19 Jan 2024 by Office Systems
I have created Spring cloud config server to include all configurations of spring cloud config clients for my application, the problem is that my spring cloud config clients can not obtain the configurations from the spring cloud config server...
18 Jan 2024 by Pete O'Hanlon
The problem isn't in your code, rather the problem is with your deployment. You have stated that you deployed your application to Azure, and this brings its own set of expectations. Basically, the CORS request is being blocked by Azure, not by...
17 Jan 2024 by Office Systems
I'm new to Micro-services architecture, I'm to develop a project using spring boot that gets data from API and stores that data into PostgreSQL db then computes and gets the sum of the data uploaded and sends that data into another database...
2 Jan 2024 by Office Systems
I'm trying to create Micro-services architecture using spring boot, the only challenge I'm facing at the moment is how to configure spring cloud client to pull all the configurations from the config server, the config server gets all the...
21 Nov 2023 by UT7
Hello everyone, please I was trying to create a Spring boot project from eclipse IDE and I got this error - 'Import Getting Started Content' has encounter a problem. NoSuchMethodError: 'void ...
27 Oct 2023 by Office Systems
I'm fetching data from Microsoft access database file into PostgreSQL Database, then later some changes are added into Microsoft access database file and then re-uploaded into PostgreSQL Database as the latest dataset file with changes, now the...
27 Oct 2023 by Kanchana Gallage
I am doing implementation for this type of SELECT query in a Spring boot application using named parameter jdbc template. Database used is postgres. SELECT lp.*, gp.NAME, gp.description, FROM global_products gp...
27 Oct 2023 by Richard Deeming
Quote: Adding ORDER BY clause gives the similar order and data every time but I do not need that for the requirement. Except you do need that. If you don't specify an explicit order for the results, then the order is undefined. The DBMS is...
26 Oct 2023 by Gerry Schmitz
Add a "timestamp" to the Access records; and use a new timestamp when you update and insert. You can't "delete" initially; you'll need to add a "delete" flag (and timestamp) so you can export "deleted" records; and purge / archive them later. You...
23 Aug 2023 by Quang Le 2023
@Controller public class tdlController { @Autowired TdlService tdlService; @GetMapping(value = "dmno") public String homepage(Model model) throws RuntimeException { // model.addAttribute("list",tdlService.findAll()); ...
23 Aug 2023 by Andre Oosthuizen
The error relates to your view resolver configuration that is causing a loop in dispatching requests. Without seeing the complete configuration of your Spring Boot application and the context in which this controller is being used, it's a bit...
19 Aug 2023 by jaikrishna310
I am trying to make a project in spring-boot! But in the controller, I am getting an error in the save() method as follows: The method save(S) in the type CrudRepository is not applicable for the arguments...
17 Aug 2023 by Muhammad Anas 2023
The issue is with spring-data-jpa version, try changing to another version in pom.xml(if its maven) or you may use the below mentioned version if it works for your spring boot project version: ...
15 Aug 2023 by Han Bo Sun
In this tutorial, I will discuss how to add file upload functionality to an Angular web application.
14 Jul 2023 by Thang Đai
I am writing a search function from date to date. But when I click search it doesn't return any results and it doesn't give me any error. file handover.html
14 Jul 2023 by Andre Oosthuizen
There are a few issues you can check that might cause a no return on your date request. I have added comments in your code where you can check. I have also added the 'System.out.println' to debug all returned parameters in your controller, check...
6 Jul 2023 by Rakesh subudhi 2023
I am building a Multi-Tenant web application using Java . I have around 10-15 different background jobs that need scheduling for each tenant.I faced multiple challenges like. 1.How to develop each tenant run on cron jobs and equally distributed?...
4 Jul 2023 by Office Systems
I'm trying to fetch data using Spring Boot for my REST API from PostgreSQL Database, I have more than 30 million records in my database, the API takes a lot of time to pull data from the database and sometimes it results on time out error when...
4 Jul 2023 by Richard Deeming
Quote: I just want to count the results I can't return such data to the user there is no means I can count these values depending on these conditions provided Your code is loading all 4 million matching records into a list, simply to return...
19 Jun 2023 by Natanael Fredrick
Based on my understanding of load-balancing, requests are forwarded to multiple instances of a service so that if one service is down, it will be redirected to one that is available. I have created a microservice that implements load-balancing...
15 Jun 2023 by Member 13992703
I'm currently struggling with the following issue: I need to use an interface in my plugin (PLUGIN A) that comes from another plugin (PLUGIN B). I'm also the developer on PLUGIN B so I can make code changes (if needed). What I've done so far: ...
5 Jun 2023 by Zijad Bećirević
Its my first time using angular and java. So Im learning from tasks. I already made a call from frontend to backend to retrieve a count number (sends number from frontend, searches the database and return the output from the query). Now I have a...
18 May 2023 by Office Systems
I have deployed angular project in it's own app service and also deployed spring boot in its own app service the two applications works fine locally but the problem comes on production I get this error "Cross-Origin Request Blocked: The Same...
7 May 2023 by Office Systems
I am having a spring boot application which reads values from the Microsoft access file and then checks if the value exists in the database then gets updated or else inserted as the new record however I'm only getting these values present in the...
26 Apr 2023 by Office Systems
How can I delete large amount of data more than 10 million records in fraction of a second in spring boot project, the code I'm having right now takes more than 1 minute and 30s to delete these records. Below is the code I'm using to delete these...
19 Apr 2023 by Office Systems
I want to upload large file more than 2gb to a particular folder in spring boot, the challenge I'm facing is that, after file upload from client application (Angular Application/ Postman) it takes more than 50seconds to hit the controller, after...
30 Mar 2023 by Office Systems
'm Creating a spring batch project and I have tried to create all the key components required for the spring batch to run but I'm getting the exception 'Error creating bean with name 'scopedTarget.patientReader' defined in class path resource'...
29 Mar 2023 by Office Systems
I want to read mdb file using spring batch Item Reader, I have managed to read the mdb file and the results I can see them in console but I'm not able to map this results into the reader object. Below is my sample code. What I have tried: ...
27 Mar 2023 by Cris29M
How can I fix: The dependencies of some of the beans in the application context form a cycle: registrationController defined in file...
21 Mar 2023 by Office Systems
I'm having a spring boot project which looks for more than 50.0M documents in MongoDB when fetching from a single table everything works fine however the problem I'm experiencing is when joining two tables in order to check for customer status in...
21 Mar 2023 by Dave Kreskowiak
It takes forever because you're looking for a couple of strings, "Disabled" and "Opted Out", probably without any indexing on the field. This is probably the worst way to get the status in terms of performance. If you were looking for integer...
13 Mar 2023 by Office Systems
How can I compare month in spring mongo criteria with a hard corded value, month in criteria is in a spring format and the value is present in an integer format. This is what i have so far i just want to check for that month and group employee...
13 Mar 2023 by Dave Kreskowiak
Think about your query. What does ".is(2)" mean? Is it the month number? The day of the month? How about the yes? Maybe the hour, minutes, or seconds? How is your code telling the database that the 2 is a month? Hint: It's not.
14 Feb 2023 by Han Bo Sun
Loading data in batches and displaying using UI-Grid in an AngularJS based app
10 Feb 2023 by Office Systems
I'm having a spring boot application connected with Mongo DB now I want to enable spring batch how can I manage this withi spring data Mongo What I saw with Spring data JPA spring.jpa.properties.hibernate.generate_statistics=true...
16 Jan 2023 by Andre Oosthuizen
You are adding a new client twice, at the start of your code and then again within another if else statement. I am not familiar with the code used ?-Java/MongoDb -? but the basics is the same How it works - 1. Search data table for client with...
16 Jan 2023 by Office Systems
I want to query all data which are present in my database by comparing with while loop data and if this data is available I want to update it and if not I want to insert it as a new record into the database. The problem is I'm only getting data...
28 Dec 2022 by Member 10514913
I am seeing a lot of annoying errors when I run spring boot tests java.net.UnknownHostException: telegraf.system at java.base/sun.nio.ch.NioSocketImpl.connect(NioSocketImpl.java:567) at...
16 Dec 2022 by paul webo
I am a junior java developer and would really want to know more about java What I have tried: Spring boot, spring Jpa, MySQL
16 Dec 2022 by Richard MacCutchan
This is still the best set of tutorials: Java Tutorials Learning Paths[^].
6 Dec 2022 by nagarhemant
Exception in thread "main" java.lang.AbstractMethodError: Receiver class ch.qos.logback.classic.util.DefaultJoranConfigurator does not define or inherit an implementation of the resolved method 'abstract void...
21 Oct 2022 by Han Bo Sun
This tutorial will discuss how to configure CORS for Spring Boot web application.
12 Oct 2022 by Arli Chokoev (Choke)
I need to store some state, I receive in the processor, for each of the StepExecutions separately. For this purpose I created a step-scoped bean, which I try to inject: @Slf4j @Configuration @EnableScheduling @EnableBatchProcessing...
3 Oct 2022 by viharika_
What are all possible ways to add health checks like liveness, readiness to a spring non-restful application without spring boot. Application manages AMQ, and health check includes checking AMQ health and run on kubernetes. What I have tried: ...
21 Sep 2022 by Auto Samachar
I have vmscontactemail field in the database and models, when I debug the code it shows the above error when I execute that line at managerdetailsrepository.save What I have tried: DAO @Modifying @Transactional @Query("UPDATE...
8 Sep 2022 by Juniorfstack
0 I'm a junior dev and my current project is in spring but unlike JavaScript I cant access the dom.How would I add something to a image so when I click it I can save its name or when I click a submit button that it will be saved. I have been...
1 Sep 2022 by Auto Samachar
Could not locate appropriate constructor on class : com.recruit.api.model.JobRecruiter; nested exception is java.lang.IllegalArgumentException: Could not locate appropriate constructor on class : com.recruit.api.model.JobRecruiter/500 I added...
1 Sep 2022 by Richard MacCutchan
Your constructor is: public JobRecruiter(int id, String jobTitle, String recruiterName) So any code that instantiates a JobRecruiter object must pass three parameters. The only lines I can find where it makes such a call are JobRecruiter...
7 Jul 2022 by Jennifer Reif
In this article we build a Java microservice that connects to, and interacts with, graph data in a Neo4j AuraDB Free database.
29 May 2022 by eboi mela
I could login via LDAP but I cant fetch user role which is stored in my Database. I do get the following error: org.springframework.security.ldap.userdetails.LdapUserDetailsImpl cannot be cast to com.test.rnd.geo.web.dto.CustomUser What I have...
10 May 2022 by Zhang Michael
I have a spring boot application based on reactor but it can't be launched on Window 10 although it works fine on Linux. It failed to start Netty. This application uses spring boot 2.5.13 now. This issue doesn't exist for the old spring boot 2.3....
11 Apr 2022 by UT7
Hello everyone, I got this error org.springframework.dao.DataIntegrityViolationException: could not execute statement; SQL [n/a]; constraint [null] while I was trying to develop a CRUD Restful API Application using Spring Boot, Angular and...
4 Apr 2022 by Member 14101913
Input such as username: user.name@domain.com password: blablabla #LDAP Properties prefix.ldapIsEnabled=true prefix.ldap_server_url=ldap://10.0.20.20:389 prefix.ldap_domain_name=domain.com prefix.ldap_security_authentication= simple...
4 Apr 2022 by Member 15435322
I want to do LDAP authentication using Spring Boot, but I can't. I just want to check the person who wrote his username and password on our ldap server when he wants to log in. If we have such a user on our ldap server, I want it to rotate...
25 Mar 2022 by UT7
Hello everyone, I have org.springframework.beans.NotReadablePropertyException: Invalid property 'expensename' of bean class [java.lang.String]: while working on a Spring boot app. The error occurred after I created a spring form and used the...
6 Mar 2022 by Member 15471521
I have a profile page and an update page. First time I hit update I get the error messages, second time I hit update with all fields populated I get this error: Completed 405 METHOD_NOT_ALLOWED "ERROR" dispatch for POST "/error",...
4 Mar 2022 by Member 15471521
I get this error when I try to execute this query DELETE FROM bookings as b WHERE b.check_out = CURRENT_DATE; Cannot delete or update a parent row: a foreign key constraint fails (online_booking_app.booked_rooms, CONSTRAINT...
2 Mar 2022 by Dev Learning
I would like to develop an web application with Spring Mvc, hibernate and Mysql. I know there are many Component libraries that facilitate the development of web applications like Primeng for Angular, Telerik and Infragistics for Asp.Net MVC. ...
15 Feb 2022 by Han Bo Sun
Tutorial to discuss the design of a moveable popup modal using AngularJS and ui-bootstrap
9 Feb 2022 by Member 12106197
The problem is hard to explain, so please have a look at the project: https://github.com/darzz/boot_bug This is the minimal setup, that reproduces the bug.Description: The application stack is Spring Boot with Spring Data and Spring Batch. There is testNamedQuery.hbm.xml file under...
9 Feb 2022 by Member 15529625
If you use maven, perhaps you could add a copy-resources plugin to copy the hbm files to the test-classes folder. maven-resources-plugin 3.2.0 ...
21 Jan 2022 by Dwaipayan Goswami
I'm using Redis in my Spring Boot REST application to store cache. But the problem I'm facing is once it is stored in Redis my API only hits the Redis, not the database. I've added a time out property, but it didn't work. I've tried CacheManager...
22 Dec 2021 by Minh To Quang
So I have two microservices, one that has a database and one that make RPC calls to the one that has the database. The one that makes the RPC calls (I called it gui-microservice) has two services, BookService and LoanService. These two services...
21 Dec 2021 by Han Bo Sun
How to use JWT Token with Spring Security for user authentication and authorization
21 Dec 2021 by Alex Darius
I am new to spring boot, working on a project, and recently an experienced developer just told me that when creating an entity table, that has a field that should deal with dates the best approach is to use long, something like this: private...
21 Dec 2021 by Richard MacCutchan
It is usually best to use the proper Date or DateTime type. Check the documentation for the h2 database at Data Types[^]. But if the experienced guy insists that you use a long type then ask him to explain why.
9 Dec 2021 by Member 15435322
Hi all, suppose I have a json like this , when I am send request to the server, where I am using RestTemplate generate to do this. When I send success request I am getting sucess response like this. { "code": 0, "message": "Successfully...
7 Dec 2021 by Afzaal Ahmad Zeeshan
Quote: create relationships between entities in a project that is being written from scratch, or specify what relationships to have between them? That's the best part about an ORM. You don't need to think about it yourself (apart from some index,...
7 Dec 2021 by Member 15435322
I was wondering, what is the best way to create relationships between entities in a project that is being written from scratch, or specify what relationships to have between them? For example, as we can directly understand the relationship...
6 Dec 2021 by Member 15435322
Suppose I am returning data like this in rest api: { name:"Ronald", age:25, salary:1500 } But what should I use to design variable names as I want? For example: { Name: "Ronald", Age:25, Salary:1500 } How can I design that only variable...
6 Dec 2021 by Gerry Schmitz
Quote: The schema helps in a multiple way. It acts as a contract between two teams, serves as a specification, simple to read and easy to follow and you can use it for validation once your APIs are ready. JSON Schema - as a specification,...
7 Nov 2021 by Brian Antao
I am in the process of developing a Spring Cloud based API Gateway. This Gateway acts like a proxy that filters multiple JSON API requests/responses The gateway has multiple routes that are defined for each JSON API. I have found a way to define...
27 Oct 2021 by User 15041314
As you can see, in my service layer this method send post request like client to the server using Spring Boot WebClient framework, but I have getting a problem, which as you can see my method accept 4 params, which you see and I want to send...
24 Oct 2021 by User 15041314
Hi all, Right now I am working int this project, so I made a project like this, when the bank worker upload the file with xlsx extension to our bank's site, all the values (phone number, message) in the excel file are placed in the database. When...
24 Oct 2021 by OriginalGriff
Start here: sending sms java - Google Search[^]
20 Oct 2021 by User 15041314
{ "message": "The operation was successful.", "code": 200, "fileDetailResponseDtos": [ { "phoneNumber": "550000000", "textMessage": "Message1", "createDateTime": "2021-10-20T15:45:27.277", "sender": "Anar", ...
20 Oct 2021 by Matthew Casperson
In this article, Using MSAL to Access Azure APIs, we use the OBO OAuth flow to call a service in Azure. Then, we’ll communicate the results back to the frontend application via a shared database.
18 Oct 2021 by Matthew Casperson
In this article we’ll explore integrating Azure AD and MSAL with a Spring Boot web application.
14 Oct 2021 by User 15041314
This is my Entity class, which when I run project automatically mapping oracle database. import lombok.Data; import org.springframework.data.annotation.CreatedDate; import javax.persistence.*; import java.time.LocalDateTime; @Data @Entity...
5 Oct 2021 by Devin Clark 2021
So let's say you have a UUID in an .xml file in your program and you're writing a java program in a, well, java file. They're both in the same folder so they are in the "same house just different rooms" if you understand what I mean. What steps...
5 Oct 2021 by OriginalGriff
You have to open the XML file, read the content, find the node(s) you are interested in, and assign them fo java variables. We really can't be any more specific, because XML is a hierarchical structured file format (i.e. the data inside resembles...
5 Sep 2021 by User 15041314
Hi there, When I using xml configuration I must write xml configuration, which can use annotation base configuration, but I don't want to using this style, I want to use with annotation. is it possible? What I have...
4 Sep 2021 by Freeex
I stuck since a couple of hours on a test method. I tried to reproduce a similar example. I have a service who extend a abstract service with an utility method like this: public class MyService extends MyAbstractService { @Autowired...
29 Aug 2021 by SHYKAT ROY
Basically, I am trying to establish a relationship between my two tables using spring boots. And the relationship which I had used was the @onetoone and @onetomany relationship. But after building the relationship and creating the table in MySQL...