Spring boot rest ignore one class

I am developing a REST API using spring-boot-starter-data-rest. One class I want to sync with JPA is the User class containing information about users, including who is allowed to access the API. Unfortunately, having the User and the UserRepositor...
more »

2017-06-16 14:06 (3) Answers

Issue for empty string deserialization

I have an issue in my Spring projet when I call a web-service that return an object with a attribute that is an empty string. In my projet I have Spring boot 1.5.2, Spring 4.3.7 and Jackson 2.8.7. I use a RestTemplate to call web-services. Respons...
more »

2017-06-16 11:06 (2) Answers

Microservices Restful API - DTOs or not?

REST API - DTOs or not? I would like to re-ask this question in Microservices' context. Here is the quote from original question. I am currently creating a REST-API for a project and have been reading article upon article about best practices....
more »

2017-06-15 18:06 (2) Answers

How to self describe a REST api with Spring?

I'm using spring-mvc to create servlets like: @RestController public class MyServlet { @GetMapping("/test") public MyRsp test(MyReq req) { //... } } Now if the user accesses the root of my app localhost:8080/my-app, it should sho...
more »

2017-06-13 12:06 (3) Answers

Hibernate with sqlserver deadlock issue

Following are the two tables with its entity classes. tbl_rules | rule_id | rule_name | @Entity @Table(name = "db_user_name.tbl_rules") public class Rule implements Serializable { private static final long serialVersionUID = 1L...
more »

2017-06-13 12:06 (0) Answers

Jackson dynamic Pojo <T> Deseralization

Having a dynamic POJO like the next one: @JsonInclude(JsonInclude.Include.NON_NULL) public class MyDynamicWrapper <T> { @JsonProperty("header") private CommonHeader header; @JsonProperty("payload") private T payload; pub...
more »

2017-06-12 18:06 (3) Answers

DeferredResult return blank page instead json

I have rest controller in spring boot and when i return empty list or completefuture with result then response is json and it's correct, but I want to use DeferredResult(because non blocking io) and when I try return deferredresult with empty list th...
more »

2017-06-10 19:06 (0) Answers

Error when using abstract class in `@JsonSubTypes`

I'm trying to deserialize JSON to a object in hierarchy of Java objects with more than one level of inheritance depending on a few JSON properties using JsonTypeInfo: @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, prop...
more »

2017-06-09 17:06 (0) Answers

Spring Boot request body semi-required fields

In our application user can write a message based on user id or screen name. class Message { public final Long userId; public final String screenName; public final String text; @JsonCreator public Message(@JsonProperty(value = "...
more »

2017-06-09 16:06 (3) Answers

Spring, Thymeleaf - Change color text

I'm working on my project and at certain stage I need to change the color of certain words (Hashtags in this case). I have this code in the controller: (Note that 'resultado' is a valid string to get the tweets without problems) List<Tweet>...
more »

2017-06-07 14:06 (1) Answers

Spring server: Timeout error

I am trying to run a cron-task using Rails schedule.rb file. The task invokes a function written in ruby. The function runs perfectly fine. However when trying to run as a cron I get this error. Starting Spring server with `/home/ubuntu/.rvm/gems/ru...
more »

2017-06-07 11:06 (1) Answers

Validate input before Jackson in Spring Boot

I've built a REST endpoint using Spring Boot. JSON is posted to the endpoint. Jackson converts the JSON giving me an object. The JSON look like this: { "parameterDateUnadjusted": "2017-01-01", "parameterDateAdjusted": "2017-01-02" } Jacks...
more »

2017-06-06 14:06 (2) Answers

Jackson Deserialize Abstract Classes

I am trying to deserialize an object using JSON ObjectMapper. I see the below error when trying to deserialize com.fasterxml.jackson.databind.JsonMappingException: Can not construct instance of com.phoenix.types.OrderItem: abstract types eith...
more »

2017-06-05 19:06 (1) Answers

Is there application Scope in spring?

I saw 'application' scope in the following blog. Is it true? http://www.concretepage.com/spring/spring-bean-scope-example-using-scope-annotation-and-xml-for-singleton-prototype-request-session-global-session-and-application-scope-with-scoped-proxy ...
more »

2017-06-05 06:06 (2) Answers

Warmup Neo4j database after spring initialization

I use a Neo4J database with nearly 500k nodes. When I startup my Spring application and do the first query, it takes about 4-5 seconds. This happens just for the first query, so I thought I could do a warmup after spring is initialized to make all su...
more »

2017-06-03 20:06 (1) Answers

Eclipse merge two java projects

I am using Eclipse to develop a Java project to run on a server. I have two projects: 1) jbosswildfly: one with Java code made up of a number of RESTful Services, and a Maven pom. 2) theWhoZoo-web: the other is a web project containing a few html...
more »

2017-05-31 13:05 (2) Answers