Questions tagged as 'spring'

1
answer

Change Active Spring Profiles at run time

I usually use this code snippet to set the profile of the application <servlet> <servlet-name>dispatcher</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <init-p...
asked by 25.03.2014 / 18:12
1
answer

Repository not found when starting SpringBoot

I'm running my spring boot project with connection to mysql and it's giving the following crash:    Description:       Field er in com.eventoapp.controllers.EventoController required a bean   of type 'com.eventoapp.repository.EventoRepositor...
asked by 13.05.2018 / 16:26
1
answer

JWT token with spring, for user authentication

When trying to validate this method: Jws<Claims> parseClaimsJws = setSigningKey.parseClaimsJws(token); , it shows this exception on the screen JWT signature does not match locally computed signature. JWT validity cannot be asserte...
asked by 29.03.2018 / 00:34
0
answers

A help with annotations with Spring Boot

A help with annotations ... Today my tests are like this: @ConfigA @ConfigB @ConfigC @ConfigD public class MeuTesteA {} @ConfigA @ConfigB @ConfigC @ConfigD public class MeuTesteB {} See, I have to repeat many configuration annotations. To...
asked by 18.05.2018 / 21:45
0
answers

How to change the @GeneratedValue used by Spring through Spring's AbstractPersistable class?

I'd like to use @GeneratedValue(strategy = GenerationType.SEQUENCE, ... ... when I'm extending the class AbstractPersistable , but I do not know if that's possible. From what I saw in the documentation, the class AbstractPersi...
asked by 19.05.2018 / 12:41
2
answers

API method fetches information but does not appear on the front end

I have a method of my API that searches the database @RequestMapping(method = RequestMethod.GET, value = "/entidadesUsuarioPermissao/{id}", produces = MediaType.APPLICATION_JSON_VALUE) public ResponseEntity<Collection<PermissoesPagin...
asked by 24.10.2017 / 13:29
0
answers

Spring Boot connecting to the Microsoft Sql Server database

I'm trying to connect to SQl Server 2008, but I'm giving this error:    com.microsoft.sqlserver.jdbc.SQLServerException: Failed to connect to host ERSERVER, named instance \ sqlern_desenv. Error: "java.net.SocketTimeoutException: Receive time...
asked by 25.10.2017 / 17:56
1
answer

Problems with improper access to urls in the application with Spring Security

I have a page that uses thymeleaf to update a user's profile and on this page there are two buttons that allow you to update the profile and the other button allows you to remove profile from the application. Once the user is authenticated he...
asked by 02.10.2017 / 16:28
1
answer

Result of the GET method brings all the relations and the subrelations of the bank

I have an application in which I have a list screen I'mdoingaGETmethodonmySpringBootAPIClasscontroller@RequestMapping(method=RequestMethod.GET,value="/distritos", produces = MediaType.APPLICATION_JSON_VALUE) public ResponseEntity<Coll...
asked by 05.10.2017 / 16:04
1
answer

Repository - Records Filter according to user's permission

Searching on how to filter the records with the repository, I found the annotations: @PreAuthorize @PreFilter @PostFilter You have 2 Roles in the system: ROLE_ADMIN and ROLE_USER where ROLE_ADMIN can access all records, ROLE_USER can...
asked by 06.04.2017 / 17:06