# JRuby namespace error?

**URL:** <https://www.ruby-forum.com/t/jruby-namespace-error/165622>\
**Category:** JRuby\
**Created:** [April 15, 2009, 8:05pm UTC](https://www.ruby-forum.com/t/jruby-namespace-error/165622 "2009-04-15T20:05:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![pablo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/ad7895/32.png) [@pablo](https://www.ruby-forum.com/u/pablo)\
**Post date:** [April 15, 2009, 8:05pm UTC](https://www.ruby-forum.com/t/jruby-namespace-error/165622/1 "2009-04-15T20:05:50Z")

</div>

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
```

---

<div class="post-metadata">

**Author:** ![pablo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/ad7895/32.png) [@pablo](https://www.ruby-forum.com/u/pablo)\
**Post date:** [April 15, 2009, 8:17pm UTC](https://www.ruby-forum.com/t/jruby-namespace-error/165622/2 "2009-04-15T20:17:00Z")

</div>

Pablo F. 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

```
