Ofbiz:导入Eclipse

来自WHY42

执行ant load-demo后,可以通过ant start来运行。但是可以导入到eclipse里面来,便于调试。

从eclipse中导入已有工程。然后找到framework/start/start里面的Start.java,运行即可。 默认导入进来后运行会报错:

Start.java using configuration file org/ofbiz/base/start/start.properties
Set OFBIZ_HOME to - C:/_Workspace/apache-ofbiz-13.07.02
Admin socket configured on - /127.0.0.1:10523
Can't load ESAPI properties from classpath, trying FileIO
The LOG-LEVEL property in the ESAPI properties file is not defined.
Exception in thread "main" java.lang.ExceptionInInitializerError
	at org.ofbiz.base.util.Debug.<clinit>(Debug.java:79)
	at org.ofbiz.base.container.ContainerLoader.load(ContainerLoader.java:73)
	at org.ofbiz.base.start.Start.initStartLoaders(Start.java:273)
	at org.ofbiz.base.start.Start.init(Start.java:241)
	at org.ofbiz.base.start.Start.main(Start.java:127)
Caused by: java.util.MissingResourceException: Can't find bundle for base name cache, locale en
	at java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:1499)
	at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1322)
	at java.util.ResourceBundle.getBundle(ResourceBundle.java:721)
	at org.ofbiz.base.util.cache.UtilCache.setPropertiesParams(UtilCache.java:215)
	at org.ofbiz.base.util.cache.UtilCache.setPropertiesParams(UtilCache.java:211)
	at org.ofbiz.base.util.cache.UtilCache.<init>(UtilCache.java:139)
	at org.ofbiz.base.util.cache.UtilCache.createUtilCache(UtilCache.java:1039)
	at org.ofbiz.base.util.UtilProperties.<clinit>(UtilProperties.java:72)
	... 5 more

解决方法:

在build path 里的Add class folder加上framework/base/configframework/,base/cert,framework/base/dtd三个目录,重新运行即可。