I’m trying to figure out response of a GET method API, it is returning extra attribute with name “attributesMap” Reponse entity return code is return ResponseEntity.ok(document); document model class but the API reponse JSON as an extra attribute “attributesMap”. Sample JSON as b…
Tag: spring-boot
JsonObject returns {“empty”:false} in API response
I have the following code on my project: When I Log htmlcda parameter, I get the html string correctly. However, in response results JsonObject I get {“empty”:false}. Any help please? Answer Spring boot uses jackson as default serializer and you’re trying to return JSONObject itself. Jackson…
socketio.emit doesn’t work netty socketio
I’m working with socketio and netty with java and I’m new to both of them. my client side code looks like this. The event handler is as shown below. The server starter code is shown below. I’m getting a connection registration on the OnConnect annoted method, but the method seems to run two …
Maven: Adding classes from war/web-inf/classes as a jar to war/web-inf/lib
I’m rather new to maven here. I have created a Maven Spring boot project with following structure – As you can see the packaging has been set as war. As such when the war file is generated, my source code’s generated .class files are generated in the war/web-inf/classes folder. Rather than i…
Spring boot “oracle.jdbc.OracleDatabaseException: ORA-00904: invalid identifier” Error while creating table
In spring boot, I create tables of the database using the Code-First approach. then while running the application, the result for one of tables shows this error: The class entity is as follow: Does anyone know where is the problem? Answer This is wrong: date is a reserved word for Oracle datatype. Change colu…
spring webclient load balance
Never used webclient with load balancing before and I fallowed https://spring.io/guides/gs/spring-cloud-loadbalancer/ and implemented webclient load balancer, now I am trying to use helthchecks and having problem. and I got the error below when I comment “withHealthChecks()” everything works as ex…
Protobuf repeated fields to json array mapping
I’m using Java, Spring-boot, Hibernate stack and protocol buffers as DTO for communication among micro-services. At reverse proxy, I convert the protobuf object to json using protobuf’s java support. I have the following structure Converting the MultipleItems DTO to json gives me the following res…
jacocoTestCoverageVerification : How gitlab counts test coverage – Spring Boot?
I have a project where Sprig Boot, JUnit and Gradle are being used. In the Gradle dependency I have found the following lines : As par me these lines indicating that in the Gitlab the test coverage must the 70% at least. When I have the run tests with coverage in IntelliJ IDE, I have got 3 measurements, shown…
Java 8 – Best way to read and store a file received in REST service
I want to have an application where user can upload a csv file in front-end (Angular). I want a rest service to read it and then store the file as a BLOB into Oracle database. For the REST service, I will receive a MultipartFile object: For the entity, it will be something like this: I saw that I have getInpu…
Multiple Excel file in sprint boot
IS there the way to create multiple excel file instead of multiple worksheets through spring boot? I have been using apache poi for generation of excel. } When i try to repeat the code of exp.export(response) , it gives me the 1 excel and for the next excel it says The workbook already contains a sheet named …