Unable to load bundle

Hello, I'm a new module developer still very much learning. I am trying to follow the gateway-webpage example and after I have made all my changes I see the question marks on the gateway config page. The error I get

java.util.MissingResourceException: Can't find bundle for base name com/gpasettings/GPASettings, locale en_US

this is my gateway hook class setup:

    @Override
    public void setup(GatewayContext gatewayContext) {
        this.context = gatewayContext;

        log.debug("Beginning setup of GPA Settings Module");

        // Register GatewayHook.properties by registering the GatewayHook.class with BundleUtils
        BundleUtil.get().addBundle("GPASettings", getClass(), "GPASettings");

//rest of code

I am not sure what I'm missing here. I have a GPASettings.properties in the resource folder.

Sorry I did not noticed this was tagged as ignition 7.9. I am doing everything with the most up to date versions of SDK and maven plugin.

First question - are you using a new build of your module, and are you sure it has the gateway resources in the correct location? Check the actual built output .modl file; it's just a zip, and you can also open each .jar within as a .zip to check the directory structure.

Your class structure looks like it should be correct. Are you sure the resources directory is an actual directory structure, with subfolders? IntelliJ, in its infinite wisdom, doesn't distinguish between an actual directory tree or a directory literally named com.gpasettings.

So after looking at the directory structure you were absolutely right. Intellij was creating the directory com.gpasettings instead of com/gpasettings.

Thank you for the tip! I can't believe I overlooked that.

1 Like

That's bitten me a number of times, so it's one of the first things I check :slight_smile: