Most voted "spring" questions
Spring Framework is an open source framework for developing applications on the Java platform. At its core is rich support for component-based architectures, and currently has more than a dozen highly integrated modules.
Learn more…787 questions
Sort by count of
-
0
votes1
answer240
viewsNo Qualifying bean of type helps with this error:
I’m trying to use the swing and the spring but I have this problem: Exception in thread "restartedMain" java.lang.reflect.InvocationTargetException at…
-
0
votes1
answer130
viewsRelationship 1:N in Java
I have an API and I’m creating a relationship between Cliente and AtividadeSecundaria, where a client has several activities and the activities belong to a client, however, when I make the…
-
0
votes1
answer914
viewsHow to rollback the database using Spring Framework
I have this method that saves data in 3 different tables, /** * * @param user - de onde os dados do usuário serão retirados para gravar no banco * @throws GoogleAuthException - se houver algum erro…
-
0
votes1
answer42
viewsError editing a record using Spring MVC and Thymeleaf
Good colleagues, I am studying Spring through some video lessons and now I have the following problem that I cannot solve I have done everything in my power. The problem is this when I want to click…
-
0
votes0
answers66
viewsRequired Parameter is not present in Spring MVC design with spring boot using Thymeleaf
I am generating a form in the html code of my project and using Thymeleaf to create it. Some form fields are input type because the user needs to enter it, others are select type because there is…
-
0
votes1
answer194
viewsSend by jsp a command for the controller to update the database method
I want to make a "deposit" into the account with Id "x". The controller sends the "account" to the jsp that returns the deposit value to be updated in the database. That was the logic I used, but I…
-
0
votes1
answer33
viewsSpring session attribute is not shown in JSP via JSTL
I have a Credential class that I use to store session user information (it’s annotated with @Sessionscope and @Component). When I print some attribute of this class, it usually appears, but if I try…
-
0
votes1
answer1140
viewsSpring data JPA error (Parameter 0 of constructor and entityManagerFactory)
Guys, for hours I’ve been trying to solve a problem in my Spring Data JPA I execute the code and I get this error Description: Parameter 0 of constructor in…
-
0
votes1
answer481
viewsMock local variable inside method with mockite and spring boot
I’m trying to simulate the return of a method on a local variable, but it’s always null, showing java.lang.Nullpointerexception I have the following code within a @service: @Service…
-
0
votes1
answer23
viewsProblem with remote EJB call with Spring
am having a problem with an RMI call where I call a remote ejb from a jar. When debugging I get the following error: "Failed to locate remote EJB…
-
0
votes2
answers63
viewsHow to detect when the user tries to access a URL without having a ROLE for that URL in Spring Security
In my system the ROLES of the screen urls are dynamically loaded from the database through a ObjectPOstProcessor as you can see below: public void configProducao(HttpSecurity http) throws Exception…
-
0
votes3
answers339
viewsSpring Boot does not recognize the controller when a request with parameters is sent
Spring Boot does not recognize my controller if I submit more parameters in the request. For example: If I send a normal GET request spring boot recognizes my controller:…
-
0
votes1
answer180
viewsSpring Boot 2 - How to associate the controller with the web page (redirect)
Save everyone, I’m starting with Spring Boot 2. I still can’t understand how to associate the controller with the web page. I’m creating the html files in the package:…
-
0
votes0
answers87
viewsReturn all records from another class in JPA Spring
How do I return a complete list of another class within a class? I need Patient.java to return (in the findALL that returns me in JSON) a list of all records in the Statuspaciente.java class,…
-
0
votes1
answer172
viewsHow to redirect url - redirect 301 - through a request ? (Httpurlconnection)
I’m trying to get a status code[ redirect 301, Location : ] through a request. This request brings as parameter an id associated to a database stored url (in this case, a Map), with the id, I search…
-
0
votes2
answers186
viewsError starting Applicationcontext through a Spring application
Good colleagues. I’m starting to develop with spring, but I’m having a problem not being able to run my web application, whenever I run launches the following error message in spring: Error starting…
-
0
votes2
answers702
viewsQuery with Collection in JPA Spring Data
Good afternoon, everyone, I have a question that might help other people. In my project I have a vehicle entity, this entity has a collection of another entity called Optional (Vehicle Optional), an…
-
0
votes0
answers587
viewsHow to create an Annotation to validate data from a DTO in Java?
I have a class of a DTO object that I receive in my control through a request using REST. See an example of a request using the verb Post: @PostMapping public…
-
0
votes1
answer73
viewsJava: Error passing references in a Supertype using Convert Pattern to convert DTO/Entity
I’m doing a serialization process of a DTO class for Entity and vice versa. And for that, I use a design pattern called Convert Pattern. At first, I created a generic class that performs these…
-
0
votes1
answer239
viewssql result in spring boot
Good afternoon, I need help to make an endpoint in Spring Boot, in the database (Mysql), I have the following query: SELECT U.NOME, P.DESCRICAO FROM USUARIO_PERMISSAO UP JOIN USUARIO U ON…
-
0
votes1
answer521
viewsPostgresql error with Spring boot - api
Personal opa I’m making a very simple application, to see how postgresql works. I’m making a Spring Api application. My class @Entity public class Product Implements Serializable { @Id…
-
0
votes1
answer55
viewsSalesforce Query Returning Wrong Date
In Salesforce when I run the following query SELECT Data_de_Nascimento__c FROM Account WHERE id = '0013K00000ABC' he returns me 1999-05-29 In Java, after I set up the integration, I run this…
-
0
votes1
answer365
viewsError connecting Flyway in spring application
Configuration of the POM: Application properties: Error while running project: 2019-12-19 11:23:27.844 ERROR 22884 --- [ restartedMain] o.s.boot.Springapplication : Application startup failed…
-
0
votes0
answers226
viewsSpring - class path Resource cannot be opened because it does not exist
I’m trying to upload a simple HTML page on Tomcat with spring and Thymeleaf, but when access gives the error: An error happened During template Parsing (template: "class path Resource ..…
-
0
votes1
answer136
viewsEntity relationship error 1:N using orphanRemoval
I am trying to update a record in the database through a REST service with the help of Postman, however is returning me an error: "A collection with cascade=\"all-delete-orphan\" was no longer…
-
0
votes0
answers163
viewsQuery JPA using Paging is taking longer as the page number increases, and generating timeout
I’m running a query with JPA on a cloud server of the google app engine, this query should bring me millions of records, and so I’m using Pageable on it, to avoid bank timeout, the problem is that…
-
0
votes1
answer170
viewsHow to customize the authentication failure error to return a message in Body from the reply?
When an authentication failure occurs in Spring Security, it returns an error in the response header. I would like to customize the error and return a message in the reply Body. Below is the code…
-
0
votes1
answer68
viewsWhat Spring annotation I need to use with Mqttcallback messageArrived
I am new to Spring and am trying to insert in my Mysql database from the message received from MQTT. I created my application as follows: public static void main(String[] args) throws…
-
0
votes1
answer341
viewsInfinite looping in bidirectional relationship - Manytomany
I’m building a Rest API in Springboot. In it I have 2 related classes, and when I do a get in one of them they return me a looping Infinite through your foreign keys I’ve tried using the…
-
0
votes2
answers263
viewsFailed to convert value from property of type 'java.lang.String'
I am trying to submit a form that in one of the classes there is a relationship, I would like to know how to do this, because every time I try to submit I get the error of "Failed to Convert…
-
0
votes1
answer65
viewsSpring command not found
I installed the Spring CLI on my machine recently, and configured the file etc/profile, on it I had already configured my JAVA_HOME, and tried to set up the SPRING_HOME, the end of the file is like…
-
0
votes0
answers43
viewsHow to capture Httpentity on an Httpresponse more than once?
In my project, I created a Helper class called Httpresponsehelper to get the body of my Httpresponse. However, when executing the command HttpEntity httpEntity = httpResponse.getEntity() it only…
-
0
votes1
answer437
viewsLog Implementation in spring boot
I implemented the LOG in my Spring Boot application but it generates entire files of several days would you like to partition per day as ? To make the configuration I am using in my Properties the…
-
0
votes1
answer63
viewsJsoup does not bring full HTML Document
When capturing the page and displaying it on the console, I realized that the HTML was not complete. During the execution I can notice that it returns many elements, but when it finishes the…
-
0
votes1
answer76
viewsJava Spring: Post method does not insert relationship id
I’m learning the Spring framework, I tried to follow some 1-1 relationship tutorials where a library has an address. When uploading library data and address id in the body, a new record is inserted…
-
0
votes1
answer54
viewsHow to use Interceptor in Spring?
I’m a beginner, and in the project I’m developing I used the Interceptor to block access to other resources if the user is not logged in to the session. For example: if the user has not logged in,…
-
0
votes2
answers1098
viewsResponsestatusexception - Spring boot - Return of the message
I am new to java and I am created a training API and I came across the following problem: I do the request via Postman, the return of JSON is ok, but if I do a search that does not return anything…
-
0
votes1
answer30
viewsUsing the JPA Repository example
I need to do a search in the bank where I have an object that is filled with everything except the id and check if it has any object that gives a "Match" with it and return it! I thought to make a…
-
0
votes1
answer142
viewsSpringboot does not generate the tables in the bank
When I run the project, my tables do not appear in the database. I noticed that when I take my relations out of the attributes that I declared @Onetomany, it creates the tables, but my project needs…
-
0
votes1
answer104
views(JAVA) How to treat Exception with spring?
In my model I declared this code to be unique. @Column(unique=true, name = "codigo") private long codigo; At the time it is displayed in the api and I inform equal codes for two employees appears to…
-
0
votes1
answer129
viewsError when requesting API
I’m getting an error, possibly from CORS, when making a GET for an API, which is a third-party API and I don’t have how to release server-side CORS: Exception in thread "main"…
-
0
votes0
answers40
viewsCustom Validation using Kotlin
I am trying to create a validation where it is necessary that the phone or mobile phone is required (when one exists the other is not required, if both are empty one or the other needs to be…
-
0
votes1
answer230
viewsSpring Boot - initial test data
I am trying to pass data to test the front, but the controller is not getting the data that Spring Boot should start. My application.properties: spring.jpa.hibernate.ddl-auto=create My import.sql:…
-
0
votes1
answer742
viewsNo Qualifying bean of type found for service
Good evening guys, I’m trying to launch a Spring API and I’m having the following problem running it, I’ve tried renaming the methods as well as the functions First I’ll leave the Debug log here…
-
0
votes1
answer394
viewsHow to create a custom findBy method for spring?
I can use findById in the controller but wanted to know how to create a findByQualquer to another class property. follows the code: Model: package com.leonardo.pokedex.model; import…
-
0
votes1
answer471
viewsFindby with nested object - Spring Data JPA
I’m having a doubt when creating a findBy using jpa with atríbuto of a nested object, the classes are: public class Livro { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id;…
-
0
votes1
answer64
viewsProblem with Spring Boot Mapping
Hello, I have the following project structure using Spring Boot and I’m having problems es create their Beans: project1: com.portal (spring-boot service) contem os @Controllers project2:…
-
0
votes0
answers35
viewsHeritage with modelMapper
I am creating a project in college, in which I need to register a user. In my controller I receive a User and need to convert to a type of user, being them student, teacher, coordinator or external…
-
0
votes0
answers33
viewsAutomatic filling of the seat
Hello, I have a java project and I’m having a hard time. The project is based on creating the functionalities of a bank, I have done everything of the accounts and customers. I already created the…
-
0
votes0
answers37
viewsI need to Associate two entities in @Manytomany with JPA using Mysql, but it is not saved in the composite table (usuario_item)
I need to make the connection between user and item for a login system I’m stagnant in this error 2 days ago. I searched for forums and tutorials and could not get anything to help me. If possible…