Config Null Pointer when Injected

If I extend com.haulmont.cuba.core.config.Config;


@Source(type = SourceType.DATABASE)
public interface MyConfig extends Config {

    String getMyValue();

How can I get that to load first when I create a new bean? e.g.

public class MyServiceBean implements MyService {

    MyConfig myConfig;

    public instantiate(){



I keep getting a null pointer error on “System.out.println(myConfig.getMyValue());” Is there any way around this?


I’ve prepared an example and attached it in your previous topic: link.
Please take a look at this and give me your feedback.

Best regards,