BundleUtil could not localize the properties

Hi there,

I am new to Ignition module development. I read the “gateway-webpage” example from the ignition-sdk-example in github and trying to build a similar module by myself.

I create a new module by using maven archetypes. Then copy the code from the example to my new created directory.

But there is a localization error. The properties of the module are not configured properly.

Compared with the example code, the only change is the groupId and moduleId. I do not know why the example code can work properly but my new created directory can not.

example code: GitHub - ChichiZhou/ignitiontest2
my code: GitHub - ChichiZhou/ignitiontest

To answer my own question. There is a log saying that
java.util.MissingResourceException: Can't find bundle for base name com/hezho/makework/***, locale en_US.

This means the directory is not detected by maven.

The solution is to create the directory again manually. Then restart the Gateway using
gwcmd -r

Running into this issue right now... Could you expand on what you mean by recreating the directory manually? Which directory and how?

Unfortunately, zhouhcupb hasn't been seen in two years, so hopefully somebody else can provide the answer.

I have same issue, help!!!

Please add resource file like module_gateway.properties under src/main/resouce and add your strings

I did. I did same things as described in the SDK example, and build from scratch.. I added resource (I use IDEA), I even added two resource files with different locales, EN-US.. and then I " BundleUtil.get().addBundle("ParamValues", this.getClass(), "ParamValues");" in the gateway startup block, it just can't add, I am not sure why, file is presented.. in the debugger mode, when I add variables in watch list, I can see that under previously created local EN-US, you have a list with all parameter values. However, when I added my bundle, under name in watch list in debugger the list is empy, there are no locale attached.. I opened doco java class, there are phrase that if bundle not specified, will be used default, and default shows question marks.... I can't attach bundle not sure why.. and can't link EN-US locale.. Regards, Ilya.

Could you please attached screenshots where you use your strings and your reources hierarchy.

I load bundle by following:
BundleUtil.get().addBundle(DesignerHook.class.getSimpleName(),
DesignerHook.class.getClassLoader(), DesignerHook.class.getName().replace('.', '/'));

All standard, but when you use example Home Page, all works, I do not know where is difference and what is the difference. if you clone from git project and build all works, I created project from archetype, something missing perhaps. I just think that something missing in POM file some dependency but not sure which one. Ilya.

What's your package name in GatewayHook? I assume you should create hierarchy like resources/org/efficientia/OFSParamValues.properties if your package name is org.efficientia.

this is from example. and I think that archetype created folders I did not.

you can't create package, idea not allow just only folder.

and in debug mode, I saw that it is mounting, I can browse object, it just not containing elements in the list.

4 Likes