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
-
4
votes2
answers430
viewsCut bidirectional relationship looping
I am with a Spring project, using JPA and liquibase, I have a bi-directional relationship between two entities, I wonder if anyone has a solution to the problem of infinite referencing between the…
-
4
votes1
answer90
viewsFormat Time using initBinder
I need to catch the time with the "hh:mm" format but it is not working, follow the error also to better specify: Whitelabel Error Page This application has no Explicit Mapping for /error, so you are…
-
4
votes1
answer152
viewsBean and Annotations with Generics, how to do?
I am in a project with Spring 4 configuring the Redis and a construction like this has emerged: @Configuration @ComponentScan({"com.empresa.sistema.web.util"}) public class RedisConfig { @Bean…
-
4
votes1
answer348
viewsValidation of quantity of sessions with spring boot and spring security
I need to validate the number of sessions that may exist, so that the user cannot log into two places at the same time with the same credentials. Reading the Spring Security documentation and posts,…
-
4
votes1
answer157
viewsProblem generating javascript graph using Spring
I’m implementing Graphics in a web application I’m developing in Spring. I already made my API, it is bringing Json with all the information of my object Cart, however the graphic is not being…
-
4
votes1
answer661
viewsJava spring: Infinite recursion (Stackoverflowerror) error
I’m having trouble carrying out the method list of translations of the document, I’m not understanding the reason for the error, follows code: Translation.java @Getter @Setter @NoArgsConstructor…
-
4
votes2
answers163
viewsHow to pass numbers between "{ }" in the url?
I’m having a dumb doubt in some exercises using Spring Boot. The exercise requires that I receive the list of numbers as follows: http://localhost:8080/listaDecrescente?lista={12,55,70,22} And…
-
4
votes1
answer463
viewsHow to schedule a task and run only once independent of the number of instances?
My application has a scheduled method to run every 5 minutes with the @Scheduled of Spring, but I would like to rise more than one instance of implementation and that this task should not be carried…
-
3
votes1
answer71
viewsFilecopyutils of Spring With strange behavior
I don’t know if anyone here uses the Filecopyutils offered by Spring, but I’m using it in a imaging replication method in my system. It aims to "grab" the images that are in my system’s temp folder…
-
3
votes2
answers472
views@Autowired bean in Filter
I’m trying to inject a bean in a filter but without success, the same always remains null causing error. Below follows the code of bean: @Named @Scope("session") public class LoginBean { Of filter:…
-
3
votes1
answer741
viewsUpdate all schemas with multitenancy architecture
Good morning. Next, I have a multitenancy application using Hibernate with JPA. We recently implemented the multitenancy architecture and persistence.xml was configured to automatically update the…
-
3
votes1
answer130
viewsin.createNativeQuery executes first than in.persist and now?
I’m developing an application with Hibernate + Spring mv. spring takes care of the Entitymanager dependency for my DAO, but I have the following problem. i persist an object called User then I run…
-
3
votes1
answer672
viewsHow to check if my spring application is in production environment?
when it is in production I want that when it falls into an exception send an email to the support but only in production , in development I do not want it to perform this task .
java spring spring-mvc spring-security spring-bootasked 9 years, 3 months ago Jose Vieira Neto 2,560 -
3
votes1
answer226
viewsHow to implement Service Layer with Spring?
Does anyone know any tutorial, examples... any source to learn how to implement service layer?
-
3
votes1
answer273
viewsCustom Session generated by spring
I have the following scenario: an application nodejs that saves the session in redis. another spring q application also saves the session in redis. I would like to share this same session between…
-
3
votes1
answer377
viewsCopy Outputstream object to a file
I confess it’s the first time I’ve worked with Stream’s and File in Java. Currently I use the Spring (Core) in my application, I soon use a simple copy utility feature stream’s and file’s called…
-
3
votes0
answers124
viewsPass Spring object to JSF
Well, I have a class that is almost entirely populated with Facebook data, but two attributes are missing that have to be filled from data coming from a form. Here is the form:…
-
3
votes1
answer1677
viewserror: cannot find Symbol - Maven install with class Folder
I have a Maven eclipse project that uses a Folder class. That folder has the . java and .class. The classes I use in the project are in build path as class Folder, when I do Maven install it gives…
-
3
votes2
answers454
viewsHide screen options if user does not have permission
I’m having a hard time in a web application I’m creating here, I’m using spring security to control access, session and login, with backend java with restful and frontend with primefaces. I wonder…
-
3
votes1
answer171
viewsIs it possible to send all Java Exceptions by email?
I have a Java Web application, using Spring MVC, and would like to email all Exceptions released on the system. Is it possible to do that? Set up a default email to receive all Exceptions and…
-
3
votes2
answers1288
viewsExecution cannot find 'org.junit.Assert' even if you have the Junit jar in classpath
I have a problem that I’ve done a lot of research on and I haven’t found the answer to yet. I have a test case I’m trying to run and send a message to the console. But even though he has Junit’s…
-
3
votes2
answers446
viewsJava Spring Extender @Scheduled to read a file
I have tasks to do as soon as I top up my application, they run over and over again that way: @Scheduled(fixedRate = 10000) public void scheduleFixedRateTask() { System.out.println("Fixed rate task…
-
3
votes1
answer73
viewsIs it possible to know which JEE Container is being used during Dispatcher Servlet startup?
After some difficulties with the use of the Spring Security and JBoss using annotations based on API Servlet 3 (Servlet 3.1 more specifically), I discovered that when using Spring with JBoss, in…
-
3
votes1
answer811
viewsAuthentication with Spring Security
Hello, I am doing a project using the Spring Framework, and I need to do a very simple authentication, using users created in the user table even (without any integration with social networks). But…
-
3
votes2
answers302
viewsQuestions about the Spring XML file?
I am developing an application that uses JAVA SE + SPRING. I have some questions regarding XML: Where I create the file xml of Spring ? What name do I give to the arquivo xml ? XML would be the…
-
3
votes2
answers366
viewsConvert Spring XML declaration to Java code
Can someone help me convert the Spring XML code that is just below into a Java code? <bean id="templateEngine" class="org.thymeleaf.spring3.SpringTemplateEngine"> <property…
-
3
votes1
answer3287
viewsAngularjs and Java backend
Hello, I am ceasing to use the JSF framework to start using Angularjs. I wonder if someone has an example of integration between Angularjs with Java Back-end, so I can see how the Front-end…
-
3
votes1
answer1585
viewsGenerate Runnable Jar from a Maven project
I am having difficulty generating a Jar file from my application from Maven, I followed the following tutorial. Mkyoung.com It comes to generate the Jar but with a super reduced size and at the time…
-
3
votes2
answers566
views400 (Bad Request) when sending array to Spring Controller using AJAX
POST http://localhost:7001/app/workflow/execute/ 400 (Bad Request) I’m getting this error when trying to send 2 array’s to my Spring controller, but I’m getting this error, tried some solutions I…
-
3
votes0
answers464
viewsPostgresql Nosql and integration between relational and non-relational databases
I have been researching about Postgresql Nosql and found the concept of Key-Value Stores in some publications, also from HSTORE. I also researched the integration between Postgresql and the Spring…
-
3
votes1
answer100
viewsSpring MVC error in performing Binding of checkboxes on a list of objects
I have the following piece of code in my .jsp, in which the objective is to dynamically list a passenger list per customer. <f:form id="service-item-form" action="${action}"…
-
3
votes2
answers377
viewsDoubt regarding the management of JPA with Spring in JEE server
I’m starting in Spring MVC and in the book I’m reading the configuration and management of connections is all done by Spring, IE, Spring opens and manages connections with the bank and makes it…
-
3
votes2
answers160
viewsAnnotation @Scheduled Spring check environment
I have a controller annotated with @Scheduled but when the test environment is active it also runs. It is possible to check the environment in which application is running so that the method is run…
-
3
votes2
answers3143
views.antMatchers(). permitAll() does not seem to work
Edit02 Habilitei spring-security in my project, and now every API needs authentication, perfect was what I needed. But I want only one API not to need authentication. I tried to use…
-
3
votes0
answers454
viewsHTTP Status 500 - Request Processing failed; nested Exception is java.lang.Illegalargumentexception: Datasource must not be null
When making a query in a dao class, the following error appears: my spring-context.xml is: <mvc:interceptors> <bean…
-
3
votes2
answers4675
viewsException Treatment REST Spring Services
In a REST service application with Spring, where should the exception handling/release take place? In the Controller or Service? Example 1 - Handle in Controller (In this case I’m only returning a…
-
3
votes2
answers185
viewsRelation between bean and view
I have three views that show the same table with a sequence of leds and information, I have a class service that makes the business logic to know which led and which color to show, in my bean…
-
3
votes2
answers287
viewsHow to avoid Lazyexceptions?
My application faces numerous Lazyexceptions problems and what causes a "mess" in the server log. I understand that they occur because the connection to the database has already been closed and I am…
-
3
votes1
answer349
viewsJWT 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…
-
3
votes1
answer121
viewsMbean named conflict when climbing two Spring Boot applications in the same Tomcat
I have two applications in Spring Boot that use a common nomenclature for Beans. In case, man pool of connections to the database is managed by Hikaricp. Due to an infrastructure problem, I had to…
-
3
votes0
answers103
viewsScheduled cron message sends three times
Hi! I have a routine on a JSF+Spring 3.0.5 system that sends an email containing 4 attachments in pdfs on every 11th day at 07:01 AM to 11 addresses. My problem is that when the application is in…
-
3
votes1
answer770
viewsStrategy Pattern with Spring Boot
I’ve been looking for solutions for Strategy Pattern with spring boot, but nothing I’ve found so far seems performatic or even functional. I have an interface like: public interface UserService {…
-
3
votes0
answers120
viewsDoubt with Loadbalance and Circuitbreaker in Microservices
I have a service structure as follows: server (Eureka), immovable (Eureka-client) and client (Eureka-client). The customer service makes a request for immovable service, using feign. I own the…
-
3
votes1
answer140
viewsI can’t access a form page
I am doing a course of Alura of Spring framework, but I can not access a form page through the link http://localhost:8080/casadocodigo/products/form. Gives the following error: HTTP Status 404 - Not…
-
3
votes1
answer219
viewsSpring - Thread Dependency Injection
I need a little help. I’m doing some tests with Spring Boot and I have my services + some processes I want to run in thread. Each thread will run its own service. When I inject service dependency…
-
3
votes1
answer224
viewsProblem to write foreign key to table
I am developing a web java project - using Spring , Thymeleaf , Html, Mysql . In this project I have two classes that are related by foreign key. (Technical and Position). In my view…
-
3
votes1
answer1474
viewsJava Spring Boot - Read a file from the Resources folder inside a . jar
I am writing a class that will read an ETL Pentaho Kettle (transformation). I have put the file that the class will read in the Resources / KTR folder. But when I try to run the code as a java…
-
3
votes1
answer53
viewsSpring Rest - Use of Various Services and Repositories
I have a question about how best to implement some services with the Spring Rest, but I couldn’t find the material for this case: Let’s say I have a launch service (Lancamentoservice). This service…
-
3
votes1
answer709
viewsCustomization Spring Security 403
Fala galera! Follow my lead: I have an application with JWT authentication. The authentication is done in the database and I need to add now 2 more validations: failed count on login and registered…
-
3
votes1
answer547
viewsRun a Spring Batch job several times
By default, Spring Batch does not allow you to execute a job that already has a complete execution with the same parameters. If you try to run, get the message: "A job instance already exists and is…