我正在尝试通过 Java 类创建 Pentaho 元数据域。使用 Pentaho automodel API 创建数据模型时,我遇到了异常。
KettleEnvironment.init();
是否需要初始化(我已执行)以外的初始化?
请建议如何解决异常:
根本原因:从http://trac.spatialytics.com/geokettle/browser/trunk/src-core/org/pentaho/di/core/Props.java的 Props.java 引用的代码。但是 Props 构造函数是受保护的,而不是 public ,所以我不能实例化它。
public static Props getInstance()
{
if (props!=null) return props;
throw new RuntimeException("Properties, Kettle systems settings, not initialised!");
}
但是 Props 构造函数是受保护的,而不是 public ,所以我不能实例化它。例外是:
Exception in thread "main" org.pentaho.pms.core.exception.PentahoMetadataException: java.lang.RuntimeException: Properties, Kettle systems settings, not initialised!
at org.pentaho.metadata.automodel.AutoModeler.generateDomain(AutoModeler.java:127)
at org.abc.poc.AutoModelerScenario.<init>(Unknown Source)
at org.abc.poc.MyApplication.main(Unknown Source)
Caused by: java.lang.RuntimeException: Properties, Kettle systems settings, not initialised!
at org.pentaho.di.core.Props.getInstance(Props.java:229)
at org.pentaho.pms.util.Settings.getBusinessTableIDPrefix(Settings.java:46)
at org.pentaho.metadata.util.Util.proposeSqlBasedLogicalTableId(Util.java:124)
at org.pentaho.metadata.automodel.AutoModeler.createBusinessTable(AutoModeler.java:157)
at org.pentaho.metadata.automodel.AutoModeler.generateDomain(AutoModeler.java:121)