Forum: JRuby Openssl - complete jar bundle question

C37cb1a6a19e23f067aae6ccb2d0de4b?d=identicon&s=25 Manuel Ramos Caro (Guest)
on 2013-06-05 00:14
(Received via mailing list)
Hi

I have used the jrubyc for creating classes that are doing use of the
Openssl support.
While i'm running the script onto the Jruby thought prompt all works but
when i do it with the complete jar
fails requesting lost Java classes...

It's a bundle error or its about another reason... Class-path or
other... ?

Regards
F1d37642fdaa1662ff46e4c65731e9ab?d=identicon&s=25 Charles Nutter (headius)
on 2013-06-07 01:29
(Received via mailing list)
Can you provide a simple reproduction? Perhaps jruby-complete.jar is
not containing the libraries it needs for openssl to work.

- Charlie

On Tue, Jun 4, 2013 at 5:12 PM, Manuel Ramos Caro
C37cb1a6a19e23f067aae6ccb2d0de4b?d=identicon&s=25 Manuel Ramos Caro (Guest)
on 2013-06-08 01:52
(Received via mailing list)
Hi,

I have reproduced the error with a simple example ...

*Executing this code... (script name "test_error.rb")
*
<<
require 'rubygems'
require 'openssl'

$key = "A75435F0B240012A9489000C2952E41F"

class String

   def encrypt(key=$key)
     e = OpenSSL::Cipher::Cipher.new 'DES-EDE3-CBC'
     e.encrypt key
     s = e.update self
     s << e.final
     s = s.unpack('H*')[0].upcase
     return s
   end #def encrypt(key=$key)

end #class String

puts "ENCRIPTED STRING:" + "ENCRIPT THIS".encrypt("encrip_key")
 >>

*First Test - Successfull Case - Running over  Jruby local install.

*C:\Users\propietario\Desktop\error_openssl>jruby -v
jruby 1.7.4 (1.9.3p392) 2013-05-16 2390d3b on Java HotSpot(TM) Client VM
1.7.0_21-b11 [Windows 7-x86]

C:\Users\propietario\Desktop\error_openssl>jruby test_error.rb
ENCRIPTED STRING:03AADB13DBE5C4DB5E24C59462EE2DDE

*Second Test - Error Case - Running over Jruby Complete Jar.
*
C:\Users\propietario\Desktop\error_openssl>java -jar
jruby-complete-1.7.4.jar -version
jruby 1.7.5.dev (1.9.3p392) 2013-06-01 3708d7d on Java HotSpot(TM)
Client VM 1.7.0_21-b11 [Windows 7-x86]

C:\Users\propietario\Desktop\error_openssl>java -jar
jruby-complete-1.7.4.jar test_error.rb
LoadError: load error: openssl -- java.lang.NoClassDefFoundError:
*org/bouncycastle/asn1/DERBoolean*
   require at org/jruby/RubyKernel.java:1054
   require at
jar:file:/C:/Program%20Files/Java/jre7/lib/ext/jruby-complete-1.7.5.dev.jar!/META-INF/jruby.home/lib/ruby/shared/rubygems/custom_require.rb:36
    (root) at test_error.rb:2

Using jars that are here "C:\jruby-1.7.4\lib\ruby\shared" I find changes
over lost class name but i'm lost at one's like ...  "----"

I have solved the problem using zlib instead because only need content
cryption on a file but i think that this can be an issued to open or
maybe by other side can be an error on me execution method.

What do you think about it?

Regards



El 07/06/2013 1:25, Charles Oliver Nutter escribió:
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.