Skip to content

BeanMapFromClass annotation no clear exception when properties mismatch #24

@gidomanders

Description

@gidomanders

I'm using the @BeanMapFromClass annotation for my result class and I had a property in the result class that was missing in the entity class. During startup I got an exception:

Unsatisfied dependency expressed through constructor parameter 0: Error creating bean with name 'beanMapper' defined in class path resource [io/beanmapper/autoconfigure/BeanMapperAutoConfig.class]: Failed to instantiate [io.beanmapper.BeanMapper]: Factory method 'beanMapper' threw exception with message: null

It was quiet hard to find the issue, without an exception message. I finally figured it out by going through the changes I made and checking everything related to beanmapper. Is it possible to throw a more specific exception to prevent this in the future?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions