Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MessageProvider is null #25

Open
CheapLaoo opened this issue Dec 11, 2018 · 2 comments
Open

MessageProvider is null #25

CheapLaoo opened this issue Dec 11, 2018 · 2 comments

Comments

@CheapLaoo
Copy link

CheapLaoo commented Dec 11, 2018

This is the SpringConfiguration

@Configuration
public class SpringConfiguration {

    @Bean
    public MessageProvider messageProvider() {
        return new HelloMessageProvider();
    }
    @Bean
    public SpringPluginManager pluginManager() {
        return new SpringPluginManager();
    }

    @Bean
    @DependsOn("pluginManager")
    public Greetings greetings() {
        return new Greetings();
    }

}

This is the main method

 public static void main(String[] args) {
    // print logo
    printLogo();

    // retrieves the spring application context
    ApplicationContext applicationContext = new AnnotationConfigApplicationContext(SpringConfiguration.class);

    MessageProvider messageProvider = applicationContext.getBean(MessageProvider.class);

    // retrieves automatically the extensions for the Greeting.class extension point
    Greetings greetings = applicationContext.getBean(Greetings.class);
    greetings.printGreetings();

    // stop plugins
    PluginManager pluginManager = applicationContext.getBean(PluginManager.class);
    /*
    // retrieves manually the extensions for the Greeting.class extension point
    List<Greeting> greetings = pluginManager.getExtensions(Greeting.class);
    System.out.println("greetings.size() = " + greetings.size());
    */
    pluginManager.stopPlugins();
}

However the MessageProvider is null 。 Help plz

@decebals
Copy link
Member

decebals commented Dec 11, 2018

Can you run demo script from command line (run-demo.sh for linux or run-demo.bat for windows) and share the result?

@decebals
Copy link
Member

Any news?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants