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
1answers
11 views

REST API in Spring Boot Application not throwing Bad request though I am passing incorrect properties of the input POJO

This is my REST API: @RequestMapping(value="/test1") public String test1(TestPOJO tpj) { if(tpj instanceof TestPOJO) { System.out.println("Correct data format passed "); } return
0
votes
0answers
5 views

How to insert CLOB to Oracle using Spring Data

I have problem with trying to save CLOB to Oracle using Spring Data and CRUDRepository interface. On the database side, column is of CLOB type. Strings shorter than 4000 characters are saved correctly
0
votes
2answers
19 views

spring crudrepository save with specific id

I want to insert(not update) data to my repository with specific id's, but whenever I do that Id's are ignored and the inserted entries have simply the next id in the sequence. Entity entity = new E
-1
votes
0answers
41 views

How do I fix strange ArrayIndexOutOfBounds exception?

I'm trying to deploy my Java/spring application. And I'm getting this strange ArrayIndexOutOfBoundsException. I'm deploying an EAR to WebLogic 12c. Very confused because this is a legacy version and
0
votes
1answers
16 views

Spring RESTful web service POST object

I'm experiencing troubles with Spring and Gson to POST my object to the server. I get a result back which is empty, even though it contains data. This code snippet is from on the Restful web service:
0
votes
1answers
10 views

Resources inside root Java Dynamic web doesn't load ,JS Css

While i'm tring yo include js file it's not working fine <script type="text/javascript" src="js/bootstrap.js"></script> I've tried also <script type="text/javascript" src="${
0
votes
0answers
4 views

"java.lang.IllegalArgumentException: Projection type must be an interface" Error

I am having difficulty in implementing projection in Spring Data JPA: 2017-10-19 11:31:33.968 ERROR 4272 --- [nio-8080-exec-6] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet
0
votes
0answers
7 views

JPA: Delete orphans, invalid column

Recently I have asked a very similar question on Stack overflow which turned out to be a duplicate of another question. In that other question there was a workaround which I applied and solved my prob
0
votes
0answers
11 views

How to remove AccessControlEntry (acl_entry) for certain Sid in Spring security acl?

how can i delete user access in spring security acl using mutableAclService . is this code is ok private void deleteEntry(Long id){ ObjectIdentity objectIdentity = new ObjectIdentityImpl(O
0
votes
0answers
9 views

How to run jar file migrations with flyway spring

TL:DR How do you run jar files as deltas using spring flyway. Some background to the problem i encountered. When running a flyway java delta for example the following: public class V3__0001 impleme
0
votes
0answers
18 views

@refreshScope and @PropertySource how to?

Anybody know if @RefreshScope, applied to class for reloading properties/yml files dinamically works with a configuration class annotated only with @PropertySource? I have to refresh an external confi
0
votes
1answers
17 views

How to use parent JSP variables in a JSP javascript injected children?

Hi everyone I'm working in a Spring MVC application with JSP, my problem is in a certain moment I make a controller request to get a pice of JSP code for be included in a div. I get the JSP code from
0
votes
1answers
19 views

How to enter and test catch clause. Spring-boot, Junit, Mockito

I'm trying to test the following code part. Especially the catch: try { preAuthCompleteResponse = preAuthCompleteClient .getPreAuthCompleteResponse(preAuthCompleteServiceImpl.getPreAu
0
votes
0answers
12 views

How to support multiple databases in spring/ hibernate

In my project I use Spring and hibernate. I use MySql and use auto increment for Ids. But now I need to support multiple database types. (separate installations). Say, MySql, Oracle (11g), Postgresql,
0
votes
1answers
24 views

Hibernate Prepares Statements each time

i'm working at a DB intensive System with Spring, Hibernate\JPA and MsSQlServer (PROD) and H2Db( DEV). I got some time- intensive calls, which make a lot of queries too. Enabling the Hibernate Statis
0
votes
1answers
13 views

Getting 401 error when trying to access /api/login in Grails 3 and Spring Security Rest

I am developing a REST API using Grails 3 and Spring Security Rest plugin. I am using MySQL 5.7.19 as my backend. The app seems to work fine and I can access all endpoints when I use default backend p
0
votes
2answers
33 views

Retrieving data from multiple resultsets into a single java list

I have following three resultsets and a list. How can i iterate the three resultsets without using three while(rs1.next()) and return the data to the list. public Optional<List<StudentDetails&g
0
votes
2answers
38 views

Serving REST API and static content from different ports with Spring Boot

Is it possible to serve the REST API and the static content from different ports with Spring Boot? This becomes of interest when using CORS. Means, a plugged in nginx would route requests to api.examp
1
votes
1answers
13 views

Axon 3 not found handler

I'm beginner with Java. I would configure my handler only for working and processing command. At this moment I receive Exception No handler was subscribed to command [com.capgemini.books.CreateBook].
38
votes
8answers
60319 views

How to customise the Jackson JSON mapper implicitly used by Spring Boot?

I'm using Spring Boot (1.2.1), in a similar fashion as in their Building a RESTful Web Service tutorial: @RestController public class EventController { @RequestMapping("/events/all") EventLi
0
votes
0answers
17 views

Spring Cloud Contract Variable inside URL Path

My URL consists of variable inside the URL path as shown in the below request. I am not able to call this this request. Any idea if I can use regex? request { method 'GET' url ('/accounts/group
34
votes
9answers
118090 views

Configuring ObjectMapper in Spring

my goal is to configure the objectMapper in the way that it only serialises element which are annotated with @JsonProperty. In order to do so I followed this explanation which says how to configurate
0
votes
2answers
23 views

Spring-Boot @TestPropertySource not loading the external properties file when used with @SpringBootTest

I am new to Spring Boot, I am having trouble in loading properties file using @TestPropertySource annotation along with @SpringBootTest , Here is my code @RunWith(SpringRunner.class) @SpringBootTest
0
votes
0answers
17 views

what‘s the properites order in spring boot when import XML configuration

I can define an externalized configuration with this. @Configuration public class PropertiesConfig { @Configuration @PropertySource("classpath:test.properties") @Profile("test") stati
0
votes
1answers
12 views

Cannot find the declaration of element 'beans'. in spring

I'm trying to create basic spring web dynamic project. Given below is spring libraries list. And this is my HelloWeb-servlet.xml code. <?xml version="1.0" encoding="UTF-8"?> <beans xmlns=
0
votes
1answers
27 views

How to different objects into the same list using @XmlElements?

I want to use jackson xml mapper to map the following xml (that I have to control of and get from a webservice) to a java bean: <foo> <first><val>some</val></first>
2
votes
1answers
1551 views

Spring Batch Table Prefix when using Java Config

My Spring Batch repository (deployed on an Oracle database) lies in a different schema such that I need to prepend the schema name. When using XML configuration, this would be easy to do: <job-re
0
votes
0answers
19 views

Multiple Instances Of Spring Scheduler Task

We have an EJB application running on Webshere Application Server. Part of the processing there are several scheduled tasks that need to run with a fix delay of 50 to 200 milliseconds so we had to use
0
votes
0answers
30 views

How to catch custom annotations in Spring @ExceptionHandler?

I have a custom annotation like this: @Retention(RetentionPolicy.RUNTIME) @Inherited @Documented @PreAuthorize(AllowedForSystemUsers.condition) public @interface AllowedForSystemUsers { String co
0
votes
2answers
39 views

Springframework - property or field cannot be found on null

I am working on a project and keep getting an error. If I leave the following line in I get the proceeding error. <span style="font-style: italic;" th:text="${#strings.toUpperCase(user.username)}