Databene benerator是否包含错误或如何设置?

时间:2013-03-13 10:09:56

标签: exception installation generator

我刚刚下载了databene benerator版本0.8.1,我在Windows 7启动器上使用它。我需要它为我正在开发的应用程序生成一些测试数据,但似乎benerator无法正常工作。我确实正确地设置了BENERATOR_HOME变量,但是当我运行benerator -version时,它打印版本细节然后抛出异常。这是我控制台上的输出

C:\Users\Obby> benerator -version
Local classpath: .;D:\databene-benerator-0.8.1\bin;D:\databene-benerator-0.8.1\lib\*
12:56:16,874 INFO  (main) [CONFIG] Running file -version
12:56:16,890 INFO  (main) [CONFIG] Benerator 0.8.1 build 2335
12:56:16,890 INFO  (main) [CONFIG] Java version 1.7.0_17
12:56:16,890 INFO  (main) [CONFIG] JVM Java HotSpot(TM) Client VM 23.7-b01 (Oracle     
Corporation)
12:56:16,905 INFO  (main) [CONFIG] OS Windows 7 6.1 (x86)
12:56:16,905 INFO  (main) [CONFIG] Installed JSR 223 Script Engines:
12:56:16,983 INFO  (main) [CONFIG] - Mozilla Rhino[js, rhino, JavaScript,     
javascript, ECMAScript, ecmascript]
12:56:16,983 INFO  (main) [CONFIG] Max heap size: 247 MB
12:56:17,420 DEBUG (main) [CONFIG] Initializing Script mapping from file org/databene
/script/script.properties
Exception in thread "main" org.databene.commons.ConfigurationError: Error parsing  
-version
    at org.databene.commons.xml.XMLUtil.parse(XMLUtil.java:245)
    at org.databene.commons.xml.XMLUtil.parse(XMLUtil.java:235)
    at    
org.databene.benerator.engine.DescriptorRunner.parseDescriptorFile
(DescriptorRunner.java:113)
    at    
org.databene.benerator.engine.DescriptorRunner.runWithoutShutdownHook
(DescriptorRunner.java:109)
    at org.databene.benerator.engine.DescriptorRunner.run(DescriptorRunner.java:102)
    at org.databene.benerator.main.Benerator.runFile(Benerator.java:99)
    at org.databene.benerator.main.Benerator.runFromCommandLine(Benerator.java:82)
    at org.databene.benerator.main.Benerator.main(Benerator.java:75)
Caused by: org.databene.commons.ConfigurationError: Resource not found: -version
    at org.databene.commons.IOUtil.getResourceAsStream(IOUtil.java:584)
    at org.databene.commons.IOUtil.getFileOrResourceAsStream(IOUtil.java:565)
    at org.databene.commons.IOUtil.getInputStreamForURI(IOUtil.java:214)
    at org.databene.commons.IOUtil.getInputStreamForURI(IOUtil.java:198)
    at org.databene.commons.xml.XMLUtil.parse(XMLUtil.java:242)
    ... 7 more

C:\Users\Obby>
设置了

benerator环境变量,我可以在控制台上正确地获取它

C:\Users\Obby> echo %BENERATOR_HOME%
D:\databene-benerator-0.8.1

1 个答案:

答案 0 :(得分:6)

在参数'version'之前尝试使用两个破折号。一个破折号通常用于单字母参数。