Skip to content

Cannot load provider in a servlet setup with spring #9

@knuclechan

Description

@knuclechan

Experience an error No provider of PromiseProvider found! when running servlet application with spring.

I guess it may be related to the class loader hierarchy or class loading sequence.

Currently I hack around this by adding a listener to the servlet

	<listener>
		<listener-class>ServletStartupListener</listener-class>
	</listener>
public class ServletStartupListener implements ServletContextListener {
	
	public void contextInitialized(ServletContextEvent sce) {
		log.info("Init JAsync");
		JAsync.just();
	}
	
}

I think one approach to solve this issue is to lazy load the provider instead of loading it in the static phase at JAsync.class

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions