Questions tagged [spring]

The Spring Framework is an open-source framework for application development on the Java platform. At its core is rich support for component-based architectures, and it currently has over twenty highly integrated modules.

The Spring Framework is an open-source application framework for the Java platform.

Spring is a non-invasive, versatile, robust framework.

Spring framework complements the Java EE APIs but is not a replacement for Java EE. It reduces most boilerplate code, reducing the burden on developers.

Spring provides services and functionalities across the application domain, including a core Inversion of Control container, technology-agnostic data-access and MVC layers, extensive AOP support, task scheduling, and various integration patterns designed to make distributed system development more uncomplicated and more straightforward. While some Spring modules are simple wrappers and helpers over the Java EE specifications, most go far beyond the Java EE specification.

The latest Spring Framework Reference Documentation can be found here.

Spring version history:

Version    Date   
5.2.x    Dec, 2020
5.1.x    Sep, 2018 
5.0.x    Sep, 2017 
4.3.x    Jun, 2016 
4.2.x    Jul, 2015 
4.1.x    Sep, 2014 
4.0.x    Dec, 2013 
3.2.x    Dec, 2012 
3.1.x    Dec, 2011 
3.0.x    Dec, 2009 
2.5.x    Nov, 2007 
2.0.x    Jun, 2006 
1.2.x    Mar, 2005 
1.1.x    Jul, 2004 
1.0.x    Feb, 2004 

Frequently Asked Questions

People often ask about the following Spring topics:

Guides:

Video tutorial on Spring Framework

Examples:

Blog:

Related tags

More information:

Official Logo:


Spring logo

208702 questions
39
votes
7 answers

Hibernate/Spring: failed to lazily initialize - no session or session was closed

For an answer scroll down to the end of this... The basic problem is the same as asked multiple time. I have a simple program with two POJOs Event and User - where a user can have multiple events. @Entity @Table public class Event { private Long…
Niko
  • 6,133
  • 2
  • 37
  • 49
39
votes
8 answers

How to configure rolling file appender within Spring Boot's application.yml

Is is possible to configure a daily file appender within the application.yml of a Spring Boot application? i.e. filenamePattern: myfile.%d{yyyy-MM-dd-HH-mm-ss}.log I have configuration such as the following in my application.yml file. logging: …
ele
  • 471
  • 1
  • 5
  • 15
39
votes
3 answers

How to use spring Repository without @Id?

I'm using spring CrudRepository throughout my application. Now I want to also create one for an @Entity that does not have an @Id. Is that possible at all? //probably ID is always required? public interface Repository
membersound
  • 81,582
  • 193
  • 585
  • 1,120
39
votes
4 answers

How to access Spring-boot JMX remotely

I know that spring automatically expose JMX beans. I was able to access it locally using VisualVM. However on prod how I can connect to remotely to the app using it's JMX beans? Is there a default port or should I define anything in…
rayman
  • 20,786
  • 45
  • 148
  • 246
39
votes
4 answers

Thymeleaf: check if a variable is defined

How can I check if a variable is defined in Thymeleaf? Something like this in Javascript: if (typeof variable !== 'undefined') { } or this in PHP: if (isset($var)) { } Is there an equivalent in Thymeleaf?
Andrea
  • 15,900
  • 18
  • 65
  • 84
39
votes
4 answers

JPA column with incorrect underscore

I use JPA for database access and annotated every column with the correct name. Now if I execute a query (e.g. findAll()) it returns Unknown column 'program0_.program_id' in 'field list' The error message is correct program_id is unknown because…
KenavR
  • 3,769
  • 9
  • 37
  • 47
39
votes
4 answers

Spring @Repository best practices

Context: Web application I haven't used Spring before, but according to the Spring docs, all the beans are singleton, unless we declare them as prototype. Without using Spring: Normally I instantiate new DAO when there is a call to the…
sura2k
  • 7,365
  • 13
  • 61
  • 80
39
votes
6 answers

Can spring mvc trim all strings obtained from forms?

I know struts2 default config will trim all strings obtained from forms. For example: I type " whatever " in a form and submit, I will get "whatever" The string has been auto trimmed Does spring mvc have this function too? THX.
Gordian Yuan
  • 4,750
  • 6
  • 29
  • 35
39
votes
4 answers

How to resolve Error listenerStart when deploying web-app in Tomcat 5.5?

I've deployed an Apache Wicket web-application that uses Spring and Hibernate to my Tomcat 5.5 instance. When I navigate to the Tomcat Manager interface I see that the web-application I deployed is not running. When I press 'Start' I get the…
John
  • 2,571
  • 6
  • 32
  • 40
39
votes
5 answers

Spring Boot + Spring-Loaded (IntelliJ, Gradle)

I'd like to use hot swap with my Spring Boot project. Somehow I am not able to make it working by running it in my IDE (IntelliJ), despite of having this topic covered by documentation. I simply run the class with my main method with VM…
kuceram
  • 3,795
  • 9
  • 34
  • 54
39
votes
4 answers

Hibernate Envers with Spring Boot - configuration

I'm trying to setup Hibernate Envers to work with my Spring Boot application. I've included the Envers dependency and added @Audited annotations and it works fine, but I'm unable to configure specific Envers properties, Spring Boot doesn't seem to…
Milan
  • 1,780
  • 1
  • 16
  • 29
39
votes
3 answers

Why I received an Error 403 with MockMvc and JUnit?

I have a spring mvc (3.2.5) application with spring security (3.2). I configured my SecurityConfig.class with this method : @Override protected void configure(HttpSecurity http) throws Exception { …
Jonathan Lebrun
  • 1,462
  • 3
  • 20
  • 42
39
votes
4 answers

Repeatable not found when using Spring 4 PropertySource

we are using Spring 4.0.1.RELEASE in combination with jdk6 (this is fixed). Of course we have done the config in Java with usage of the @PropertySource annotation. This leads to an annoying warning message(s) when we compile the project with…
meistermeier
  • 7,942
  • 2
  • 36
  • 45
39
votes
5 answers

Spring-Data FETCH JOIN with Paging is not working

I am trying to use HQL fetching my entity along with sub-entities using JOIN FETCH, this is working fine if I want all the results but it is not the case if I want a Page My entity is @Entity @Data public class VisitEntity { @Id @Audited …
Ehab Al-Hakawati
  • 982
  • 4
  • 11
  • 32
39
votes
4 answers

Jackson: Multiple back-reference properties with name 'defaultReference'

I'm trying to map a json (string format) to an object and I get the following error com.fasterxml.jackson.databind.JsonMappingException: Multiple back-reference properties with name 'defaultReference' This is the json…
Kien Dang Ngoc
  • 1,079
  • 5
  • 15
  • 25