Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^6: pp can't pack MongoDB and Inline Module

by Alle (Novice)
on Sep 20, 2012 at 11:51 UTC ( #994638=note: print w/ replies, xml ) Need Help??


in reply to Re^5: pp can't pack MongoDB and Inline Module
in thread pp can't pack MongoDB and Inline Module

Thank you for your tips and effort,When I install Mouse and use perlapp pack to exe file, it execuate successfully!

But can't use MongoDB module to connection mongodb

my code

use strict; use utf8; use Encode; use MongoDB; use MongoDB::Connection; use MongoDB::Database; use Tkx; # mongodb my $conn = MongoDB::Connection->new(host => '127.0.0.1:27017', query_timeout => 1000 * 6000); my $db = $conn->dev;

the error msg

[DONE] Could not find a suitable Params::Validate implementation: Can't locat +e Params/Validate/XS.pm in @INC (@INC contains:) at /<C:\Users\Admini +strator\Desktop\StudyNotes\perl\perl-Tkx\tkx3.exe>Module/Runtime.pm l +ine 317. Can't locate Params/Validate/PP.pm in @INC (@INC contains:) at /<C:\Us +ers\Administrator\Desktop\StudyNotes\perl\perl-Tkx\tkx3.exe>Module/Ru +ntime.pm line 317. at /<C:\Users\Administrator\Desktop\StudyNotes\perl\perl-Tkx\tkx3.exe +>Params/Validate.pm line 66. BEGIN failed--compilation aborted at /<C:\Users\Administrator\Desktop\ +StudyNotes\perl\perl-Tkx\tkx3.exe>DateTime/Duration.pm line 12. BEGIN failed--compilation aborted at /<C:\Users\Administrator\Desktop\ +StudyNotes\perl\perl-Tkx\tkx3.exe>DateTime.pm line 43. BEGIN failed--compilation aborted at /<C:\Users\Administrator\Desktop\ +StudyNotes\perl\perl-Tkx\tkx3.exe>MongoDB/GridFS.pm line 24. BEGIN failed--compilation aborted at /<C:\Users\Administrator\Desktop\ +StudyNotes\perl\perl-Tkx\tkx3.exe>MongoDB/Database.pm line 23. BEGIN failed--compilation aborted at tkx3.pl line 7. [DONE]


Comment on Re^6: pp can't pack MongoDB and Inline Module
Select or Download Code
Re^7: pp can't pack MongoDB and Inline Module
by marto (Chancellor) on Sep 20, 2012 at 12:41 UTC

    It seems Params::Validate::XS isn't being detected, and so not packaged. Can you please show how you called pp to create this executable? Could you try again specifically including this module via the -M option? Thanks.

    Update:

    Actually, perhaps a better idea would be to extract the executable you've created, as you would a normal zip file, that way you can examine exactly what has been packaged. In future it may be wise to run pp with some logging such (-v, -vv) and redirect that to a file for reference. I appreciate that packaging this module is time consuming but such logs may prove helpful when debugging problems.

      It's my complete content.

      Because use pp packing my script is so slowly, so i use perlapp

      my script mongo.pl:

      #!/usr/bin/perl -w use strict; use MongoDB; use MongoDB::Connection; use MongoDB::Database; # mongodb my $conn = MongoDB::Connection->new(host => '127.0.0.1:27017', + query_timeout => 1000 * 6000); my $db = $conn->ygzj_dev; print "$db";

      Use "perl mongo.pl" it print "MongoDB::Database=HASH(0x33b2e8)", It worked fun.

      when I use perlapp compiling it to exe,My command is "perlapp --shared public --norunlib --gui --verbose --warnings --exe mongo.exe mongo.pl", perlapp generate a mongo.exe and there have 5 warnings ,the warnings is:

      <1> Devel\GlobalDestruction.pm: warn: auto\Devel\GlobalDestruction\GlobalDestruction.dll not found refby: C:\Perl64\lib\Moose\Meta\Role.pm line 16 refby: C:\Perl64\lib\Moose\Object.pm line 14 refby: C:\Perl64\lib\Moose\Meta\Method\Destructor.pm line 13 refby: C:\Perl64\lib\Class\MOP\Package.pm line 15 file: C:\Perl64\lib\Devel\GlobalDestruction.pm .... .... <2> Mouse\Util.pm: warn: auto\Mouse\Util\Util.dll not found refby: C:\Perl64\site\lib\Mouse.pm line 11 refby: C:\Perl64\site\lib\Mouse\Meta\Attribute.pm line 2 refby: C:\Perl64\site\lib\Mouse\Meta\Class.pm line 2 refby: C:\Perl64\site\lib\Mouse\Meta\Module.pm line 2 refby: C:\Perl64\site\lib\Mouse\Util\TypeConstraints.pm line 2 refby: C:\Perl64\site\lib\Mouse\Object.pm line 2 refby: C:\Perl64\site\lib\Mouse\Exporter.pm line 17 refby: C:\Perl64\site\lib\Mouse\Meta\Role.pm line 2 refby: C:\Perl64\site\lib\Mouse\PurePerl.pm line 11 refby: C:\Perl64\site\lib\Mouse\Meta\TypeConstraint.pm line 2 refby: C:\Perl64\site\lib\Mouse\Util\MetaRole.pm line 2 refby: C:\Perl64\site\lib\Mouse\Meta\Role\Composite.pm line 2 refby: C:\Perl64\site\lib\Mouse\Meta\Role\Application.pm line 2 refby: C:\Perl64\site\lib\Mouse\Meta\Method\Destructor.pm line 2 refby: C:\Perl64\site\lib\Mouse\Meta\Method\Constructor.pm line 2 refby: C:\Perl64\site\lib\Mouse\Meta\Method\Accessor.pm line 2 file: C:\Perl64\site\lib\Mouse\Util.p .... .... <3> Perl\Tidy.pm: warn: Can't locate Perl\Tidy.pm refby: C:\Perl64\lib\Eval\Closure.pm line 151 ... ... <4> SetDualVar.pm: warn: Can't locate SetDualVar.pm refby: C:\Perl64\lib\Win32\TieRegistry.pm line 39 ... ... <5> VMS\Feature.pm: warn: Can't locate VMS\Feature.pm refby: C:\Perl64\lib\Cwd.pm line 211

      I have already installed Mouse, Devel-GlobalDestruction, VMS-FileUtils..., I think these all warning msg is not important, Because when I compiled other script also had some warnings. When I executed the mongo.exe file,there have run error, error msg:

      {.\mongo.exe} Could not find a suitable Params::Validate implementation: Can't locat +e Params/Validate/XS.pm in @INC (@INC contains:) at /<C:\Users\Admini +strator\Desktop\tmp\mongo.exe>Module/Runtime.pm line 317. Can't locate Params/Validate/PP.pm in @INC (@INC contains:) at /<C:\Us +ers\Administrator\Desktop\tmp\mongo.exe>Module/Runtime.pm line 317. at /<C:\Users\Administrator\Desktop\tmp\mongo.exe>Params/Validate.pm +line 66. BEGIN failed--compilation aborted at /<C:\Users\Administrator\Desktop\ +tmp\mongo.exe>DateTime/Duration.pm line 12. BEGIN failed--compilation aborted at /<C:\Users\Administrator\Desktop\ +tmp\mongo.exe>DateTime.pm line 43. BEGIN failed--compilation aborted at /<C:\Users\Administrator\Desktop\ +tmp\mongo.exe>MongoDB/GridFS.pm line 24. BEGIN failed--compilation aborted at /<C:\Users\Administrator\Desktop\ +tmp\mongo.exe>MongoDB/Database.pm line 23. BEGIN failed--compilation aborted at mongo.pl line 5.

      I have allready installed "Params-Validate Validate method/function parameters", Can I compile the script to exe file with could execute. You can test it. my os is windows7 64 bit, my perl is 5.16(active state perl), Thank you very much!

        Hi, I don't have perlapp, so I can't help you with that aspect. It looks as though these modules aren't being packaged. Consider taking my previous advice, unpack the executable to determine what has been packaged. When I package your script using pp as previously described, the executable works without error, though it took quite some time (over half an hour) to package.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://994638]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (7)
As of 2014-08-21 12:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (134 votes), past polls