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

5
votes
3answers
7145 views

Spring : Schedule a task which takes a parameter

I have a class with the following function: public class classA{ ... ... void function_to_be_scheduled(String param){ ... ... } } I want to schedule the function using the scheduled-task
1
votes
2answers
308 views

Is it possible to create multiple beans depending on prefix in application.properties in springboot

I have the following in my application.properties in my springboot application (1.5.4.RELEASE) my.prefix.one.id=id01 my.prefix.one.name=one my.prefix.two.id=id02 my.prefix.two.name=two And a class
0
votes
1answers
21 views

Easiest method to convert JSON to PDF in java?

I use the Java springboot framework, i need to convert my Json to pdf, the problem is that all text in Pdf is written in one line, it means that line break does not work. As a result i get pdf in whic
-1
votes
0answers
17 views

Use Postgres like SQLite

I would like to program a game. The user downloads the game and installs it. I would like to integrate a database, preferably Postgres. Unfortunately I don't know if this is possible, because I don't
1
votes
2answers
12 views

Unsatisfied dependency expressed through field 'freemarkerConfig'

I want to send e-mails using Apache Freemaker I tried this: @Service public class EMailSender { @Autowired private Configuration freemarkerConfig; public void sendMail(String to, String
0
votes
0answers
13 views

Why I'm getting "lazyinitializationexception could not initialize" when using session.getcurrentsession but not with session.opensession?

Why I'm getting "lazyinitializationexception could not initialize no session" when using session.getcurrentsession but not with session.opensession? Below is my code: Service class: @Override @
0
votes
0answers
14 views

java.lang.IllegalArgumentException: Could not resolve placeholder

I have the following property in my ApplicationContext.xml. It should load the file from the classpath datasource.properties: <context:property-placeholder location="classpath:datasource.properties
2
votes
3answers
3709 views

Spring MVC model attribute value not printing

I just started learning spring mvc. Trying to follow a hello world sample. Everything seems to be working fine, except the jsp view is not able to receive the model attribute value set in the controll
0
votes
1answers
16 views

Config Restful api with body and authentication header basic from Mule esb

I want to export the services to Mule esb. I have the following types of services. Type POST http://10.1.3.193:8080/HRMS/remoting/kpidata/login Type GET http://10.1.3.193:8080/HRMS/remoting/kpiDiemhie
1
votes
0answers
14 views

How to upload image with a product object through Hibernate in Spring MVC

I have an angular form where I fill fields for a product and then I select images. I've added following configuration in AppConfig in SpringMVC project to enable MultiPart Files. @Bean(name = "multip
0
votes
1answers
273 views

Getting error while configuring Apache Tiles 3.0.8 with Spring framework 5.0.4

I want to implement Apache Tiles 3.0.8 in my Spring MVC framework 5.0.4. I commented existing bean with class "org.springframework.web.servlet.view.InternalResourceViewResolver" and added below code
0
votes
1answers
35 views

Error creating bean with name 'tilesViewResolver'

i am trying to run my app using tilesViewResolver. and run output will print hello form tiles in default.jsp file. but is not running show some error. error like org.springframework.beans.facto
0
votes
0answers
13 views

Can I use consul without Spring boot?

I can not use spring boot since the running environment is predefined by the hierarchy within the organization. The application server can support only servlet 3.0. Can I use consul with spring boo
-1
votes
1answers
22 views

How can one integrate Angular4+ Spring MVC + Hibernate without maven?

How can we configure project with Spring and Angular without maven dependencies.
18
votes
5answers
61328 views

Adding ContextLoaderListener to web.xml in Spring MVC

I am new to Spring MVC. I have a web application. I have the following configuration: <welcome-file-list> <welcome-file>list.html</welcome-file> </welcome-file-list> &lt
0
votes
0answers
13 views

How to store Spring Boot OAuth2 logged in user in session?

I'm trying to implement Silent Authentication for my Spring Boot Authorization Server (created via @EnableAuthorizationServer) so that I can ask for new access tokens from my SPA. I figure that to do
0
votes
1answers
38 views

SpringBoot Webflux cannot return application/xml

In my reactive REST API I'm trying to return an XML response. However, I always get a JSON. Any idea why? @RestController @RequestMapping(path = "/xml", produces = APPLICATION_XML_VALUE) public class
0
votes
0answers
8 views

java.lang.IllegalArgumentException: Invalid amount of variables values while using restTemplate.getForObject

I was trying to use restTemplate.getForEntity(requestPath, String.class); the requestPath is as follows http://localhost:8200/mr/AsyncExportService/rest/v2/export/async?dataset=sourcesConferenceDocu
0
votes
0answers
14 views

Spring long-polling with DeferredResult thread safety, concurrency

I am trying to implement this long-polling app before getting into web sockets. I am using Cache and DeferredResult for the requests.I am creating one cache with the user id key and the defferedResult
0
votes
1answers
20 views

RuntimeException: MemberAccess implementation must be provided

I am using a template which accesses public fields of a Customer object like this: <div> <div th:text="${customer.addressee}"></div> <div th:text="${customer.street}">
2
votes
3answers
50 views

Spring Boot Camel Route - get data from rest endpoint

I want to create camel route in Spring Boot (2.1.1) project to get the data from some (rest) endpoint (http://localhost:8080/getAllUsers) and to send that data to activeMq. I have tried with timer da
0
votes
0answers
11 views

Getting system info from Spring Boot Actuator

I have an SpringBoot app. 2.1.3.RELEASE securized by JWT, I want to add an actuator. I added this dependency <dependency> <groupId>org.springframework.boot</groupId>
1
votes
0answers
20 views

Unable to access VCAP SERVICES in PCF in Spring XML based application

I'm trying to access VCAP Services which PCF provides but unable to do so. I have created a USER DEFINED SERVICE for DB connection. But unable to get those values in my application.properties file.
0
votes
0answers
21 views

Foreign key not saving in child table in a One-to-many relationship

I am developing an REST API application using spring boot and is struck up with the One to Many mapping while using mappedBy property. I have User class and Usermeata class, a user can have more than
0
votes
2answers
26 views

How to resolve FileSizeLimitExceededException error?

I'm getting error while uploading excel file size is more the 1MB. [org.springframework.web.multipart.MultipartException: Could not parse multipart servlet request; nested exception is java.lang.Ill
1
votes
0answers
11 views

How to create a reference between 2 collection in Springboot Mongo? i Know @DbRef will do but i need reference directly

I have 2 collections, Country and cities, cities should hold the ObjectId reference of Countries, On Creation of new city, i want cities Collection should Look like { "_id" : ObjectId("5c83505
0
votes
0answers
28 views

Spring Boot Testing with embedded Postgressql database

I want to test my controller in Spring-Boot 2.1.3. I want to simulate a POST request. This works quite well but I can't save the data to my Postgres database because H2 can't do JSONB. Therefore I u
0
votes
3answers
418 views

How to launch Spring Batch Job Asynchronously

I have followed the spring batch doc and couldn't get my job running Asynchronously. So I am running the Job from a web container and the job will be triggered via a REST end point. I wanted to get
0
votes
0answers
14 views

Save child and parent at the same time

I need to save 2 models at the same time in the transaction, but... org.postgresql.util.PSQLException: ERROR: null value in column "book_id" violates not-null constraint I don't understand what is
1
votes
0answers
29 views

Spring-data-elasticsearch "nested query throws [nested] failed to find nested object under path" Exception

I have 2 POJOs (Person and Car) where one is referred by the other @Document(indexName = "person", type = "user") public class Person { @Id private String id; private String name;