Forum: JRuby JRuby namespace error?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
584133eb06dc88c1118dc4e958ec79b5?d=identicon&s=25 Pablo Fernandez (pablo)
on 2009-04-15 20:05
(Received via mailing list)
Hi

I am new at playing with JRuby, as part of my initial testing I have
attempted to package a program I wrote into a jar file. I have been able
to get it to run, but it seems java is resolving a namespace in the
wrong way (this works when running with ruby directly and even when
running with jruby).

The error I get is:

uninitialized constant AWS::S3::Connection::OpenSSL (NameError)
aws/s3/connection.rb:102:in `create_connection'

aws/s3/connection.rb:102 looks like this:

1  module AWS
2    module S3
3      class Connection #:nodoc:
...
99  def create_connection
100  http             = http_class.new(options[:server], options[:port])
101  http.use_ssl     = !options[:use_ssl].nil? || options[:port] == 443
102  http.verify_mode = OpenSSL::SSL::VERIFY_NONE
103  http
104 end

So it seems OpenSSL::SSL::VERIFY_NONE is being look up at
AWS:S3::Connection, instead of the top level OpenSSL namespace.

This only happens when I package everything in a jar and run it as:

java -cp test.jar:jopenssl.jar test

test.jar was created by copying jruby-complete.jar and adding my classes
like this:

jrubyc * (which includes the aws directory)
jar uf ../test.jar *

Anyone has any clue what I'm doing wrong?

Thanks!



---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email
Ede2aa10c6462f1d825143879be59e38?d=identicon&s=25 Charles Oliver Nutter (Guest)
on 2009-04-15 20:17
(Received via mailing list)
Pablo Fernandez wrote:
> uninitialized constant AWS::S3::Connection::OpenSSL (NameError)
> 101  http.use_ssl     = !options[:use_ssl].nil? || options[:port] == 443
>
> test.jar was created by copying jruby-complete.jar and adding my classes
> like this:
>
> jrubyc * (which includes the aws directory)
> jar uf ../test.jar *

It looks like it's not finding the OpenSSL module, which is defined in
the various .rb files include with OpenSSL. Have you included those in
your app?

- Charlie

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email
This topic is locked and can not be replied to.