导航

OFBIZ+ECLIPSE

Posted on 2013-07-17 11:43  eastson  阅读(2159)  评论(2编辑  收藏  举报

1. 首先要安装好OFBIZ,参考《OFBIZ安装》。

2. 安装ECLIPSE。

3. 安装FreeMarker插件,这是OFBIZ的模版引擎。在"Eclipse Marketplace..."搜索"JBoss Tools",点击"Install",然后选择"FreeMarker IDE".

4. 关联*.bsh编辑器 Windows > Preferences > General > Editors > File Associations:

5. 导入OFBIZ项目File > Import > Existing Projects into Workspace,必须将项目编码设为UTF-8,否则个别文件会出现下面这样的乱码:

 6. 创建一个新的Debug配置,启动类必须是org.ofbiz.base.start.Start:

 

7. 现在,可以开始调试OFBIZ了:

 

问题一:Can't find bundle for base name cache, locale en

Start.java using configuration file org/ofbiz/base/start/start.properties
Set OFBIZ_HOME to - Z:/eclipse-jee-juno-SR2-win32/workspace/ofbiz.12.04
Admin socket configured on - /127.0.0.1:10523
Exception in thread "main" java.lang.ExceptionInInitializerError
    at org.ofbiz.base.util.Debug.<clinit>(Debug.java:88)
    at org.ofbiz.base.container.ContainerLoader.load(ContainerLoader.java:77)
    at org.ofbiz.base.start.Start.initStartLoaders(Start.java:263)
    at org.ofbiz.base.start.Start.init(Start.java:232)
    at org.ofbiz.base.start.Start.main(Start.java:131)
Caused by: java.util.MissingResourceException: Can't find bundle for base name cache, locale en
    at java.util.ResourceBundle.throwMissingResourceException(Unknown Source)
    at java.util.ResourceBundle.getBundleImpl(Unknown Source)
    at java.util.ResourceBundle.getBundle(Unknown Source)
    at org.ofbiz.base.util.cache.UtilCache.setPropertiesParams(UtilCache.java:214)
    at org.ofbiz.base.util.cache.UtilCache.setPropertiesParams(UtilCache.java:210)
    at org.ofbiz.base.util.cache.UtilCache.<init>(UtilCache.java:138)
    at org.ofbiz.base.util.cache.UtilCache.createUtilCache(UtilCache.java:1017)
    at org.ofbiz.base.util.UtilProperties.<clinit>(UtilProperties.java:71)
    ... 5 more

解决方法:在Build Path 里加上base/config,base/cert,base/dtd目录:

 

参考:

Running and Debugging OFBiz in Eclipse