从命令行运行 Talend perl 作业时丢失文件

发布于 2024-10-07 22:34:01 字数 1040 浏览 0 评论 0原文

我创建了一个简单的 talend perl 作业来从 Excel 文件中提取数据并将其放入 mysql 表中。 当我在 talend studio 4.1.1 中运行它时,效果很好。

问题是当我导出作业时。我尝试像这样运行它:

perl-Ilib proj.job_import_prods_0.1.pl --context=默认 --context_param file_path="/home/antoniocs/programming/file.xls" $*

这给了我以下错误:

在 @INC 中找不到 IO/Scalar.pm (@INC 包含: /home/antoniocs/programming/lib /etc/perl /usr/local/lib/perl/5.10.1 /usr/local/share/perl/5.10.1 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.10 /usr/share/perl/5.10 /usr/local/lib/site_perl 。)位于 lib/OLE/Storage_Lite.pm 第 171 行。 BEGIN 失败——编译中止于 lib/OLE/Storage_Lite.pm 第 171 行。 require 时编译失败 lib/Spreadsheet/ParseExcel.pm 第 18 行。 BEGIN 失败——编译中止于 lib/Spreadsheet/ParseExcel.pm 第 18 行。 require 时编译失败 proj.job_import_prods_0.1.pl 第 568 行。 BEGIN 失败——编译中止于 proj.job_import_prods_0.1.pl 第 568 行。

我已经将 ParseExcel.pm 放入作业文件夹中的 lib 文件夹中。 talend 是否无法自动将必要的文件添加到作业的文件夹中?

注意:导出作业时,我选中了“导出依赖项”框 额外说明:我不是 Perl 程序员。

I created a simple talend perl job to extract data from an excel file and place it in a mysql table.
This works fine when I run it in talend studio 4.1.1.

The problem is when I export the job. I try to run it like so:

perl -Ilib
proj.job_import_prods_0.1.pl
--context=Default --context_param file_path="/home/antoniocs/programming/file.xls"
$*

This gives me the following errors:

Can't locate IO/Scalar.pm in @INC
(@INC contains:
/home/antoniocs/programming/ lib
/etc/perl /usr/local/lib/perl/5.10.1
/usr/local/share/perl/5.10.1
/usr/lib/perl5 /usr/share/perl5
/usr/lib/perl/5.10
/usr/share/perl/5.10
/usr/local/lib/site_perl .) at
lib/OLE/Storage_Lite.pm line 171.
BEGIN failed--compilation aborted at
lib/OLE/Storage_Lite.pm line 171.
Compilation failed in require at
lib/Spreadsheet/ParseExcel.pm line 18.
BEGIN failed--compilation aborted at
lib/Spreadsheet/ParseExcel.pm line 18.
Compilation failed in require at
proj.job_import_prods_0.1.pl line 568.
BEGIN failed--compilation aborted at
proj.job_import_prods_0.1.pl line 568.

I have already placed the ParseExcel.pm int the lib folder in the folder of the job. Is there no way talend will automatically add the necessary files to the job's folder?

NOTE: When exporting the job I checked the box "export dependencies"
EXTRA NOTE: I am not a perl programmer.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

南风几经秋 2024-10-14 22:34:01

您需要找到 talend 存储 Perl 模块的路径(您不能只是移动文件)。一旦知道了这一点,您就可以创建一个 PERL5LIB 环境变量来告诉 perl 它正在查找的模块存储在哪里:

PERL5LIB=/path/to/modules perl -Ilib proj.job_import_prods_0.1.pl --context=Default --context_param file_path="/home/antoniocs/programming/file.xls" $*

快速 find /where/talend/ lives -name Scalar.pm 应该会给你一个线索(你需要 IO 之前的目录)。如果您最终需要多个目录,可以使用 : 分隔它们,就像在 PATH 环境变量中一样。

或者,您可以从包管理器安装所需的模块(提示,RedHat 样式框使用 perl-IO-Scalar 等名称,Debian 样式框使用 libio-scalar-perl 等名称)或 CPAN

You need to find the path where talend stores Perl modules (you cant just move files around). Once you know that, you can create a PERL5LIB environment variable to tell perl where the modules it is looking for are stored:

PERL5LIB=/path/to/modules perl -Ilib proj.job_import_prods_0.1.pl --context=Default --context_param file_path="/home/antoniocs/programming/file.xls" $*

A quick find /where/talend/lives -name Scalar.pm should give you a clue (you want the directory before IO). If you wind up needing multiple directories, they can be separated with a : just like in the PATH environment variable.

Alternatively, you can install the required modules from your package manager (hint, RedHat style boxes use names like perl-IO-Scalar and Debian style boxes use names like libio-scalar-perl) or CPAN.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文