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
-
-1
votes1
answer256
viewsApplication normally runs on Tomcat embedded in Spring Boot and does not run on Tomcat on my Server
good afternoon. I’m having a problem with an application using Spring Boot 2. Basically it is a Restapi with some "scheduled methods". In the Spring Boot embedded Tomcat it works normally, runs the…
-
-1
votes1
answer113
viewsJava - Spring 404 - not found
I am developing a Java application with Spring Boot, however, Controller is not able to find HTML, apparently... Page not being found Previsão do tempo <table class="table"> <thead>…
-
-1
votes1
answer31
viewsHow to popular only a part of the object with a query in Hibernate
Related to that question I asked earlier about Hibernate I am building a Restful API, and making a Join with 2 tables. However I would like to bring only some attributes from my Join table. Today my…
-
-1
votes1
answer91
viewsHow to reduce Page return fields in an API?
I am implementing pagination in some endpoints of my API and the return is a Page. This object returns many arguments, there is some way to eliminate some of them? The Repository extends…
-
-1
votes1
answer190
viewsMetodo Post spring boot 2.2.2
Well guys I’m having a problem, I’m starting to learn spring boot and when I’m doing the POST method always back the error saying that it was not found Controller package Controller; import…
-
-1
votes1
answer25
viewsHow to do an UPDATE with Sqel Expression?
I’m trying to do an UPDATE and I’m not getting it, someone can identify a point of failure ? @Query(value="UPDATE cliente SET nome = #{#cliente.nome} WHERE id_cliente = 1", nativeQuery=true) Cliente…
-
-1
votes1
answer49
viewsMock and inject a service class at the same time
I have a spring test class that in some cases I want it to behave in the normal flow, that is, when it is done a findAll() hitting the repository it returns the value it selects from the embedded…
-
-1
votes2
answers217
viewsMigrate data from one table column to another table column
I work in a company where we implement a new functionality in our system, but previously a field of our table was bug_passos varchar(500), now with the new implementation, we create a new table with…
-
-1
votes1
answer50
viewsHow to leave access to my API open for consultation
I have an application built in Angular2+ and I need to leave an open route for external consultation, without having to log in to the application: Java resource…
-
-1
votes1
answer184
viewsHow to convert a received JSON into my Spring Kafka Consumer into an entity ready to be saved in the bank?
Good afternoon! I need to consume Jsons from Kafka topics and convert to entities, and so be able to save in the database, Postgres, in case Configuration of the Consumer: @Configuration…
-
-1
votes2
answers223
viewsSpring MVC application does not redirect to page after login
I have a problem and I would like to count on your valuable help to solve it. After logging into the application the user should be forwarding to a catalog listing page. The login itself is ok,…
-
-1
votes1
answer66
viewsHow to pass multiple lists in a query? Using JPQL
The problem is this: I have a controller that receives a list of Integers: [1245,12346 ...] In my table I need to consult using this list but the columns are separate, IE, the first digits are in…
-
-1
votes1
answer101
viewsHow to capture a json field in java?
I have that code: public static void main(String[] args) throws JSONException { String filmes[] = new String[2]; RestTemplate restTemplate = new RestTemplate(); String resposta =…
-
-1
votes1
answer20
viewsfindAllbyId bringing the same result to the whole query
I’m having a small problem, my query is returning the same result on all Rows. Example: Code: @NamedQuery(name = "UtilizadorPerfil.getByFilter", query = "SELECT u FROM UtilizadorPerfil u WHERE…
-
-1
votes1
answer291
viewsSpring Boot - Error when redirecting to listing page after registration deletion
I’m starting with Spring Boot, my difficulty is in defining redirects (paths). The current error occurs in redirecting after deleting a record. On the page that lists all the properties I have the…
-
-1
votes1
answer33
viewsToken Authentication Micro-service Java
I am separating my authentication service into microservices, but when I separate the token into a module, my authentication service always returns 401 and does not log any This is my config class…
-
-1
votes2
answers32
viewsI cannot update my object using PUT
Although I know very little about Spring because I am learning, I cannot save a recovered object, the error is when I pass the object personal Pository.save(personSalva) I came to see some examples,…
-
-1
votes1
answer28
viewsSpring: how Jackson can format a composite Json response into objects
Well, I’m doing a Spring project along with Spring-cloud-openFeign for integration with a Fipe api to access car values. See the class: @Service @FeignClient(name = "FipeService", url =…
-
-1
votes1
answer30
viewsPersist entity history (objects) using Mongodb
I have the following entity (decreased from the actual entity): @Entity @SequenceGenerator(name = "produtoSequence", sequenceName = "sequenceproduto") public class Produto { @Id…
-
-1
votes1
answer41
viewsHTML in Spring Boot does not find files
I’m trying to load an audio file into an html, like this When I open html in the browser it loads normally However when I do the same I start the spring application, html does not load the file and…
-
-1
votes0
answers12
viewsHow to capture inheritance data with mapstruct?
I am creating an API with Spring and there was a need to make inheritance for different types of users. My entity structure follows as follows: @MappedSuperclass @Getter @Setter…
-
-2
votes0
answers17
viewsImplicit column Reference in the @Mapsid Mapping fails, Try to use Explicit referenceColumnNames
I have these tables in my database: create table movimentacao ( id bigint not null, usuario_id bigint not null, data_entrada datetime not null, data_saida datetime, periodo_permanencia…
-
-2
votes1
answer329
viewsGet into Webclient by passing json as parameter
I’m doing the requisition this way, but I’m not succeeding , someone who’s been through it? private static String vwsApiUrl = "http://vws.veloxtickets.com:82/wscinema.ws/Get_Cinema_Programacao";…
-
-2
votes1
answer247
viewsReturn treated message when it occurs (with.mysql.jdbc.exceptions.jdbc4.Mysqlintegrityconstraintviolationexception:)
Can anyone help me return a message dealt with when it occurs com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationExcept ion: Cannot delete or update a parent row: a foreign key…
-
-2
votes1
answer150
viewsHow do I leave a JPA transaction with Spring open?
I would like to know how to leave a JPA transaction with spring open, today I use the annotation @Transaction what happens is that every time I want to carry some attribute that is not like EAGER…
-
-2
votes2
answers900
viewsReturn JSON from API with parameter
Hello, I have a service that consumes the Openweather API. There is a list of cities registered in the view layer. Where you can see the weather forecast for each city by clicking on the 'forecast'…
-
-2
votes1
answer72
viewsSpring boot to associate two entities
I have a question about how to associate two entities using spring data + spring boot. I have both relationships: @Entity(name = "profiles") class Profile( @field:Id @field:GeneratedValue(strategy =…
-
-2
votes1
answer68
viewsError in mappedBy when making 2 user relationship
i have two classes one of user and one of request, my user class has roles and in the order class I want to know who was the employee and the client who made the request and am having this error…
-
-2
votes1
answer35
viewsHow to generate a json with an object array
Hello, I’m trying to create a REST API, where in the GET method I should return a JSON in this style: {questions:[{ id: 1, question: 'pergunta 1', answers: [{ answerText: 'resposta 1',…
spring spring-boot spring-jpa h2databaseasked 3 years, 8 months ago Luis Gustavo Rodrigues Oliveir 3 -
-2
votes2
answers36
viewsI cannot show an exception when I set a value that my foreign key does not exist in JSON when I will persist
I own a Lancamento class that inside it I have 2 foreign keys that would be pessoa_codigo e categoria_codigo, I managed to create an exception when I report a non-existent value for any of these…
-
-3
votes1
answer337
viewsError creating bean named 'springSecurityFilterChain'
I am trying to use Spring Security, but the following error is occurring: GRAVE: Exception to sending context event started for instance System class…
-
-3
votes1
answer84
viewsERROR 500 - But I don’t know where is wrong, someone help me!
@PostMapping//Create public ResponseEntity<Categoria> criar(@RequestBody Categoria categoria, HttpServletResponse response) { Categoria categoriaSalva = categoriaRepository.save(categoria);…
-
-3
votes1
answer30
viewsString pick up sentence text
I have a phrase the following random phrase: Pineapple, pear, apple and wanted in the variable var str = pick up my random phrase <div class="page-header"><h1>Abacaxi, pera,…
-
-3
votes2
answers192
viewsHow to make the findById method in spring-boot?
I’m making an Api where I need to get a user’s information through findById, but the STATUS in Postman is like 200 and did not display anything. Code below. controller @RestController…
-
-3
votes1
answer21
viewsUpload image profile photo and associate to "profilePhoto" attribute in User entity with Spring
Guys I have an entity that way: I am using Spring Boot and Postman to instantiate new User class objects @EqualsAndHashCode(onlyExplicitlyIncluded = true) @Entity @Table(name = "tb_users") public…
-
-4
votes1
answer271
views -
-4
votes1
answer144
viewsValidate 2 different user profiles in Spring Security
Good afternoon, I’m trying to validate two access profiles in Spring Security. The Admin profile and the Tecnicosup, each profile should be directed to a different Home screen. Only the Admin…
springasked 6 years, 2 months ago Luiz Fernando 23