Spring at StackOverflow

Welcome to our StackOverflow page, where we maintain a list of StackOverflow tags that our engineering team monitors and participates in. If you are a previous forum.spring.io user, please read the blog post about the change or visit the read-only archive.

Active questions on StackOverflow

1
votes
0answers
126 views

Can I use Spring 5.0 with Tomcat 8.0 (not 8.5)?

Spring 5.0 release notes say it requires Tomcat 8.5+. What's New in Spring Framework 5.x Can you run Spring MVC 5.x on Tomcat 8.0? Is it just a matter of not being tested and officially supported, or
0
votes
0answers
9 views

Autowring datasource and jdbcTemplate returning NullPointerException

I am not sure what I am doing wrong but I am unable to figure it out. I am trying to build datasource and jdbcTemplate from a yaml file but it seems to be returning NullPointerException. So I
-3
votes
0answers
16 views

How to show an alert message for a short time when user first logs in JAVA

So I am currently building a web app that is a game that allows users to send friend requests to other users. I am trying to figure out how to show an alert when the user first logs in telling them ho
0
votes
0answers
12 views

Spring @Transactional method Error handling

I am using a Transactional method using @Transactional annotation. I am trying to save an object to the database using JpaRepository's save() method. (which will throw an error due to constraints on d
2
votes
2answers
23 views

Spring Framework fails on paths with Windows Drive Letters

I am using Spring Framework version 4.3.18.RELEASE under Intellij on Windows 7. I am looking at the decompiled code of, for example, the class org.springframework.core.io.DefaultResourceLoader and
0
votes
0answers
7 views

spring cloud aws annotation driven queue listener

I'm trying to write a web application that consumes AWS SQS using spring cloud AWS annotation-driven queue listener, here is how my code looks like: XML AWS Beans: <beans xmlns:xsi="http://ww
0
votes
0answers
6 views

Spring Boot + Thymeleaf Security not recognized

i've been trying to use thymeleaf's security tags but i can't get them to work. This is my security class: @Configuration @EnableWebSecurity @EnableGlobalMethodSecurity(prePostEnabled = true) public
0
votes
0answers
7 views

Could not commit JPA transaction; nested exception is javax.persistence.RollbackException: Error while committing the transaction

I have a error when I try to insert a user in the database. I made i custom annotation which verify if the password match with the confirmation password it works when the field not matches , but when
0
votes
0answers
18 views

org.hibernate.WrongClassException: Object [id=null] was not of the specified subclass

I have data model like below import java.io.Serializable; import javax.persistence.Column; import javax.persistence.DiscriminatorColumn; import javax.persistence.DiscriminatorType; import javax.pers
0
votes
2answers
20 views

Spring thymeleaf problems: exception processing template

