1. 在eclipse下運行或調(diào)試Ofbiz的出現(xiàn)Can't find bundle for base

關(guān)鍵字: ofbiz

eclipse 中利用org.ofbiz.base.start.Start類運行Ofbiz 出現(xiàn)錯誤:

Exception in thread "main" java.lang.ExceptionInInitializerError
at org.ofbiz.base.util.Debug.<clinit>(Debug.java:90)
at org.ofbiz.base.container.ContainerLoader.load(ContainerLoader.java:50)
at org.ofbiz.base.start.Start.initStartLoaders(Start.java:248)
at org.ofbiz.base.start.Start.init(Start.java:87)
at org.ofbiz.base.start.Start.main(Start.java:403)
Caused by: java.util.MissingResourceException: Can't find bundle for base name cache, locale zh_CN
at java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:836)
at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:805)
at java.util.ResourceBundle.getBundle(ResourceBundle.java:549)
at org.ofbiz.base.util.cache.UtilCache.setPropertiesParams(UtilCache.java:217)
at org.ofbiz.base.util.cache.UtilCache.setPropertiesParams(UtilCache.java:213)
at org.ofbiz.base.util.cache.UtilCache.<init>(UtilCache.java:172)
at org.ofbiz.base.util.UtilProperties.<clinit>(UtilProperties.java:53)
... 5 more

原因是沒有正確設(shè)置Debug環(huán)境,OFBiz Wiki上的文章描述的很詳細(xì),按照它的步驟設(shè)置,就不會出現(xiàn)上面的問題。

2.trunk 中定義entity時在entitymodel中,如果定義的group在org.ofbiz中就不需要在entitygroup中定義,而自定義的
如在com.aicent中,實體存放在不同的數(shù)據(jù)庫,那么需要定義entitygroup。因此導(dǎo)致的一個問題就是:
如果有自定義實體在entitymodel中定義了但是沒有加入到entitygroup中,那么就會導(dǎo)致此實體默認(rèn)放在在org.ofbiz中從而在ofbiz的數(shù)據(jù)庫中建表了,這點得注意。