在命令行中运行 pan.bat 时出错

Posted

技术标签:

【中文标题】在命令行中运行 pan.bat 时出错【英文标题】:error while running pan.bat in command line 【发布时间】:2016-03-04 04:27:39 【问题描述】:

with the reference to my previous post,here is the link

我仍然面临一些错误。我尝试运行其他 .ktr 文件,它运行成功,但是当我尝试运行“pivot_inject_etl_metadata.ktr”时,它给了我以下错误

 C:\pdi-ce-5.2.0.0-209\data-integration>pan.bat /file:E:\Practise_TRANSFORMATION_OUTPUT\dynamic_pivot\pivot_inject_etl_metadata.ktr /level:Basic 
DEBUG: Using PENTAHO_JAVA_HOME
DEBUG: _PENTAHO_JAVA_HOME=C:\Program Files\Java\jre1.8.0_51
DEBUG: _PENTAHO_JAVA=C:\Program Files\Java\jre1.8.0_51\bin\java.exe

C:\pdi-ce-5.2.0.0-209\data-integration>"C:\Program Files\Java\jre1.8.0_51\bin\java.exe"  "-Xmx256m" "-XX:MaxPermSize=256m" "-Djava.library.path=libswt\win64" "-DKETTLE_HOME=" "-DKETTLE_REPOSITORY=" "-
DKETTLE_USER=" "-DKETTLE_PASSWORD=" "-DKETTLE_PLUGIN_PACKAGES=" "-DKETTLE_LOG_SIZE_LIMIT=" "-DKETTLE_JNDI_ROOT=" -jar launcher\pentaho-application-launcher-5.2.0.0-209.jar -lib ..\libswt\win64  -main
org.pentaho.di.pan.Pan /file:E:\Practise_TRANSFORMATION_OUTPUT\dynamic_pivot\pivot_inject_etl_metadata.ktr /level:Basic
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0
2016/03/04 09:46:41 - Pan - Logging is at level : Basic logging
2016/03/04 09:46:41 - Pan - Start of run.
2016/03/04 09:46:41 - pivot_inject_etl_metadata - Dispatching started for transformation [pivot_inject_etl_metadata]
2016/03/04 09:46:41 - ETL Metadata Injection.0 - ERROR (version 5.2.0.0, build 1 from 2014-09-30_19-48-28 by buildguy) : Bad encoding!
2016/03/04 09:46:41 - ETL Metadata Injection.0 - ERROR (version 5.2.0.0, build 1 from 2014-09-30_19-48-28 by buildguy) : org.pentaho.di.core.exception.KettleException:
2016/03/04 09:46:41 - ETL Metadata Injection.0 - Unable to load transformation ///E:/Practise_TRANSFORMATION OUTPUT/dynamic pivot/pivot_inject.ktr from file.
2016/03/04 09:46:41 - ETL Metadata Injection.0 -
2016/03/04 09:46:41 - ETL Metadata Injection.0 - Unable to read file [file:///E:/Practise_TRANSFORMATION OUTPUT/dynamic pivot/pivot_inject.ktr]
2016/03/04 09:46:41 - ETL Metadata Injection.0 - Could not read from "file:///E:/Practise_TRANSFORMATION OUTPUT/dynamic pivot/pivot_inject.ktr" because it is a not a file.
2016/03/04 09:46:41 - ETL Metadata Injection.0 -
2016/03/04 09:46:41 - ETL Metadata Injection.0 -
2016/03/04 09:46:41 - ETL Metadata Injection.0 -        at org.pentaho.di.trans.steps.metainject.MetaInjectMeta.loadTransformationMeta(MetaInjectMeta.java:443)
2016/03/04 09:46:41 - ETL Metadata Injection.0 -        at org.pentaho.di.trans.steps.metainject.MetaInject.init(MetaInject.java:403)
2016/03/04 09:46:41 - ETL Metadata Injection.0 -        at org.pentaho.di.trans.step.StepInitThread.run(StepInitThread.java:69)
2016/03/04 09:46:41 - ETL Metadata Injection.0 -        at java.lang.Thread.run(Unknown Source)
2016/03/04 09:46:41 - ETL Metadata Injection.0 - Caused by: org.pentaho.di.core.exception.KettleXMLException:
2016/03/04 09:46:41 - ETL Metadata Injection.0 - Unable to read file [file:///E:/Practise_TRANSFORMATION OUTPUT/dynamic pivot/pivot_inject.ktr]
2016/03/04 09:46:41 - ETL Metadata Injection.0 - Could not read from "file:///E:/Practise_TRANSFORMATION OUTPUT/dynamic pivot/pivot_inject.ktr" because it is a not a file.
2016/03/04 09:46:41 - ETL Metadata Injection.0 -
2016/03/04 09:46:41 - ETL Metadata Injection.0 -        at org.pentaho.di.core.xml.XMLHandler.loadXMLFile(XMLHandler.java:559)
2016/03/04 09:46:41 - ETL Metadata Injection.0 -        at org.pentaho.di.core.xml.XMLHandler.loadXMLFile(XMLHandler.java:538)
2016/03/04 09:46:41 - ETL Metadata Injection.0 -        at org.pentaho.di.trans.TransMeta.<init>(TransMeta.java:2660)
2016/03/04 09:46:41 - ETL Metadata Injection.0 -        at org.pentaho.di.trans.steps.metainject.MetaInjectMeta.loadTransformationMeta(MetaInjectMeta.java:438)
2016/03/04 09:46:41 - ETL Metadata Injection.0 -        ... 3 more
2016/03/04 09:46:41 - ETL Metadata Injection.0 - Caused by: org.apache.commons.vfs.FileNotFoundException: Could not read from "file:///E:/Practise_TRANSFORMATION OUTPUT/dynamic pivot/pivot_inject.ktr"
 because it is a not a file.
2016/03/04 09:46:41 - ETL Metadata Injection.0 -        at org.apache.commons.vfs.provider.AbstractFileObject.getInputStream(Unknown Source)
2016/03/04 09:46:41 - ETL Metadata Injection.0 -        at org.apache.commons.vfs.provider.DefaultFileContent.getInputStream(Unknown Source)
2016/03/04 09:46:41 - ETL Metadata Injection.0 -        at org.pentaho.di.core.vfs.KettleVFS.getInputStream(KettleVFS.java:247)
2016/03/04 09:46:41 - ETL Metadata Injection.0 -        at org.pentaho.di.core.xml.XMLHandler.loadXMLFile(XMLHandler.java:557)
2016/03/04 09:46:41 - ETL Metadata Injection.0 -        ... 6 more
2016/03/04 09:46:41 - ETL Metadata Injection.0 - Caused by: java.io.FileNotFoundException: E:\Practise_TRANSFORMATION OUTPUT\dynamic pivot\pivot_inject.ktr (The system cannot find the file specified)
2016/03/04 09:46:41 - ETL Metadata Injection.0 -        at java.io.FileInputStream.open0(Native Method)
2016/03/04 09:46:41 - ETL Metadata Injection.0 -        at java.io.FileInputStream.open(Unknown Source)
2016/03/04 09:46:41 - ETL Metadata Injection.0 -        at java.io.FileInputStream.<init>(Unknown Source)
2016/03/04 09:46:41 - ETL Metadata Injection.0 -        at org.apache.commons.vfs.provider.local.LocalFile.doGetInputStream(Unknown Source)
2016/03/04 09:46:41 - ETL Metadata Injection.0 -        ... 10 more
2016/03/04 09:46:41 - ETL Metadata Injection.0 - ERROR (version 5.2.0.0, build 1 from 2014-09-30_19-48-28 by buildguy) : Error initializing step [ETL Metadata Injection]
2016/03/04 09:46:41 - pivot_inject_etl_metadata - ERROR (version 5.2.0.0, build 1 from 2014-09-30_19-48-28 by buildguy) : Step [ETL Metadata Injection.0] failed to initialize!
Unable to prepare and initialize this transformation

我可以为此提供解决方案吗?提前致谢。

【问题讨论】:

【参考方案1】:

这里:Running pan.bat from command line 在您写的一条评论中:

“谢谢,我尝试将文件夹中的空间设置为 Practise_TRANSFORMATION_OUTPUT。但不幸的是,还有另一个错误。”

然后你得到错误:

2016/03/04 09:46:41 - ETL Metadata Injection.0 -
2016/03/04 09:46:41 - ETL Metadata Injection.0 - Unable to read file [file:///E:/Practise_TRANSFORMATION OUTPUT/dynamic pivot/pivot_inject.ktr]
2016/03/04 09:46:41 - ETL Metadata Injection.0 - Could not read from "file:///E:/Practise_TRANSFORMATION OUTPUT/dynamic pivot/pivot_inject.ktr" because it is a not a file.

再来一次——

Practise_TRANSFORMATION OUTPUT

为转换参考硬编码的文件夹不正确。我想应该是

Practise_TRANSFORMATION_OUTPUT

重命名某个文件夹后请检查 - 所有其他手动硬编码的路径也会更新。使用存储库。 如果您仍然不使用存储库 - 但想从同一文件夹下的其他转换中引用一个转换 - 使用名为:

$Internal.Transformation.Filename.Directory

用于转换和

$Internal.Job.Filename.Directory

相应的工作。希望这会有所帮助。

【讨论】:

【参考方案2】:

这是我收到的错误消息。

无法从“file:///E:/​​Practise_TRANSFORMATION OUTPUT/dynamic”读取 pivot/pivot_inject.ktr”,因为它不是文件。

您应该检查: -pivot_inject.ktr 文件是否存在于 E:/Practise_TRANSFORMATION OUTPUT/dynamic 中 枢 - pivot_inject.ktr 文件的格式是否正确..

您可以通过简单地复制:file:///E:/​​Practise_TRANSFORMATION OUTPUT/dynamic pivot/pivot_inject.ktr 并粘贴到窗口资源管理器或网络浏览器上

【讨论】:

文件pivot_inject 确实存在于指定路径上,我无法理解为什么它在转换和输出之间显示空间。如果您看到我的命令的第一行,则 TRANSFORMATION 和 OUTPUT 以及 dynamic 和 pivot 之间没有任何空格。 Practise_TRANSFORMATION OUTPUT之间有一个空格,你可以尝试创建另一个没有空格的文件夹吗?其次,pivot_inject.ktr 应该是一个 xml 文件。可以用notepad/notepad++打开文件,检查文件内容是否正确【参考方案3】:

您的日志中的第一条错误消息是“错误(版本 5.2.0.0,buildguy 从 2014-09-30_19-48-28 构建 1):编码错误!”

我不知道“pan.bat”文件的编码。

【讨论】:

那么如何检查 pan.bat 文件的正确性呢?进一步的解决方案是什么。【参考方案4】:

嘿,大家好,感谢您的所有帮助,我想我找到了该错误背后的原因,我相信这是我没有在“CSV 输入”步骤中更改源文件路径并且没有更改的最愚蠢的原因t 正确指定了“pivot_inject.ktr”路径。 再次感谢。

【讨论】:

以上是关于在命令行中运行 pan.bat 时出错的主要内容,如果未能解决你的问题,请参考以下文章

(转)Kettle命令行

在命令行中编译库时出错

//usr/lib/x86_64-linux-gnu/libcrypto.so.1.1:添加符号时出错:命令行中缺少 DSO

如何在命令行中运行 ZAP 扫描?

linux 下 命令行中运行 selenium chrome 问题

matlab 文件路径 运行出错