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

0
votes
3answers
33 views

Spring Data returns empty entity

I'm trying to implement simple Spring Data application. I have simple entity Employee with a few fields and I use method from CrudRepository: findById to retrieve employee from database. But always re
0
votes
1answers
14 views

How to refresh spring integration poller with @RefreshScope?

I have a Spring Boot application that uses Spring Cloud Config to refresh its properties. I can easily refresh my controllers with @RefreshScope but I'm not sure how I can do the same for my poller to
0
votes
0answers
4 views

Spring boot 2 expansion failed on Websphere 9.0.7

I am trying to deploy a spring-boot 2.04 app on Websphere 9.0.7. Its building and running fine on its embedded tomcat but when I try to deploy it on Websphere I get the following errors 8/17/18 13:31
0
votes
0answers
90 views

Testing Spring Boot background processing project

We are looking to run Spring Boot as a non-web application using CommandLineRunner to start an infinite-loop processing task. It looks somewhat like the following. @SpringBootApplication public clas
0
votes
1answers
5 views

Losing the indexed data on updating in Solr

This is in schema.xml <field name="body" type="text_general" indexed="true" stored="false"/> This is the Java code SolrInputDocument sdoc = new SolrInputDocument(); sdoc.addField("id",id); Ma
0
votes
0answers
5 views

Hibernate-Spring boot : spring.jpa.hibernate.ddl-auto=update recreates tables and columns after update the entity

I started spring boot project connected to MySQL DB. In my application.properties I put spring.jpa.hibernate.ddl-auto = update but still after I update the table name in the entity, a new Table is cre
1
votes
1answers
25 views

How to configure request-context-attribute programmatically in Spring WebFlux

According to the comment of this, Spring WebFlux supports spring.freemarker.request-context-attribute and actually it works properly. But now, I have to provide my extension of DelegatingWebFluxConfig
0
votes
1answers
146 views

Not able to Autowire ExceptionListener

I have a created a MessageListener which will consume message from Azure service bus. While creating connection using SingleConnectionFactory I am trying to set a ExceptionListener. Both my ExceptionL
1
votes
2answers
99 views

MockMvc configure a header for all requests

In my tests I setup the MockMvc object in the @Before like this mockMvc = MockMvcBuilders.webAppContextSetup(context) .apply(springSecurity()) .build(); In every req
2
votes
2answers
681 views

How to get last page as default in spring data JPA

I have an application which shows some comments. Now I want to sort the comments by create time asc, but I want to show the latest comments as default. I do it like this: public Page<Comment>
1
votes
1answers
30 views

What is the function of the @EnableWebFlux annotation

I have a very simple webflux demo application with freemarker which has got following files: 1.WebFluxDemoApplication.java @SpringBootApplication public class WebFluxDemoApplication { public st
0
votes
0answers
13 views

Failed to execute goal on project X: Could not resolve dependencies for project X:jar:0.0.1-SNAPSHOT: Could not find artifact XX:jar:0.0.1-SNAPSHOT

so i imported 2 maven projects ! rh and common ! the problem is when building the rg project i get this probleme : [ERROR] Failed to execute goal on project param: Could not resolve dependencies for
1
votes
1answers
3654 views

Error:org.hibernate.hql.internal.ast.QuerySyntaxException: Website is not mapped

I am trying to create project with restful web services.I am getting an error org.hibernate.hql.internal.ast.QuerySyntaxException: Website is not mapped .I have tried each solution to solve t
0
votes
2answers
15 views

Ordering multiple RouterFunctions

I have multiple RouterFunctions which I register as beans (one per section of code). One of them is /** for dynamic routing for React. Basically, if no other route matches, I want it to go to that on
1
votes
1answers
15 views

Spring Boot 2 with OAuth2 - Cannot Create bean entityManagerFactory, Requested Bean Currently in Creation

I am attempting to create an OAuth2 Authorization Server using Spring Boot 2. However, whenever I attempt to start my application I receive an error: Error starting ApplicationContext. To display the
3
votes
1answers
27 views

Hibernate Save always returns 0

With Spring Hibernate, I am trying to save an entity and get its id. The saving works fine but I do not get the id returned. The id is also not set into the entity passed to the save method. The id co
0
votes
1answers
11 views

ItemReadListener in springBatch not run when I run job

I m learning spring Batch throw a simple example where I read data from database and write it in xml file. the job run correctly but I can not see the messages that I put in ItemReadListener .Do I mis
-1
votes
0answers
17 views

Spring service method slowness when called from thread

I have a spring service method called m1. When this method is exposed as a rest call it executes fast. However, if the same method m1 is called internally by thread it is taking a longer time (around
1
votes
3answers
29 views

How to handle @Valid violations in the RequestMapping?

I have the following Rest Controller in Java/Spring. The validation of constraints are checked. However, these are completed before it reaches the body of my 'bar' method. How can I handle a violation
0
votes
1answers
18 views

Angular Spring Boot Packaging Issue

I have the current project structure for a spring boot angular project +--app-ui |--+--src |--+--dist |--app-backend |--+--src |--+--+--main |--+--+--+--resources |--+--+--+--+--static |--+--+--+--ja
0
votes
0answers
23 views

Passing constructor args for Spring CommandLineRunner

I have an application that uses a class myClass that implements Spring CommanLineRunner: @SpringBootApplication @ComponentScan({ . . . } ) public class myClass implements CommandLineRunner {
6
votes
1answers
3770 views

Spring MVC @Controller and profiles

I have a spring mvc controller and I want to enable it only in some profiles (for example development and test). I know I can use the profile attribute of the beans element in xml configuration to l
2
votes
1answers
13985 views

Unit testing spring mvc controller with mockito

i'm using mockito and junit and run unit test against spring mvc my flow of code is: Service Layer -> Model Layer -> Controller Layer i was successfully testing the Controller against the model laye
0
votes
0answers
18 views

Spring MVC Page Getting PageNotFound Error: "No mapping found for HTTP request with URI [/WEB-INF/pages/welcomepage.jsp] in DispatcherServlet

To all: I know this issue has been presented in umpteen different ways, but I as a newbie to Spring Java, none of what I've seen here or anywhere else has resolved my particular situation. So, as bes
0
votes
2answers
34 views

Capture generated SQL from Hibernate

I have a requirement to capture changes to certain data. I am looking to capture the following details: Table Name the change occurred in Column Changed Previous Value Updated Value I suggested t
0
votes
0answers
15 views

How to give dynamic value to @Table(name=p+"name") in spring JPA

name of the table should be fixed but in my scenario the last part of the table name is profile based so in local it is X but in dev it is Y and so on till Prod. Is there way to add dynamically the va
2
votes
0answers
80 views

Liquibase: diff always generates indexes

I'm using spring-boot with the liquibase-maven-plugin to generate database changes according to my classes, but the "mvn compile liquibase: diff" command always generates removals and inclusions of in
0
votes
0answers
9 views

@TransactionalEventListener distinguishes the event to listen because of the parameters?

@TransactionalEventListener distinguishes the event because of the method parameters? I mean, I have seen that the parameter received by the listener is the only thing not defined by the framework, so
0
votes
2answers
25 views

MockMvc seems to be clear SecurityContext after performing request (java.lang.IllegalArgumentException: Authentication object cannot be null)

I'm trying to run some integration test using SpringBoot + Spring Data Mongo + SpringMVC I've simplified and generified the code but it should be able to reproduce the behavior with the following tes
0
votes
1answers
26 views

Field required a bean of type that could not be found

I am trying to define an architectcure for my project on spring boot What I have do is to create a generic Repository that extends from JpaRepository public interface BaseRepository<T, ID extends