Skip to content

BeanInstantiationException: Failed to instantiate []: Specified class is an interface [DATAMONGO-2391] #3251

@spring-projects-issues

Description

@spring-projects-issues

Ilya Zinkevich opened DATAMONGO-2391 and commented

Hi,

I get error with package org.springframework.boot:spring-boot-starter-data-mongodb:2.1.5.RELEASE

Description:
I have interface Call and class TokBoxCall (implements Call) in the code.
There is default typeKey in the records in Mongo DB:
"_class":"com.xxxxx.server.data.model.call.TokBoxCall".

And I didn't overwrite it in Spring Mongo Config.
However, when I perform reading operations, e.g. callRepository.findById(id), I get Exception:

Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.xxxxx.server.data.model.Call]: Specified class is an interface
        at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:119)
        at org.springframework.data.convert.ReflectionEntityInstantiator.createInstance(ReflectionEntityInstantiator.java:64)}}

Affects: 2.1.11 (Lovelace SR11)

1 votes, 4 watchers

Metadata

Metadata

Labels

for: external-projectFor an external project and not something we can fixstatus: invalidAn issue that we don't feel is valid

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions