java.lang.IllegalArgumentException: Database name must not be empty

Stack Overflow | user3034559 | 3 months ago
  1. 0

    mongoProperties properties are null

    Stack Overflow | 3 months ago | user3034559
    java.lang.IllegalArgumentException: Database name must not be empty
  2. 0

    Spring Boot setting up MongoDB repository

    Stack Overflow | 4 months ago | Em Ae
    org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'bookService': Unsatisfied dependency expressed through field 'bookRepository': Error creating bean with name 'bookRepository': Cannot resolve reference to bean 'mongoTemplate' while setting bean property 'mongoOperations'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mongoTemplate' defined in class path resource [com/project/path/to/config/DbConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.data.mongodb.core.MongoTemplate]: Factory method 'mongoTemplate' threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mongoDbFactory' defined in class path resource [com/project/path/to/config/DbConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.data.mongodb.MongoDbFactory]: Factory method 'mongoDbFactory' threw exception; nested exception is java.lang.IllegalArgumentException: Database name must not be empty; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'bookRepository': Cannot resolve reference to bean 'mongoTemplate' while setting bean property 'mongoOperations'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mongoTemplate' defined in class path resource [com/project/path/to/config/DbConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.data.mongodb.core.MongoTemplate]: Factory method 'mongoTemplate' threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mongoDbFactory' defined in class path resource [com/project/path/to/config/DbConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.data.mongodb.MongoDbFactory]: Factory method 'mongoDbFactory' threw exception; nested exception is java.lang.IllegalArgumentException: Database name must not be empty
  3. 0

    Exception while connecting through Spring Data to MongoDB

    Stack Overflow | 5 years ago | Darshan Patil
    java.lang.IllegalArgumentException: Database name must not be empty
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Add support for @GetMapping, @PostMapping etc. introduced in Spring 4.3 in ControllerLinkBuilder

    GitHub | 4 months ago | xak2000
    java.lang.IllegalArgumentException: 'uriTemplate' must not be null
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. java.lang.IllegalArgumentException

    Database name must not be empty

    at org.springframework.util.Assert.hasText()
  2. Spring Core
    Assert.hasText
    1. org.springframework.util.Assert.hasText(Assert.java:168)
    1 frame
  3. Spring Data MongoDB - Core
    AbstractMongoConfiguration.mongoDbFactory
    1. org.springframework.data.mongodb.core.SimpleMongoDbFactory.<init>(SimpleMongoDbFactory.java:142)
    2. org.springframework.data.mongodb.core.SimpleMongoDbFactory.<init>(SimpleMongoDbFactory.java:93)
    3. org.springframework.data.mongodb.config.AbstractMongoConfiguration.mongoDbFactory(AbstractMongoConfiguration.java:114)
    3 frames
  4. com.xx.cloud
    DatabaseConfiguration$$EnhancerBySpringCGLIB$$65a29278$$FastClassBySpringCGLIB$$7563f63.invoke
    1. com.xx.cloud.demo.config.DatabaseConfiguration$$EnhancerBySpringCGLIB$$65a29278.CGLIB$mongoDbFactory$6(<generated>)
    2. com.xx.cloud.demo.config.DatabaseConfiguration$$EnhancerBySpringCGLIB$$65a29278$$FastClassBySpringCGLIB$$7563f63.invoke(<generated>)
    2 frames
  5. Spring Core
    MethodProxy.invokeSuper
    1. org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)
    1 frame
  6. Spring Context
    ConfigurationClassEnhancer$BeanMethodInterceptor.intercept
    1. org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:356)
    1 frame
  7. com.xx.cloud
    DatabaseConfiguration$$EnhancerBySpringCGLIB$$65a29278.mongoDbFactory
    1. com.xx.cloud.demo.config.DatabaseConfiguration$$EnhancerBySpringCGLIB$$65a29278.mongoDbFactory(<generated>)
    1 frame
  8. Java RT
    Method.invoke
    1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    4. java.lang.reflect.Method.invoke(Method.java:498)
    4 frames
  9. Spring Beans
    SimpleInstantiationStrategy.instantiate
    1. org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:162)
    1 frame