I'm building a simple web service with spring and thymeleaf. That's the code for now: Controller: package com.Basi.CheBBellaEmittente.Pages.Control; @Controller public class SimpleController {
1
votes
1answers
23 views

In Thymeleaf, how to acquire HTML variable and send it to controller?

I have no idea how to retrieve image's name. Required String parameter 'image.name' is not present. This is what I get after clicking on the button. Controller's method Page from that I'm trying
0
votes
1answers
16 views

Getting this org.springframework.web.servlet.DispatcherServlet noHandlerFound error?

i have a index.jsp file where i declare action=/login.Now in web.xml in declare a dispatcher in which given servlet name login.After that make a login-servlet.xml where define base-package: <ctx:
3
votes
4answers
7448 views

Mockito - Mock not being injected for one of the testcases

I have a jsf spring application and using mockito for my unit test. I keep getting NullPointerException when i run my junit test in iEmployeeService mocking. There are not Exception for iSecurityLogin
24
votes
5answers
15398 views

Spring boot devtools - Static content reloading does not work in IntelliJ

When building my first Spring Boot app, I discovered that I need to restart my app every time I make a change to a Javascript file in /resources/static/some-file.js This is very time consuming. When
0
votes
2answers
44 views

How to return a JSONObject instead HashMap with ResponseEntity? (No converter found for return value of type: class org.json.JSONObject)

I am able to return an HashMap as a JSON from my REST API built on Spring Boot. Here my Method: @ResponseBody @Transactional @GetMapping("create_coinmarketcap_snapshot") public ResponseEntity<Hash
1
votes
1answers
28 views

Consider defining a bean named 'entityManagerFactory' in your configuration.3

I'm just following some tutorial how to upload documents via spring. So while working on it i faced above issue. Since there are many questions related to same question i refer them and tried everythi
0
votes
0answers
5 views

How to add header and footer on every page bottom not end of the content using thymleaf pdf?

Hi can anyone please suggest me how to add header top and footer bottom not end of the content on every page using thymeleaf pdf generating,but page will generate dynamically.
0
votes
2answers
81 views

Spring Boot + Web + Thymeleaf: Circular view path in Spring IO Guide for "Securing a Web Application"

I am trying out the Spring IO Guide for "Securing a Web Application" available at https://spring.io/guides/gs/securing-web/. The guide instructs to build a simple unsecured web application first and
1
votes
1answers
24 views

public interface BaseRepository extends JpaRepository<Category, Long>{ }

public interface BaseRepository extends JpaRepository<Category, Long>{ } Here I have a category Entity for the arguments ,I need to change a dynamaic entity ,in future catalogue entity,visit
0
votes
1answers
14 views

Inner Join query and interface based Projection in Spring Data JPA

I am working on a Spring MVC Project with Spring Data JPA running MySql DB, where I have four Entity Objects: Travel, Expense, Currency and Fund. Here is a visual representation of my DB Schema:
7
votes
6answers
10676 views

Spring Boot with Apache Tiles

I am attempting to migrate my java application to Spring Boot. Currently, I am running Spring MVC 3.2 with Apache Tiles. When I migrated to Spring Boot, my controllers still get called fine, they pa
0
votes
2answers
48 views

Spring with JSP : Not able to scan Controller class

Hello guys I really need help with this. I am practicing developing an application based on Spring MVC with JSP. I am starting from the basic and trying to print the "page.jsp" content but it always p
0
votes
2answers
35 views

Spring can't make static reference to non-static method?

This is my PageController code. @RequestMapping(value = { "/show/category/{id}/products" }) public ModelAndView showCategoryProducts(@PathVariable("id") int id) { // Category DAO //Getting Erro
0
votes
1answers
10 views

Spring Data Mongodb: json string to BasicDBObject

I've created this custom converter: @Component @WritingConverter public class MetadataWriterConverter implements Converter<Metadata, DBObject> { @Override public DBObject convert(Metada
0
votes
2answers
30 views

Many to Many relationship - get double rows in MySQL

Well just like the title says, I have a many to many relationship in my project, when customer can have many coupons and the other way. To make that work I made another table in MySQL which include co
2
votes
2answers
107 views

How to use Query DSL with MongoDB in Spring Boot

I try to learn how to use Query DSL with MongoDB in Spring Boot and I get an error. I found this app on youtube, the single difference is that he use the old interface QueryDslPredicateExecutor and I'
2
votes
0answers
17 views

Serve pdf as static resource from spring application running in docker container

The Pdf file is blank when I try to open to it from localhost/pdfs/filename.pdf, but when I do that for the picture it works (localhost/images/imagename.png) My app is running inside a docker containe
0
votes
1answers
25 views

Getting package does not exists during wiring of beans in Spring test

I am running a simple spring application with a test but I am getting the below error, [INFO] ------------------------------------------------------------- [ERROR] COMPILATION ERROR : [INFO] -------
15
votes
4answers
18082 views

How does Spring bean Handle concurrency

My web application uses spring IOC. So all my spring beans will be singleton (by default).In case if two requests try to access two different methods of a single class. For example : MySpringBean is a
1
votes
1answers
22 views

retrieve property on map using thymeleaf with spring

Whenever I'm using thymeleaf with spring, I find that I can retrieve a property on a map using "." (such as myMap.field). I want to know why it works. Because thymeleaf using spring expression languag