Thread

Posted on Mon Jul 24 18:49:18 2006 by akho
class not found at inline java.pm line 618
Hi, I am new to perl and inline::java. I'm writing a test program to call existing java code from perl. Here's the perl code.
#!/usr/bin/perl use lib 'C:/Inline-0.44'; use lib 'C:/Inline-0.44/lib'; use lib 'C:/Inline-0.44/blib/lib'; use Inline REPORTBUG; print("Hello, world!\n"); BEGIN { $ENV{CLASSPATH} .= ":C:/test/dist/Utility2.jar"; } use Inline ( Java => 'STUDY', STUDY => ['java.util.HashMap'], ); my $hm = new java::util::HashMap() ; $hm->put("key", "value") ; my $val = $hm->get("key") ; print($val . "\n") ; # prints value use Inline ( Java => 'STUDY', STUDY => ['com.follett.fheg.efollett.utility.validation.security.InputSecurityValidationService'] +, ); my $isvs = new com::follett::fheg::efollett::utility::validation::security::InputSecurityValidation +Service my $boolean = $isvs->validateInput("testing validation"); print($boolean . "\n") ; # prints boolean
The error I'm getting is: Class com.follett.fheg.efollett.utility.validation.security.InputSecurityValidationService not found at C:/Perl/site/lib /Inline/Java.pm line 618 BEGIN failed--compilation aborted at test1.pl line 24, <GEN7> line 6. InputSecurityValidationService is in Utility2.jar. I appreciate any help. Thanks!
Direct Responses: 2688 | Write a response
Posted on Mon Jul 24 22:43:59 2006 by akho in response to 2681
Re: class not found at inline java.pm line 618
I found my error. It's in setting classpath. I had a colon instead of a semicolon in front of C:. right now I'm getting this error. Can't receive packet from JVM: Invalid argument at C:/Perl/site/lib/Inline/Java/Protocol.pm line 431 BEGIN failed--compilation aborted at test1.pl line 33, <GEN7> line 5.
Direct Responses: 2705 | Write a response
Posted on Wed Jul 26 17:01:15 2006 by akho in response to 2688
Re: class not found at inline java.pm line 618
The issue I'm encountering happens when Inline::java is STUDYING java code.
One of the java classes uses LogFactory.class.getResourceAsStream(CONFIG_FILE) and inline::java can not find the properties file.
Where does inline::java look? The properties file is in my classpath.
Any help is appreciated. Thanks!
Direct Responses: 3762 | Write a response
Posted on Thu Dec 14 09:51:10 2006 by hyqgod in response to 2705
Re: class not found at inline java.pm line 618
if you use the method of yourclass.getResourceAsStream(),you must promise your path of CONFIG_FILE is in the jar which yourclass is in. I think!
Write a response