1. 在eclipse下運行或調試Ofbiz的出現Can't find bundle for base

關鍵字: ofbiz

eclipse 中利用org.ofbiz.base.start.Start類運行Ofbiz 出現錯誤:

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

原因是沒有正確設置Debug環境,OFBiz Wiki上的文章描述的很詳細,按照它的步驟設置,就不會出現上面的問題。

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