Skip to content

Failed to instantiate [java.util.List]: Specified class is an interface #2202

@dkirrane

Description

@dkirrane

I'm getting the following warning

2024-02-02 | 10:46:54.394 |  WARN | main | picocli.spring.PicocliSpringFactory | 
Unable to get bean of class interface java.util.List, using fallback factory picocli.CommandLine$DefaultFactory
(org.springframework.beans.factory.BeanCreationException: 
Error creating bean with name 'java.util.List': Failed to instantiate [java.util.List]: 
Specified class is an interface)

my guess is it's coming from the following but I'm not exactly sure.

    @Option(
            names = "-topics",
            required = true,
            split = ",",
            arity = "1..*",
            description = "List of topic names")
    List<String> topics;

I'm using

        <dependency>
            <groupId>info.picocli</groupId>
            <artifactId>picocli-spring-boot-starter</artifactId>
            <version>4.7.5</version>
        </dependency>

Metadata

Metadata

Assignees

No one assigned

    Labels

    theme: integrationAn issue or change related to integration with other frameworks, shells or operating systems

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions