簡體   English   中英

Perl JDBC 來自 CPAN 的模塊使用問題

[英]Perl JDBC Module usage issue from CPAN

我正在嘗試從 CPAN 安裝和使用 DBD::JDBC 模塊並遇到問題。 論壇中的任何 PERL 專家都可以幫我指出問題所在嗎?

我正在使用 root 使用以下所有操作。

這是我的 PERL 和 CPAN 版本,並在 DBD::JDBC 模塊上安裝:

$perl -v

This is perl 5, version 28, subversion 1 (v5.28.1) built for x86_64-linux-thread-multi
(with 1 registered patch, see perl -V for more detail)

Copyright 1987-2018, Larry Wall

Binary build 0000 [cda01a35] provided by ActiveState http://www.ActiveState.com
Built Oct 28 2020 16:15:32

$cpan -v
Loading internal logger. Log::Log4perl recommended for better logging
>(info): /root/.cache/activestate/20d7a5e1/bin/cpan script version 1.67, CPAN.pm version 2.20


$cpanm -v
cpanm (App::cpanminus) 1.7044 on perl 5.016003 built for x86_64-linux-thread-multi
Work directory is /root/.cpanm/work/1618506734.31834
You have make /bin/make
You have /bin/wget
You have /bin/tar: tar (GNU tar) 1.26
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by John Gilmore and Jay Fenlason.

這是 JDBC 失敗的地方:

$cpanm install DBD::JDBC
install is up to date. (0.01)
--> Working on DBD::JDBC
Fetching http://www.cpan.org/authors/id/V/VI/VIZDOM/DBD-JDBC-0.71.tar.gz ... OK
Configuring DBD-JDBC-0.71 ... OK
Building and testing DBD-JDBC-0.71 ... FAIL
! Installing DBD::JDBC failed. See /root/.cpanm/work/1618506799.31847/build.log for details. Retry with --force to force install it.

看下面我看不到太多信息:/root/.cpanm/work/1618506799.31847/build.log

$cat /root/.cpanm/work/1618506799.31847/build.log
cpanm (App::cpanminus) 1.7044 on perl 5.016003 built for x86_64-linux-thread-multi
Work directory is /root/.cpanm/work/1618506799.31847
You have make /bin/make
You have /bin/wget
You have /bin/tar: tar (GNU tar) 1.26
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by John Gilmore and Jay Fenlason.
You have /bin/unzip
Searching install () on cpanmetadb ...
install is up to date. (0.01)
Searching DBD::JDBC () on cpanmetadb ...
--> Working on DBD::JDBC
Fetching http://www.cpan.org/authors/id/V/VI/VIZDOM/DBD-JDBC-0.71.tar.gz
-> OK
Unpacking DBD-JDBC-0.71.tar.gz
Entering DBD-JDBC-0.71
META.yml/json not found. Creating skeleton for it.
Configuring DBD-JDBC-0.71
Running Makefile.PL
Checking if your kit is complete...
Looks good
Using DBI 1.627 (for perl 5.016003 on x86_64-linux-thread-multi) installed in /usr/lib64/perl5/vendor_perl/auto/DBI/
Writing Makefile for DBD::JDBC
-> OK
Finding PREREQ from Makefile ...
Checking if you have Convert::BER 1.31 ... Yes (1.32)
Checking if you have DBI 1.48 ... Yes (1.627)
Building and testing DBD-JDBC-0.71
cp JDBC.pod blib/lib/DBD/JDBC.pod
cp JDBC.pm blib/lib/DBD/JDBC.pm
cp lib/Bundle/DBD/JDBC.pm blib/lib/Bundle/DBD/JDBC.pm
Manifying blib/man3/DBD::JDBC.3pm
Manifying blib/man3/Bundle::DBD::JDBC.3pm
PERL_DL_NONLAZY=1 CLASSPATH=dbd_jdbc.jar:t/hsqldb/hsqldb-1.8.0.2.jar:t/hsqldb/log4j-1.2.13.jar: /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/01_env.t ...... ok
t/02_connect.t .. ok
# Looks like your test exited with 1 just after 22.
t/03_hsqldb.t ...
Dubious, test returned 1 (wstat 256, 0x100)
All 22 subtests passed
t/basis.t ....... skipped: BASIS URL not defined
t/oracle.t ...... skipped: Oracle URL not defined

Test Summary Report
-------------------
t/03_hsqldb.t (Wstat: 256 Tests: 22 Failed: 0)
  Non-zero exit status: 1
Files=5, Tests=32,  7 wallclock secs ( 0.02 usr  0.01 sys +  0.23 cusr  0.05 csys =  0.31 CPU)
Result: FAIL
Failed 1/5 test programs. 0/32 subtests failed.
make: *** [test_dynamic] Error 255
-> FAIL Installing DBD::JDBC failed. See /root/.cpanm/work/1618506799.31847/build.log for details. Retry with --force to force install it.

所以它似乎在 make test 步驟失敗了。

所以我從 cpan 下載了 DBD-JDBC-0.71.tar.gz package 並解壓並運行如下:

$perl Makefile.PL
Checking if your kit is complete...
Looks good
Using DBI 1.643 (for perl 5.028001 on x86_64-linux-thread-multi) installed in /root/.cache/activestate/20d7a5e1/lib/perl5/site_perl/5.28.1/x86_64-linux-thread-multi/auto/DBI/
Generating a Unix-style Makefile
Writing Makefile for DBD::JDBC
Writing MYMETA.yml and MYMETA.json

$ make
cp lib/Bundle/DBD/JDBC.pm blib/lib/Bundle/DBD/JDBC.pm
cp JDBC.pm blib/lib/DBD/JDBC.pm
cp JDBC.pod blib/lib/DBD/JDBC.pod
Manifying 2 pod documents
$ make test
PERL_DL_NONLAZY=1 CLASSPATH=dbd_jdbc.jar:t/hsqldb/hsqldb-1.8.0.2.jar:t/hsqldb/log4j-1.2.13.jar: "/root/.cache/activestate/20d7a5e1/bin/perl-static" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/01_env.t ...... ok
t/02_connect.t .. ok
t/03_hsqldb.t ... 2/22 # Looks like your test exited with 1 just after 22.
t/03_hsqldb.t ... Dubious, test returned 1 (wstat 256, 0x100)
All 22 subtests passed
t/basis.t ....... skipped: BASIS URL not defined
t/oracle.t ...... skipped: Oracle URL not defined

Test Summary Report
-------------------
t/03_hsqldb.t (Wstat: 256 Tests: 22 Failed: 0)
  Non-zero exit status: 1
Files=5, Tests=32,  8 wallclock secs ( 0.03 usr  0.01 sys +  0.27 cusr  0.04 csys =  0.35 CPU)
Result: FAIL
Failed 1/5 test programs. 0/32 subtests failed.
make: *** [test_dynamic] Error 255

在我嘗試啟動 JDBC 服務器之前,我已確保滿足 DBD::JDBC 的所有要求,如文檔中所述: Z5E056C500A1C4B6A7110B50D807/dispodution5Z/DBmet-JDBC/JDBC.panpod5Z//Dmet-JDBC/JDBC.panpod5Z//

需要

Perl 5.8.6 or higher DBI 1.48 or higher Convert::BER 1.31 Java Virtual Machine compatible with JDK 1.4 A JDBC driver log4j 1.2.13

這是一個長期存在的問題, RT 124653 看起來有一個硬編碼的exit 1 擺脫它,測試通過。 我還沒有看過代碼。

您完成了大部分過程,但還記得檢查任何軟件的現有問題,看看是否有人報告了同樣的問題。 我希望我能記得早點這樣做,因為在我檢查並發現有人已經有了解決方案之前,我經常做不必要的工作。 :)

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM