org.springframework.beans.BeanInstantiationException

Failed to instantiate [org.springframework.data.rest.core.mapping.RepositoryResourceMappings]: Factory method 'resourceMappings' threw exception; nested exception is java.lang.IllegalArgumentException: PersistentEntity must not be null!

Samebug tips1

If you're unit testing, you should instantiate only the service and mock the dependencies. If you're testing integration, you should add all the mocking to the configurations file.


rafaelrafael

Don't give up yet. Our experts can help. Paste your full stack trace to get a solution.

Solutions on the web546

  • via GitHub by washawu
    ,
  • via Unknown by Karsten Ludwig Hauser,
  • via Stack Overflow by Primael Bruant
    ,
  • Stack trace

    • org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.data.rest.core.mapping.RepositoryResourceMappings]: Factory method 'resourceMappings' threw exception; nested exception is java.lang.IllegalArgumentException: PersistentEntity must not be null! at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:189)[spring-beans-4.3.2.RELEASE.jar!/:4.3.2.RELEASE] at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:588)[spring-beans-4.3.2.RELEASE.jar!/:4.3.2.RELEASE] Caused by: java.lang.IllegalArgumentException: PersistentEntity must not be null! at org.springframework.util.Assert.notNull(Assert.java:115)[spring-core-4.3.2.RELEASE.jar!/:4.3.2.RELEASE]

    Write tip

    You have a different solution? A short tip here would help you and many other users who saw this issue last week.

    Users with the same issue

    Unknown visitor
    Unknown visitorOnce,
    Unknown visitor
    Unknown visitorOnce,
    Unknown visitor
    Unknown visitorOnce,
    Unknown visitor
    Unknown visitorOnce,
    Unknown visitor
    Unknown visitorOnce,
    190 more bugmates