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
votes2
answers143
viewsSpring Bean tenantEntityManager error: Unable to find column with Logical name
am having an error while trying to run my JSF application with Spring, more specifically: -I have a method to do a badge search on certain repositories and change them after running method on a…
-
0
votes1
answer112
viewsTake data array from an API via Java
I have an API with a data array. Example: "bandeiras" : [ { "bandeira": "MASTER", "status": "ATIVO" }, { "bandeira": "HIPER", "status": "ATIVO" } ] What I have to do to get the data from each flag,…
-
0
votes1
answer318
viewsDenied error when connecting spring boot to mysql
I’m trying to connect with mysql but only this error: Caused by: org.flywaydb.core.internal.Exception.Flywaysqlexception: Unable to obtain Connection from database: Access denied for user…
-
0
votes0
answers313
viewsTextarea Editable lines - Thymeleaf and Angularjs
I am building a basic document model, taking advantage of the same idea of colleague (Paulo Henrique), only that I enter the data by fields external to the form, in a previous moment of customer…
-
0
votes1
answer39
viewsError in this repeat loop. It is only taking the first value of the database
Error in this loop of repetition. It is only taking the first value of the database. You’re just doing the consultation in the first field and you’re ignoring the others. @Controller //…
-
0
votes1
answer40
viewsWhen trying to generate report I come across this error! I am using Jasper
I am using a Composite to print out reports Note: I can send the report with my City usually the problem is with the material. Menu Impressão Composite <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML…
-
0
votes1
answer68
viewsHow to restrict access to the Java API using Spring Security?
Hello. I have an API in my back-end that provides the data for my web application (web ad query application). The application has no login and password, so few registered users. It is an application…
-
0
votes1
answer395
viewsValidate log data (spring-boot + Angularjs)
Hello, I am implementing a web project in spring boot + data + Angularjs. Where the client makes Rest requests to the server. On the Spring side I’m using repositories to develop database research…
-
0
votes0
answers33
viewsContent-Disposition header is null, using Jquery $.ajax
I need to catch "Content-Disposition" header on https Response .. about a file download, but it fails. I’m using Spring (Security) REST with HTTPS. My frontend is made with Jquery. I appreciate any…
-
0
votes0
answers147
viewsSelenium with Maven plugin does not work the tests
Implementation to run a Junit and testNG test suite, When executed by the eclipse plugin, it works. By Maven no, the behavior of testNG tests, are changed, It seems that the http sessions do not end…
-
0
votes1
answer47
viewsDownload bytes docx api Rest
The code shows a method that is called by the browser to generate a PDF. The bytes were generated by Jasper. The code works normally. @GetMapping("/relatorios/teste") public…
-
0
votes0
answers59
viewsDoes Jparepository Saveall maintain the state of persistence in memory?
Jparepository offers us options save and saveAndFlush to persist the objects to the database. Unlike saveAndFlush, the save keeps the persistence state in memory, which ends up generating memory…
-
0
votes1
answer216
viewsI cannot inject Mockmvc into integration test [Spring Boot]
@RunWith(SpringRunner.class) @SpringBootTest public class CustomerRestTest { private static final String BASE_URL = "http://localhost:8080"; @Autowired private…
-
0
votes1
answer186
viewsHttpsessionlistener a single session per user
How can I make only one http session is open per user on the system. Main technologies in the project: Spring 4 JSF 2.2 Hibernate 5 Example: The user Juca, works on your computer using 3 browser.…
-
0
votes0
answers53
viewsProblems loading CSS (Spring MVC)
Good morning person, I reviewed some topics that pointed problem to load css of jsp using spring mvc , but unfortunately I could not locate the solution. I have a jsp (index.jsp) but when I request…
-
0
votes1
answer1429
viewsSpring Boot - Error java.lang.Illegalargumentexception: Not an Managed type
I’m having a mistake in Spring and I’m not getting a very good understanding of what’s going on, could you help me? LOG 09:25:43.038 [main] ERROR o.s.boot.SpringApplication - Application startup…
-
0
votes0
answers650
viewsRequest SOAP with Spring using A1 certificate
I am trying to make a Request for sending Nfe to the Sefaz SP server, but I am always receiving the certificate error not found. I created a Bean that returns the Webservicetemplate, and this is my…
-
0
votes1
answer67
viewsUsername change in token OAUTH2
I have a Rest API in spring with OAUTH2 my doubt is the following, it is possible to change the username that is written in the token of each session of OAUTH2. My problem basically is, that to…
-
0
votes1
answer140
viewsAPI testing by passing token
Good morning, I’m doing Api Testing, as follows the example: @Test public void shouldStatus200_FindAll() { RestAssured.enableLoggingOfRequestAndResponseIfValidationFails();…
-
0
votes1
answer95
viewsError while consuming Glassfish + Jersey REST web service with date that returns an xml
I need to consume a web service (WS) REST on my android app. The web service was done with glassfish, jersey and the Hibernate ORM to communicate with the database. Below is the WS code: Vegetarian…
-
0
votes1
answer53
viewsWhen modifying a data before sending to Query it updates the table
I’m doing a query select with spring + Hibernate, Query query = em.createNativeQuery(sqlBase); I am passing to the 'sqlBase' a Company as parameter, SELECT e.* FROM Empresa e WHERE e.id = :empresa…
-
0
votes1
answer153
viewsModelling View Controller Unit Test with Mockite and Spring
I need to mount the unit test for the controller below (for example only): import javax.servlet.http.HttpServletRequest; import org.springframework.web.bind.annotation.GetMapping; import…
-
0
votes1
answer416
viewsSpring Data JPA: How to Project Data?
I’m following a tutorial to make projection based at this link. However, it seems that the application is generating an error in the serialization of the data emitted by the reflection of Jackson.…
-
0
votes1
answer166
viewsProblem when saving date in mysql database with spring
I am trying to save a date in the database using spring + jpa in mysql. In my class I have the following field: @Column(name = "dataNasc") @DateTimeFormat(pattern = "yyyy-MM-dd") @NotNull private…
-
0
votes0
answers397
viewsChat in Spring JSF and Primefaces
I need to develop a chat for our website. Developed in: JSF 2.2 Srping 4.2 Hibernate 5 Primefaces 5.3 Css bootstrap I already downloaded a project from github, it works cool but is very poor, wanted…
-
0
votes1
answer46
viewsDoubt about layers needed in a simple Gateway made in STS
I made a web service json/Rest that plays the role of a gateway, the client sends the request to an endpoint, but the gateway replicates the request for various services. In it, I just pass the…
-
0
votes1
answer21
views" 'case' is not a Valid Java identifer"
I have a question. I am trying to create a springboot project from scratch, but when I try to change the name of my package, I have this problem. When I put any name other than "case" in the middle…
-
0
votes0
answers56
viewsNullpointerexception Modelmapper
I’m using Modelmapper, I created a Mapper class where I have some methods that converts dto to a model and vice versa, it turns out I’m getting a nullPointerException when using these methods of the…
-
0
votes1
answer51
viewsSpring with Database (Sqlserver) already created
I’m developing an application Rest API using Spring Boot. Doubt: If I already have a Database in production with populated tables it is necessary to create the Entity class with the annotation…
-
0
votes0
answers113
viewsSend java image to javascript
I’m developing a web service Rest with Spring in Java which provides images to front-end, which calls Java with an ajax event. On the server side I am using java Image. import java.awt.Image; I…
-
0
votes1
answer313
viewsData being deleted from H2 database with Spring Boot
I am making an application with Spring Boot and using the H2 bank. When I register a person, they get id 1, if I register someone else gets id 2 and so on, only if I restart the bank I lose…
-
0
votes0
answers24
viewsA Restcontroller bean at the same time being a Configuration bean and a Component bean hurts SRP?
In a Java application with Spring I came across a class annotated as follows: import ... @Component @RestController @Configuration public class MySender { ... } At first glance I suspected that…
-
0
votes0
answers16
viewsError with the orphanRemoval
I’m trying to use orphanRemoval for the TCC project and I’m having trouble, I think it’s dependency. @ManyToMany(cascade = CascadeType.ALL, orphanRemoval = true) private List<ReadingTarget>…
-
0
votes1
answer36
viewsHow to deal with duplicity exceptions in Constraint Unique?
Speak devs, all right? How best to deal with duplicity errors when trying to create field with Constraint Unique? Just let the exception happen? Or I a findByAlgumCampo and if it already exists I do…
-
0
votes1
answer3383
viewsUpload and download image to project folder using Spring Boot
I am developing a web module that I need to upload an image. Save to the project folder, I am using Apache’s Commons Io: public class FileUtil { public static void saveFile(String path,…
-
0
votes2
answers58
viewsProblem with persistence with spring
The mistake: java.lang.Illegalargumentexception: Not an Entity: class br.com.api.entities.Characters My Class package br.com.api.entities; import java.time.LocalDateTime; import…
-
0
votes0
answers8
viewsHow to perform conditional tests on specific properties of Aplication.properties in Gradle?
I am trying to do something similar to -x test, but I want it to be conditional on the property spring.profiles.active of application.properties, if it is in test, as follows.…
-
0
votes2
answers928
viewsJava Rest Client Receiving a Localdate
I’m doing a test client in java. My book class is like this: public class Livro { private Long id; private String nome; @JsonFormat(shape = JsonFormat.Shape.STRING,pattern="dd/MM/yyyy") private…
-
0
votes1
answer1669
viewsHow to implement Lombok in the Spring Boot project
I’m in trouble in this class, take a look @Service public class CadastroEstiloService { @Autowired private Estilos estilos; @Transactional public void salvar(Estilo estilo) { Optional<Estilo>…
-
0
votes1
answer68
viewsError Spring MVC Rest Full
Good night, I’m trying to compile a code to run a simple Rest in spring mvc, but found with the error "The request sent by the client was syntactically incorrect." Class Controller package…
-
0
votes0
answers175
viewsSaving dynamic data in the same Java identity
I’m using Spring MVC, Thymeleaf and for me with all routes built he did automatic but not this working, Entity, Repository, controller and etc. I have a relation of N=N of course to Turn, of that…
-
0
votes1
answer550
viewsIs it possible to inject a bean into a Singleton with Enum?
We have a system that uses Struts 1 and enum-based singletons. Now we have a dependency that was written using Spring 4.3.6.RELEASE that should only be used with other systems that also use Spring,…
-
0
votes1
answer667
viewsFilling and sending forms with Spring MVC and JSP
I am initiating into Java Web, developing a stock system following Caelum’s Java for Web workbook. The whole front-end and the persistence layer have already been developed leaving only the control…
-
0
votes1
answer78
viewsField List of a jsp
This field is filled in correctly by a query made in the DAO. The problem is that you are not accepting the object as null or as the value by the ID. The entity’s field is Man Entity @ManyToOne…
-
0
votes1
answer443
viewsPrint a Java Object List
When making a filter of courses belonging to a given shift , the correct thing would be to make a foreach by walking through an object , but by doing so he gives an error ';' expected , I didn’t…
-
0
votes1
answer74
viewsError nullpointer when query in database with parameter
When I run the query below I have a nullPointer error. @Query(value = "SELECT * FROM x WHERE USER_NAME = :name", nativeQuery = true) DataBaseCobilling findByCdIdent(@Param("name") String name); But…
-
0
votes1
answer651
viewsHow to implement an authentication service in a SOA project
I am developing a project using SOA where I have a web application made in Angular 2 and several micro services in Spring Boot, among the services there are authentication and notification services…
-
0
votes1
answer4559
viewsError resolving template "Meutemplate", template Might not exist or Might not be accessible by any of the configured Template Resolvers SPRING
Performing an ajax request function buscarDisciplina(){ var codigoDisciplina = String($("#codigo").val()); $.ajax({ url: urlApplication+"/grade-curricular/buscar-disciplina/"+codigoDisciplina, type:…
-
0
votes1
answer84
viewsHow to write this xml bean using java?
<bean id="templateEngine" class="org.thymeleaf.spring4.SpringTemplateEngine"> ... <property name="additionalDialects"> <set> <!-- Note the package would change to…
-
0
votes1
answer52
viewsSpring Security 4.2.1.RELEASE + SSO CAS (jasig 4.0.3)
I am using the CAS (Jasig) with three applications, when I log out of one of the applications I finish the session of the same and the CAS, but if I access another application that was already with…