Openssl - complete jar bundle question

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

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 R. Caro

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™ 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™
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 N. escribió: