cancel
Showing results for 
Search instead for 
Did you mean: 

Problems registering model resource bundle

roman
Champ in-the-making
Champ in-the-making
Hello folkz,

i'm developing an own AMP and have created the same AMP structure as Record Management.

I put my model-file "xxxModel.xml" in the "config/alfresco/module/de.xxx.alfresco.module.XxxModule/model" folder
and the resource bundle file "xxxModel.properties" in the same directory

further i have this directory : "config/alfresco/module/de.xxx.alfresco.module.XxxModule/context" where the bootstrap-context.xml is located.

in the module-context.xml i'm importing the bootstrap-context.xml

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>

<beans>
   <import resource="classpath:alfresco/module/de.xxx.alfresco.module.XxxModule/context/bootstrap-context.xml" />
</beans>

and in the bootstrap-context.xml i configure the model and the labels:

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>

<beans>
   
   <!– Model –>   
   
   <bean id="de_swipe_alfresco_module_SwipeModule_dictionaryBootstrap" parent="dictionaryModelBootstrap" depends-on="dictionaryBootstrap">
      <property name="models">
         <list>
            <value>alfresco/module/de.xxx.alfresco.module.XxxModule/model/xxxModel.xml</value>
         </list>
      </property>
      <property name="labels">
         <list>
            <value>alfresco/module/de.xxx.alfresco.module.XxxModule/model/xxxModel</value>
         </list>
      </property>
   </bean>
</beans>

and on starting server i get the following error:

11:54:55,437 ERROR [ContextLoader] Context initialization failed
java.util.MissingResourceException: Can't find bundle for base name alfresco/module/de.xxx.alfresco.module.XxxModule/model/xxxModel, locale de_DE
        at java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:1521)
        at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1260)
        at java.util.ResourceBundle.getBundle(ResourceBundle.java:787)
        at org.alfresco.i18n.I18NUtil.getLocaleProperties(I18NUtil.java:411)
        at org.alfresco.i18n.I18NUtil.getMessage(I18NUtil.java:311)
        at org.alfresco.i18n.I18NUtil.getMessage(I18NUtil.java:341)
        at org.alfresco.i18n.I18NUtil.getMessage(I18NUtil.java:328)
        at org.alfresco.util.LogUtil.error(LogUtil.java:106)
        at org.alfresco.repo.domain.schema.SchemaBootstrap.onBootstrap(SchemaBootstrap.java:812)
        at org.alfresco.util.AbstractLifecycleBean.onApplicationEvent(AbstractLifecycleBean.java:62)
        at org.springframework.context.event.SimpleApplicationEventMulticaster$1.run(SimpleApplicationEventMulticaster.java:77)
        at org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:49)
        at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:75)
        at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:241)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:349)
        at org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.refresh(AbstractRefreshableWebApplicationContext.java:156)

I've tried to do anything like in the records management module.
any suggestions?

thx in advance
best regards
rome
8 REPLIES 8

roman
Champ in-the-making
Champ in-the-making
the server starts up if i delete the lines:

<property name="labels">
         <list>
            <value>alfresco/module/de.xxx.alfresco.module.XxxModule/model/xxxModel</value>
         </list>
      </property>
from bootstrap-context.xml
but then the defined properties… have no names which are defined in the xxxModel.properties file.

please help

cbosdonnat
Champ in-the-making
Champ in-the-making
Hi Roman,

have you tried to add an xxxxxModel_de_DE.properties file ? Apparently Alfresco is looking for it… and doesn't fall back on the default properties file… An other point that you can check is if there are white spaces or tabs or new lines before or after you path in the config file. Of course I think that you have double checked the typos in the file path ?

HTH

roman
Champ in-the-making
Champ in-the-making
Hi,

yes, i've tried xxxModel_de_DE.properties too… didn't work.
and the path seems to be ok.

somewhere in the wiki i read about resource bundle base names…
it was dot-separated like alfresco.module.de.xxx…..
tried it too but the same error message.
don't know why.
help would be apreciated.

best regards

cbosdonnat
Champ in-the-making
Champ in-the-making
Hi Roman,

I've never tried to put dots in the resource name and I'm not sure that it works. Could you try to remove them to see if it works better ? FYI, the message bundles are ResourceBundles http://java.sun.com/javase/6/docs/api/.

HTH

roman
Champ in-the-making
Champ in-the-making
I've tried it in a normal way first (with slashes)

my folder structure in the amp is following:
java/src (source folder in eclipse)
    de.mycompany.alfresco.some_subpackages (these are irrelevant for my problem)
java/config (source folder in eclipse)
    alfresco
        module
            de.mycompany.alfresco.module.XxxModule
                 bootstrap -> structure.xml
                 context -> bootstrap-context.xml
                 model -> XxxModel.properties, XxxModel.xml

[img]http://img76.imageshack.us/img76/6130/javaconfigfolderim6.png[/img]

config files as posted above.
maybe i'm wrong somewhere and you'll notice the error if you see the structure

after deployment the folder: de.mycompany.alfresco.module.XxxModule
goes to the folder web-inf/classes/alfresco/module/de.mycompany….

thx for your efforts

cbosdonnat
Champ in-the-making
Champ in-the-making
Hi Roman,

I've tried it with a dummy module: you shouldn't put '.' in your module ID: as the module folder is in the classpath its name can't contain '.'. Simply replace your module ID with de_mycompany_alfresco_module_XxxModule and it will work fine.

HTH

cbosdonnat
Champ in-the-making
Champ in-the-making
As this problem as been solved by PM, here is the conclusion for others:
Using dots in the module ID should work (as explained in the wiki page), but not with resources loading: using dots in a directory of the classpath can have strange side effects.

I hope this could also help others

hammerguy
Champ in-the-making
Champ in-the-making
Hi all,

What if I want to override a properties file containing a dot (like form.get.properties).
I have imported all the relevant files, and when I try to register it (with the dot in the name: form.get), I get the same error.
Anybody has a clue?