Java 通过API创建Pentaho元数据域:Exception';属性。。。没有草签';
我试图通过Java类创建一个Pentaho元数据域。使用Pentaho automodel API创建数据模型时,我遇到了一个异常 初始化不是Java 通过API创建Pentaho元数据域:Exception';属性。。。没有草签';,java,pentaho,Java,Pentaho,我试图通过Java类创建一个Pentaho元数据域。使用Pentaho automodel API创建数据模型时,我遇到了一个异常 初始化不是cattleEnvironment.init()(我已执行)是否需要 请建议如何解决此异常: 根本原因:从Props.java中引用的代码。然而,Props构造函数是受保护的,不是公共的,所以我不能实例化它 public static Props getInstance() { if (props!=null
cattleEnvironment.init()代码>(我已执行)是否需要
请建议如何解决此异常:
根本原因:从Props.java中引用的代码。然而,Props构造函数是受保护的,不是公共的,所以我不能实例化它
public static Props getInstance()
{
if (props!=null) return props;
throw new RuntimeException("Properties, Kettle systems settings, not initialised!");
}
然而,Props构造函数是受保护的,不是公共的,所以我不能实例化它。例外情况是:
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)
线程“main”org.pentaho.pms.core.Exception.pentahometataexception:java.lang.RuntimeException:Properties,Kettle系统设置中的异常,未初始化!
位于org.pentaho.metadata.automodel.AutoModeler.generateDomain(AutoModeler.java:127)
在org.abc.poc.AutoModelerScenario(未知来源)
位于org.abc.poc.MyApplication.main(未知来源)
原因:java.lang.RuntimeException:属性,水壶系统设置,未初始化!
位于org.pentaho.di.core.Props.getInstance(Props.java:229)
在org.pentaho.pms.util.Settings.getBusinessTableIDPrefix(Settings.java:46)上
位于org.pentaho.metadata.util.util.proposeSqlBasedLogicalTableId(util.java:124)
位于org.pentaho.metadata.automodel.AutoModeler.createBusinessTable(AutoModeler.java:157)
位于org.pentaho.metadata.automodel.AutoModeler.generateDomain(AutoModeler.java:121)
是的,除了cattleEnvironment.init()代码>,您需要调用org.pentaho.di.ui.core.PropsUI.init(显示d,字符串文件名)
。例如
PropsUI.init(newdisplay(),System.getenv(“user.home”)+“/.kettler/.spoonrc”)代码>
您还可以确保在运行代码时,所有Pentaho ui\images文件夹都可用。它可以工作,但对于其他版本,您需要:
PropsUI.init(new Display(), System.getenv("user.home") + "/.pentaho-meta/.pme-rc");