Skip to content

Tag: java

Java Date to MongoDB date with Gson

Introduction I am currently working on a project that regularly saves several java objects to a MongoDB database. This object contains a Date. Problem The conversion of java Date to Json Mongo give this: But this format does not conform with MongoDB Date. MongoDB is considered as a string instead of a Date. A…

Using Streams on a map and finding/replacing value

I’m new to streams and I am trying to filter through this map for the first true value in a key/value pair, then I want to return the string Key, and replace the Value of true with false. I have a map of strings/booleans: That is where I am stuck–I might be doing the first part wrong too, but I&#8…

CORS error with Angular call to Java service

I have an Angular application that makes a call to a Spring Boot Java service in a separate container. This gateway service calls two other services (one Java and one Python) as needed. Everything works fine running four Docker containers locally. When I run this in AWS ECS, I get the following two errors in …

Scala No Method Found Exception

I am using getting the below line of error : My Pom : Any help regarding this ? Answer Check mvn dependency:tree. All your Scala libs will be suffixed with the major Scala version: All of them need to be the same major version otherwise you’ll get binary incompatible libs at runtime. Your maven pom shou…

How to divide a stream by object fields into two sets?

I have a stream, where each object is identified by a unique id. Moreover, each object has a either positive or negative Free values. I want to divide this stream into two Sets, where one contains the ids whose Free values was positive, and one with the rest. But I find the following not being the right way, …