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
0answers
5 views

Spring Framework application.properties vs logback.xml

I am using Spring with Spring boot. Recently while trying my hands on EhCache, I tried enabling logging for EhCache. Setting log-level in application.properties with : logging.level.org.springframewo
0
votes
0answers
5 views

How to DeSerialize String to Map using jackSon and gson libraries

I have a class like this @Data public class A { private String aval1; private String aval2; private B b;//second class } My B class is like this, @Data public class B { p
0
votes
0answers
9 views

How to use Rest service class as a liibrary class

I have Spring app and I created Rest service with a couple of GET methods. Now that web service needs to be moved to the lib module to be used by other modules. How can I do that? Where to place it in
0
votes
0answers
9 views

JPQL - which is the best way of writting a query for performance?

I am developing Spring MVC JPA example in my project. I am using Spring Data JPA library to perform query over database using JpaRepository or CrudRepository or PagingAndSortingRepository etc. When I
0
votes
1answers
27 views

Spring Junit is not working

I am trying to write a unit test for my annotated class. When i un i get the below exception java.lang.IllegalStateException: Could not load TestContextBootstrapper [null]. Specify @BootstrapWith's
-2
votes
0answers
7 views

my .jasper file is not getting exported to pdf file

I got a .jasper file after compiling the .jrxml file. This is the code.The jasper file is not getting converted to pdf. Can anyone please tell me what could be the reason? What is wrong with the code
0
votes
0answers
7 views

Reading HATEOAS with Spring Traverson throws Exception

I am trying to integrate with an external System and trying to write a service to GetResources. The external System resource is OAuth2 protected. This is the data that I want to read { "_embedded"
-3
votes
1answers
31 views

A strange error occurs in the start of Spring MVC application

<?xml version="1.0" encoding="UTF-8"?> <beans > <!-- 设置数据源 --> <bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close" p:driverCla
-1
votes
1answers
20 views

What’s the difference between form:form and sf:form in spring?

What’s the difference between form:form and sf:form in spring , I don't understand the difference bewteen <%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form" %> and <%@ tag
40
votes
3answers
66971 views

Is it possible to have empty RequestParam values use the defaultValue?

if I have a a request mapping similar to the following: @RequestMapping(value = "/test", method = RequestMethod.POST) @ResponseBody public void test(@RequestParam(value = "i", defaultValue = "10") in
-1
votes
0answers
23 views

Issue with implementing State-machine lib (stateless4j and spring state machine) REST micro service based on voice based application

My requirement is to use state machine library with a rest micro service(spring-boot based). To be more precise my application is voice based. following are the requirements Need to initialize sta
0
votes
0answers
7 views

Cannot convert value of type [org.quartz.impl.triggers.SimpleTriggerImpl] to required type

I was trying to upgrade a module from spring 4.0.2 to 4.1.9 and hibernate from 3.6.0 to 4.3.11 and I get the below exception when the application starts. 2017-01-18 01:07:31,016 WARN [PolicyEngin
0
votes
0answers
5 views

collection was processed twice call flush

@Repository @Scope("singleton") @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED) public class EntityManagerImpl implements EntityManagerGenerator { @PersistenceContext(unitName = "te
-1
votes
0answers
15 views

Ambiguity in selecting a bean

I've created an interface like this: public interface CompactDisc { void play(); } Also, I have two implementations of that interface. This one: @Component public class SgtPeppers implements
0
votes
1answers
15 views

Sending Curl http Request to Secured Spring Boot Application

I have secured Spring Boot Application (default configuration by including spring-boot-starter-security in the dependencies). I need to access it using Basic authorization using Base64 format with UT
0
votes
0answers
13 views

Retrieving data from an external API in a Java SpringFramework project

I'm building a java App with SpringFramework. I need to retrieve some data from an external REST API (with an url looking like: http://externalapi.com/books) for some important needs and I don't know
0
votes
1answers
2297 views

Can I get remove of the 'execution' parameter from GET?

I use to Spring Webflow. Can I get remove of the 'execution' parameter from GET? For example: http://localhost:8090/myapp/account/register.do?execution=e1s2 http://localhost:8090/myapp/account/regi
2
votes
3answers
106 views

Spring Boot loads all the available properties file regardless of my @TestPropertySource annotation

I have a Spring Boot 1.4.3 project. In the test/resources folder I have two properties file, let say a-test.properties and b-test.properties. The test class is annotated as follows: @RunWith(SpringR
0
votes
1answers
23 views

Spring Boot : How to get program args with ConfigurationProperties

I'm trying to get some properties from the command line when I start my app. I really try a lot of solution but nothings is working. I'll only use @Value as a last solution java -jar myjar.jar --test
0
votes
0answers
6 views

JMSTimestamp is showing greater time than the current time for few transactions

I am capturing the difference between the time JMSlistener has picked the message and JMSTimestamp(which the producer has sent). When I calculate the different between these two values. The result is
0
votes
0answers
8 views

How to use dynamic values in URI endpoints in apache camel XML configuration

I am using apache camel to create routes between endpoints where through one URI (API Gateway) running on Tomcat on one port, I am mapping to another URI running on Tomcat on different domain and port
0
votes
1answers
10 views

Add listner in root Config @EventListener

With the annotation @EventListener, do we still need to add a listner to ServletContext ? Like this listener class: @Component public class LoginListener { @Autowired UserService us; @EventListen
0
votes
2answers
32 views

How to set default implementation for multiple profiles in Spring?

For example, I have many profiles, "dev", "prod", "test", etc. interface A @Component class DefaultImpl implements A @Profile("test") @Component class TestImpl implements A I want TestImpl only f
0
votes
0answers
16 views

Custom PropertyPlaceholder Resolver

I'm trying to resolve placeholders with a prefix within a Spring Boot application. For example: some.prop=${known.prefix.prop} Note: After the prefix, this could map to any number of properties, s
0
votes
0answers
9 views

How to handle multipart/form-data with different content-types?

How to parse multipart/form-data using Spring framework which has different content-types? Content-Type: multipart/form-data; boundary=----------287032381131322 Content-Length: 999 ----------28703238
0
votes
1answers
23 views

How to process twilio SMS status callback in java

I have following service method for SMS callback processing @RequestMapping(value = "/", method = RequestMethod.POST) @ResponseBody public void processSms(@RequestParam(value = "MessageStatus", requi
0
votes
2answers
282 views

Is it possible to update in database in jdbccursoritemreader

I am using Spring batch JDBCCursorItemReader to read set of data from a table. Once data is read spring batch will process each row in a chunk(reader, processor, writer). Now I want to update/delete t
0
votes
1answers
18 views

Proper testing of JPA DAO with Spring

I've created simple JPA entities: Topic and Word. Topic contains a list of words. @ManyToMany(fetch = FetchType.EAGER, cascade = {CascadeType.MERGE, CascadeType.REMOVE}) @JoinTable private List<Wo
0
votes
0answers
4 views

Configure pagination with PageableHandlerMethodArgumentResolver for a RESTful server

I'm writing a RESTful server with Spring and I want that a page number of 1 in the request will be considered the first page. Here's my configuration: @Configuration public class WebConfiguration ext
58
votes
5answers
52823 views

Can you use @Autowired with static fields?

Is there some way to use @Autowired with static fields. If not, are there some other ways to do this?