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

8
votes
5answers
33233 views

Create Maven project, could not resolve archetype, connection refused

I suspect that I have a Maven proxy problem. When I create a new project : 1) File -> New -> Maven Project 2) I choose the archetype : in org.apache.maven.archetypes -> maven-archetype-webapp 3) An
0
votes
0answers
8 views

java.lang.IllegalArgumentException: argument type mismatch in Spring Controller

Im trying to submit a form to a spring controller and getting the below exception SEVERE: Servlet.service() for servlet [openmrs] in context with path [/openmrs-standalone] threw exception [Requ
0
votes
1answers
26 views

How do I @Autowire to an extended class when @Qualifier is used in Spring?

I have the following classes: public class Service { @Autowired @Qualifier(Helper.BEAN_NAME) protected Helper helper; ... } @Component(Helper.BEAN_NAME) public class Helper { public
0
votes
0answers
8 views

How to fix 'ERROR: Incorrect datetime value: %%' in spring data?

I have a page that requests a list of items with a search function. I just want to point out that this code works perfectly on my work laptop but on my home laptop I get the following error: ERROR:
0
votes
1answers
24 views

How can I make JPQL query compatible with h2 on an integration test

I'm doing and integration test which calls a service which in turn calls a repository, there I have a JPQL query that is working in prod (MySQL) but not in on the integration test (h2). If possible I
1
votes
1answers
19 views

Unable to find user with iUPN in Active Directory using ActiveDirectoryLdapAuthenticationProvider class in Spring

I'm using ActiveDirectoryLdapAuthenticationProvider from org.springframework.security.ldap.authentication.ad and searchForUser method is able to find the user if it's in eUPN form. So, users may be fo
0
votes
0answers
7 views

Produce proper status for every exception in @ExceptionHandler

I use @ControllerAdvice to catch exceptions in my Spring Boot controller. In @ExceptionHandler I can manually specify limited number of exception with their status codes. My question is how I can d
0
votes
1answers
12 views

How do frameworks (like Spring) configure the Servlet container without web.xml?

(I already know the answer, but because I often find myself re-looking for the answer, so I post it here as documentation for myself and others. This is encouraged on Stackoverflow.) Background intro
0
votes
0answers
6 views

Configure Spring Interceptor

I'm having some throuble configuring my interceptor, I put a logger to see if that part of the code runs but doesn't log anything. My hierarchy: RequestInterceptor.java package com.dxp.geographic
0
votes
0answers
4 views

How correctly add RetryAdvice to Jms.messageDriverChannelAdapter

I'm very new to Spring Integration DSL and I need to add retrial with recovery to the existing IntegrationFlow. It takes data from Jms.messageDriverChannelAdapter and send it through different channel
0
votes
1answers
31 views

Equivalent of web.xml <jsp-config> for Spring Boot MVC?

The JSP specification allows me to serve .html files as JSP (that is, have the container process them as JSP files) using a <jsp-config> section in web.xml, e.g.: <web-app …> <jsp-co
0
votes
1answers
11 views

why is s:mvcUrl function returning different results on different views?

I'm calling the function mvcUrl() on two different JSP files. On the first file, it is returning the expected result, but in the second one, it is returning the URL with the path of this JSP on the mi
0
votes
0answers
7 views

How do I get spring security to work with embedded jetty?

I have been trying to get spring security to work with an embedded jetty server. I followed the example here. https://docs.spring.io/spring-framework/docs/5.1.4.RELEASE/spring-framework-reference/w
0
votes
1answers
28 views

Setting different http status codes based on validation results

I need to set different HTTP Status code for my REST webservice request. Basically user will send ISBN number , I need to validate it 1. if user send empty request body , give error message ISBN can
171
votes
7answers
207621 views

How to check String in response body with mockMvc

I have simple integration test @Test public void shouldReturnErrorMessageToAdminWhenCreatingUserWithUsedUserName() throws Exception { mockMvc.perform(post("/api/users").header("Authorization
0
votes
1answers
30 views

How to return an image to client side?

I'm need a little help with a project that I'm doing its something like 9gag, I am trying to return a JSON objects in which there are some data and an image. I've tried doing it couple of ways, retu
0
votes
0answers
15 views

Is there a way to call a method every time a Java Controller method is being used?

I want to refresh a JWT every time a controller method is called without having to add a method to every single controller call. Is there a method I can override? I'm using a Java API.
2
votes
1answers
136 views

Testing application restart with persistence with JUnit and Spring

I have an application that uses persistent JMS queues. Imagine I have an application failure after reading a message and before ack'ing it. The persistent queue must provide that message again after t
0
votes
0answers
19 views

Tomcat web project deployment

Hello, Now I'm trying to deploy my maven project with tomcat but getting error: When I type command: mvn tomcat7:deploy I get: Cannot invoke Tomcat manager: Connection refused (Connection refused
0
votes
0answers
4 views

Extract Collection of Payloads form Spring Cloud Data Flow Aggregator app?

I am using SCDF aggregator app to aggregate messages based on a field and simply release them after the set group time-out. The documentation of aggregator app states that by default it releases a col
0
votes
2answers
35 views

How Do I Mock ResteTemplate exchange without service

I have a static class which will go to another project get info for what I need when my application starts, since this project has multi sub projects, and other projects need these info for process, s
19
votes
4answers
42852 views

How to return 404 response status in Spring Boot @ResponseBody - method return type is Response?

I'm using Spring Boot with @ResponseBody based approach like the following: @RequestMapping(value = VIDEO_DATA_PATH, method = RequestMethod.GET) public @ResponseBody Response getData(@PathVariable(ID
0
votes
0answers
16 views

display multimap values in row number and its multimap valuesone at a time

MultiMap<Integer,List<String>> headerMap1=new MultiValueMap(); // invoiceNumber = String.valueOf(row.getCell(0).getStringCellValue()); try { for (i
0
votes
0answers
13 views

Is there a way to set up an initialContext in a library just to run integration testing on some DAOs?

I'm trying to set up some integration test on a library that's only purpose is to store DAOs that other applications later access. However, I'm getting the following error: javax.naming.NoInitialCont
2
votes
1answers
975 views

Spring-mvc Dispatcher Servlet mapping giving 404 error

I am following along with the Pluralsight "Introduction to Spring MVC 4" course, i have done the two previous requested courses as well (Intro to Spring and Intro to Spring MVC). I am not using any X
0
votes
0answers
17 views

Spring Transaction Update lock

I have a table lets say Order Order has ID (Auto incremented) Name Date Location Lets say I am updating the Orders table and for sake of argument the update takes few seconds @Transactional publ
3
votes
0answers
34 views

Spring Boot 2: Get html output in controller

I'm following the Spring Getting Started tutorials and I'm breaking my brains on how to do something that should be relatively simple like accessing the result of another path in the same Controller.
1
votes
2answers
1129 views

Spring Data Elasticsearch: java.lang.ClassCastException: java.lang.Long cannot be cast to java.lang.String

I have an error with Spring Data Rest and Spring Elasticsearch in a Spring Boot Application. These are the components of my simple project: pom.xml <project xmlns="http://maven.apache.org/POM/4
0
votes
1answers
22 views

Error creating bean in dependency injection with spring-boot

Here is my code - https://github.com/iyngaran/to-do-list I have UserRepository class in info.iyngaran.core.auth.repository package and it is annotated with @Repository. When I try to inject it in Cu
0
votes
1answers
8 views

Resuming spring webflow from action state

Is there an option in spring webflow to resume flow from action-state or decision-state? The flow that I need to implement requires jumping off the flow to click some link in the email. I have the con