I've run across this questions a couple times, thought it might be worth a post:
If you're working on an adapter, and you get the following message while attempting to do a backup with it:
===================================================
Executing 'backup' using 'ZipTie::Adapters::Cisco::IOS'...
[blah blah blah]
java.lang.reflect.InvocationTargetException: Can't locate object method "backup" via package [blah blah blah]
===================================================
...then you've probably got an error in your adapter code. Do this to find it:
1. Make sure you're using the correct Perl executable (that it's first in your path).
2. Set your PERL5LIB environment variable to include the scripts directory of the adapter you're working on, as well as the adapterTool scripts subdirectory. On Windows, e.g.:
set PERL5LIB=c:\tools\ziptie-adapter-tool\scripts;c:\tools\adapters\6.5_adapters\ziptie.adapters.hp.procurve_2007.12.1\scripts
I haven't done this on Linux/OS/X, but it's presumably just:
export PERL5LIB=/opt/tools/adapterTool/scripts:/opt/tools/adapters/ziptie.adapters.hp.procurve_2007.12.1/scripts
3. Run "perl -c" on the main adapter module. This checks the syntax, including "strict" compliance, etc. You will almost certainly get something back like:
C:\tools\ziptie-adapter-tool>perl -c c:\tools\adapters\6.5_adapters\ziptie.adapters.hp.procurve_2007.12.1\scripts\ZipTie\Adapters\HP\ProCurve.pm
syntax error at c:\tools\adapters\6.5_adapters\ziptie.adapters.hp.procurve_2007.12.1\scripts\ZipTie\Adapters\HP\ProCurve.pm line 21, near "blecchhhh!"
c:\tools\adapters\6.5_adapters\ziptie.adapters.hp.procurve_2007.12.1\scripts\ZipTie\Adapters\HP\ProCurve.pm had compilation errors.
Get to fixin' until you get an answer like this:
C:\tools\ziptie-adapter-tool>perl -c c:\tools\adapters\6.5_adapters\ziptie.adapters.hp.procurve_2007.12.1\scripts\ZipTie\Adapters\HP\ProCurve.pm
c:\tools\adapters\6.5_adapters\ziptie.adapters.hp.procurve_2007.12.1\scripts\ZipTie\Adapters\HP\ProCurve.pm syntax OK
Then, try your backup again.
Thanks
Thanks for posting this. I'll put it into the FAQs.
- Leo