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
-
3
votes1
answer110
viewsIs it correct to use @Mappedsuperclass instead of @Entity to not create a table in the database using JPA?
Explaining the problem, I need to consult a function in POSTGRES: SELECT * from pgr_dijkstra('SELECT gid AS id, source, target, length AS cost FROM ways', 11111, 22222); "pgr_dijkstra" is a POSTGIS…
-
2
votes2
answers129
viewsAlternative Flow in Spring
Faced with the situation: I am on the registration screen of cars, where I can select the brand and type the model. In case I need to register a model that does not have the brand previously…
-
2
votes1
answer109
viewsChange Active Profiles Spring at runtime
I usually use this code snippet to define the profile of the application <servlet> <servlet-name>dispatcher</servlet-name>…
-
2
votes2
answers186
viewsDB Dinamico Mongodb
I’m starting a web project and I’m thinking about using java with mongoDB and Spring data. In this web project, each user would have their own database. That is, when the user logs in (this yes…
-
2
votes1
answer1097
viewsHibernate: Error while trying to persist field that maps foreign key
In my current Spring project, I am facing the following problems when trying to save one entity that refers to another (with foreign key), with this: @Entity @Table(name="pagina") public class…
-
2
votes2
answers1399
viewsConfigure Hibernate transactions only with Jersey API Annotations
I want to use something similar to org.springframework.transaction.annotation.Transactional Spring that configures a Transaction only using only the Jersey API. Something similar to the code that…
-
2
votes1
answer577
views -
2
votes1
answer72
viewsError running Spring Roo
I am trying to install and run Spring Roo. I downloaded it, unzipped it in the opt folder, gave the permissions in the folder and created the links. But when running the command "Roo" a big error…
-
2
votes1
answer1217
viewsSpring Bean sessionFactory with Nullpointerexception error
Good morning. I am trying to make a configuration in the spring-jpa.xml file to support a multitenancy architecture separating each client by Schema. I use a datasource that has been configured in…
hibernate spring jpa-2.0 wildfly multi-tenancyasked 9 years, 9 months ago Giancarlo Abel Giulian 3,999 -
2
votes1
answer429
viewsProblem configuring spring data jpa project with Hsqldb
I am trying to set up a project example using Spring Data JPA with Hsqldb I made the class I would be model, to interface repository and a main class to run. I didn’t create the bank because I have…
-
2
votes1
answer1372
viewsUpdate column and table settings with Hibernate
Good afternoon. I would like to know and confirm if you have any way to update table and column definitions in each schema using Hibernate. For now, what I’ve seen so far is that Hibernate only…
-
2
votes1
answer649
viewsSpring Framework in modular design by Apache Maven
I created a modular web project using Apache Maven with the following structure: proj-build |--- proj-utils |--- proj-persistence |--- proj-services |--- proj-web `--- proj-ear Description…
-
2
votes2
answers2187
viewsExtend findAll with custom filters
I am trying to extend findAll from my JPA repository to make custom filters. I did some research and found some ideas of use with Predicates and the like but did not identify something that worked…
-
2
votes1
answer2863
viewsJava how to do a native query and return to a DTO list
I am using Spring Hibernate and am trying to make a native query with Join back to a DTO list. I tried using @Query(value="", nativeQuery=true) with a List but it returns the serialized attributes.…
-
2
votes1
answer34
viewsCapture exceptions in spring
I’m using Spring and wanted to know how I can return the errors (Exception) from @Repository and/or @Service to my webservice? I have the following structure: [ Webservice ] ------ […
-
2
votes1
answer710
viewsDoubt with Spring dependency injection (injected object returning null)
good afternoon to all. Guys, I have a little problem that I should probably be missing or forgetting the order of something. My case is that I have one two controllers. One of them I call…
-
2
votes1
answer96
viewsIs it possible to have multiple form-login with Spring Security in the same application?
Well the starting question may seem a little confusing, but basically I would like to know if it is possible to have more than one spring validation form security:form-login, because I have in my…
-
2
votes1
answer104
viewsClient side deleted object instance and sends to the server
I wonder if anyone has ever been through this problem and how did you solve it. I am using JSP and Spring Data JPA. I delete records from the middle of a form that’s a detail using Javascript,…
-
2
votes2
answers634
viewsChange in audit in Java+Spring+Oracle application
I am tasked with changing an audit implementation in an application in which I work. The requirement of the audit is to know the history of changes, and execution of certain tasks by a given user.…
-
2
votes1
answer364
viewsInterceptor at Spring MVC
I made an Interceptor so that every time the system had a message to display trigger a javascript with the message. public class MessagesInterceptor extends HandlerInterceptorAdapter { public static…
-
2
votes2
answers873
viewsApache Commons Email does not send email using Gmail
Click here to open the repository in Maven Repository for Apache Commons Email. I have the following code that receives from a form the recipient, subject and the message: @RequestMapping(value = {…
-
2
votes1
answer5362
viewsWhat is the purpose of the @Transactional(readonly = false) annotation?
Annotation used for service injection in the Spring Framework.
-
2
votes1
answer79
views$http error with Ionic and spring
have an API with spring framework follows the method below: @RequestMapping(value = "/users", method = RequestMethod.GET) public @ResponseBody ResponseEntity<List<Usuario>> listUsers ()…
-
2
votes0
answers258
viewsChanging the Spring Security Core and Groovy Grails login form
Good afternoon, I made a change in my application to use my login form instead of the standard Spring Security Core, the redirect is occurring normally, however when clicking the Login button…
-
2
votes1
answer113
viewsSpring Loaded is not working
I have a Spring 3.1.4 project and I’m setting up the spring-loaded follows the image below: The Tomcat performs well but the spring-loaded is not working any change I have to raise Tomcat again.…
-
2
votes1
answer623
views -
2
votes1
answer267
viewsJSP page being displayed as Java Spring text
My JSP page is being displayed as text. I’m using Spring and Spring Security. When I open the link for my browser page it opens as text (All HTML appears written on the screen as if I had opened the…
-
2
votes0
answers170
viewsHow to Run Pivotal TC Server with Eclipse Luna?
I’m studying the use of Spring Security, and as the tutorial on this link, you need to use the STS - Spring Tool Suite, however as I already have my installation of Eclipse of daily use, I installed…
-
2
votes1
answer863
viewsModel attribute unit tests in spring boot application
Good afternoon I don’t have much experience with unit testing. I’m testing controllers in a spring boot application, but I made some error in testing model attributes, which apparently isn’t even…
-
2
votes2
answers7155
viewsProblem with Spring "No Qualifying bean of type found for dependency"
Hello, I’m learning a little bit about Spring and I’m having a problem that I can’t get around in any way. I’ve been looking for solutions to this mistake for a long time, but I couldn’t find…
-
2
votes0
answers492
viewsBeanfactory not initialized or already closed - call 'refresh' before accessing Beans via the Applicationcontext
I have this error at the time of running my application: 05-Oct-2016 21:18:25.586 SEVERE [localhost-startStop-26] org.apache.catalina.core.StandardContext.listenerStop Exception sending context…
-
2
votes1
answer649
viewsJSF 2, CDI 1.1, Springsecurity 4: Custom login form does not redirect to page
I’m making an application with JSF 2, Springsecutiry 4 and CDI 1.1. I did the entire implementation of Springsecurity with JSF and apparently everything worked normally, but when making the custom…
-
2
votes1
answer288
viewsHow to limit a relationship 1 to many JPA?
I’m using JPA with Spring Framework on a project, I would like to limit a relationship 1:n, want to do 1:5, how do I do that? This is the relationship: @ManyToOne private Task task;…
-
2
votes1
answer666
viewsorg.xml.sax.Saxparseexception; lineNumber: 10; columnNumber: 24; Attribute "Singleton" must be declared for element type "bean"
I am upgrading a (old) project to the latest libraries, such as Spring (from version 3.2.4.FINAL to version 4.3.11.FINAL). One of the errors that appears in Tomcat 6 is:…
-
2
votes0
answers558
viewsjava.lang.Nosuchmethoderror: org.jboss.logging.Logger.debugf. Glassfish 4.1, Hibernate 5.2, Spring 4.3
I cannot upload an application to Glassfish 4.1. It seems to me that the problem is dependency org.jboss.logging I already added it to the project in version 3.3.0 but the error persists. The…
-
2
votes1
answer119
viewsRedo the Spring cache?
It is possible to schedule that the Spring cache is always redone at midnight? I read the Springs Cache Docs and I found nothing about how to get him to be regenerated.…
-
2
votes1
answer252
viewsGeneric dialog on Hymeleaf
Good evening friends, Has anyone ever tried or done a generic dialogue on Hymeleaf? What I want is: Instead of writing code to confirm the deletion of a data on the screen that is something simple,…
-
2
votes1
answer311
viewsRepository - Record Filter according to user permission
Searching on how to filter records with Restpository, I found the annotations: @Preauthorize @Prefilter @Postfilter It has 2 roles in the system: ROLE_ADMIN and ROLE_USER and ROLE_ADMIN can access…
-
2
votes0
answers635
viewsHow to fix encoding problems on a web application page?
I am developing a JAVA application with the Spring framework v3.1.0, however, when trying to access a page shows error of encoding: Evolu㧠How to solve this problem? I found several ways, but none…
-
2
votes1
answer580
viewsSpring @Scheduled with internal transaction triggering Propagation error
I am trying to run a service that is based on running by cron with annotation @Scheduled, but every time a database transaction needs to be opened within the annotated method with @Scheduled receive…
-
2
votes1
answer217
viewsClient sending String[] instead of Bigdecimal to server when changing
When it’s a re-registration works peacefully, the problem is in the alteration. I own an object To who is the master, another object B which is a ArrayList and detail of the master To and finally,…
-
2
votes1
answer141
viewsSpring instantiating object with @Value
In my application.properties has the algumaCoisa=joao, and when I spin the java -jar nomedo.jar, it comes null, someone can explain to me why this happens and how I arrange? @Component class…
-
2
votes1
answer220
viewsService Discovery Eureka Netflix
I have an architecture SOA with two stacks different with java and other with ruby, I have a microservice using spring boot and other Rails, and I’m trying to set up a Discovery Service with Eureka…
-
2
votes1
answer210
viewsCustomize error page to connect timed out in Spring
I’m trying to create a friendly error page in case LDAP is off the air, but unfortunately the only answer I have is j_spring_security_check. I tried to map the exception in web.xml, but I was…
-
2
votes0
answers96
viewsWildfly in production does not recover properties and SQL script values
I am using a development environment and another production environment, in the development environment using the concept of i18n (Internationalization) is recovered correctly for example the value…
-
2
votes1
answer717
viewsError 403 Forbidden while consuming CEP webservice
I’m trying to consume a webservice of ceps but always returns me 403 and it is public. Testing the Working Webservice : http://apps.widenet.com.br/busca-cep/api/cep.json?code=01001000 My Controller…
-
2
votes1
answer58
viewsError creating database with Hibernate and Spring MVC
I have a problem running the application. Error... ERROR [org.springframework.web.servlet.DispatcherServlet] (ServerService Thread Pool -- 58) Context initialization failed:…
-
2
votes1
answer1812
viewsUses of @Bean and @Autowired notations and what are they for?
I have difficulty understanding these two notations and what they are for. I read documentation and some answers about, and from what I understood @Bean would be an instance creation of a class, and…
-
2
votes2
answers2377
viewsWhat’s the difference in using Modelandview and Responseentity?
I came across these two classes, I found their function quite equal. What are the differences between them and when is the time to use a specific?
-
2
votes1
answer807
viewsHow to make a find with Pagination and search term at the same time with Spring data?
Hey, here’s my question. I want to do a search by passing a Pagerequest and an Object or some search terms and get a list back. For example: List getList(Pagerequest page,Person person person); In…