I am upgrading my application from Spring Boot version 2.7.3 to 3.0.2 and Java version 8 to 17. My build is successful but during server startup I am getting below exception -
Caused by:…
I want to establish connection with mongodb through app.properties files in Spring boot.
Currently, I am establishing connection through Uri variable declared in the class file itself.
private static String uri…
Given that Log4J 2.x is suffering from a major remote code execution vulnerability (Check vulnerability), I started taking a look at my project dependencies to see if I use Log4J through e.g. slf4j and luckily I am not.
But I found another…
I'm trying to make a simple progam with Spring Boot work with MongoDB in Spring Boot 2.3.9
From the startup logs I suspect that something is wrong, it seems like it's initialized twice.
This is my console output:
2021-03-08 01:54:43.515 INFO 26609…
I'm trying to create a spring boot CRUD App using MongoDB. But I'm unable to connect it to the MongoDB Atlas. When I'm running the program the below exception is shown. I'm trying to connect my application to MongDB Atlas clusters using the…
I have existing code that is working fine with spring mongo version 1.9.4.RELEASE.
Now migrating it to version 2.2.1.RELEASE, but I'm facing an issue with @JsonTypeInfo.
Following is the sample code:
BaseInterface.java
@JsonTypeInfo(use = Id.NAME,…
i have spring mongoDB collection user with data as bellow:
[{
"_id": {
"$oid": "5fd81fb277b245717d34c25e"
},
"userName": "banana",
"email": "banana",
"userRole": {
"$ref": "roles",
"$id": {
"$oid":…
I want to use UUID instead of the plain String value for fields annotated with @Id, for example:
@Data // Lombok
public class Role {
@Id
private UUID id;
@Size(max = 18)
private String name;
}
However, inserting such object leads…
I have a model
data class SomeComplexObject(val name: String, val value: T)
@Document("model")
data class SomeModel(val id: String? = null, val map: Map, Int>)
Which I save to Mongo via the save method…
I'm trying to convert the following Mongo query for use with Spring data.
db.product.aggregate([
{$unwind: '$barcodes'},
{$project: {
_id: 0,
productId: '$_id',
productTitle: '$title',
productVariation: '$variation',
barcode:…
I have springboot (2.0.4) application with Mongo Java driver version 3.11.2. When upgrading the application for mongo java driver to version 4.1.0 to use IAM authentication feature of new mongo java driver, the changes are breaking with overall…
Following is my directory structure
com.example
com.example.common
com.example.test
com.example.test.repository
my main spring boot class is as follow
package com.example.test;
@Import({ AutoConfig.class })
@SpringBootApplication
public class…
Using mongock to perform the data migration but end up with below error.
Gradle
plugins {
id 'java'
}
group 'fete.bird'
version '0.0.1-SNAPSHOT'
repositories {
mavenCentral()
}
ext {
set('mongockVersion', "4.1.14")
}
dependencies {
…
exception stack
java.lang.IllegalStateException: Expected lazy evaluation to yield a non-null value but got null!
at org.springframework.data.util.Lazy.get(Lazy.java:66)
at…
I have Spring boot app that uses mongo as db. I am using spring-security to secure my endpoints:
org.springframework.bootspring-boot-starter-security
…