in reply to Problem about NullPointerException when using Inline::Java and Jar file

In the JavaScript they have an if check around EncryptPINcode and only call getRsaEncrypt3DES if that call succeeded. It might help to call getErrorString if it fails and get more details of what is going wrong. But yes, your Perl code does parallel the JavaScript code and so looks like it should work.

Anyways my guess is that you have a system administration issue more than a coding issue. For instance you may be on a Linux system, Perl is using the crap java implementation that comes out of GNU while your browser is using a better one from Sun. A sanity check is to run the command java -version and see if it says anything about the Free Software Foundation. If it does then go to http://java.com/en/, get a better version of Java, install it somewhere, then follow the instructions in the README to install Inline::Java to use that version and see if the problems go away.

  • Comment on Re: Problem about NullPointerException when using Inline::Java and Jar file
  • Download Code

Replies are listed 'Best First'.
Re^2: Problem about NullPointerException when using Inline::Java and Jar file
by macpaul (Initiate) on Dec 29, 2008 at 09:42 UTC
    I've tested with both with Sun's Java 1.5.0_17 and 1.6.0_11, the result were all the same after I rechecked and reconfigured my system. The system was on Linux Debain Etch, perl 5.8.8, Inline::Java was 0.52. So that's why I'm still wondering about if my perl code was not correct since two of the three function call will work.
      Well I did find one thinko. Your module is named POST::iCrypt but your script uses POST_jCRYPT. Perhaps you have both on your system and are looking at the wrong one? Probably not, but it is worth asking.

      Assuming that is not the problem, all that I can really say is that your code looks reasonable to me.

      I tried installing Inline::Java on my machine. It failed to pass its test suite. I tried running from the partially installed module but it did not find the MainApplet. I didn't try that hard to debug the issue. (I messed with the CLASSPATH a bit then decided I was putting too much work into it.)

      At this point I would suggest asking again. You could ask again here, or try emailing inline-subscribe@perl.org to subscribe to inline@perl.org and ask your question there. I would suggest making your question short to attract more responders. Something like this:

      I am trying to call Java from Perl using Inline::Java and am having trouble. In this zip file there is a third party Java library MainApplet.class, there is an example where it is called from JavaScript in MainApplet.html and my attempt to call it from Perl in test.pl. The JavaScript version works but my Perl does not.

      Can anyone else replicate this problem on their systems or give me an idea of how to fix it?

      That you should at least get someone else to try to download and run it to verify the bug.