JRuby (please use github issues at http://bugs.jruby.org)
  1. JRuby (please use github issues at http://bugs.jruby.org)
  2. JRUBY-4115

cipher.rb:24: superclass must be a Class (Module given) (TypeError)

    Details

    • Type: Bug Bug
    • Status: Resolved Resolved
    • Priority: Major Major
    • Resolution: Won't Fix
    • Affects Version/s: JRuby-OpenSSL 0.5
    • Fix Version/s: JRuby 1.7.0.pre1
    • Component/s: OpenSSL
    • Labels:
      None
    • Environment:
      Java 1.6 on CentOS
    • Number of attachments :
      0

      Description

      I am using JRuby v1.3.1 with JRuby-OpenSSL v0.5.2 (gem added to a jruby-complete.jar). When I need to use OpenSSL to consume a SOAP Web Service I get an error. Looking at the code it appears that indeed a module is being subclassed.

      The error details are here:

      http://gist.github.com/213842

      This may be a fix?:

      klass = Class.new {
       include Cipher
       define_method(:initialize) do |*args|
         cipher_name = args.inject(name){|n, arg| "#

      {n}

      -#

      {arg}

      " }
         super(cipher_name)
       end
      }
      const_set(name, klass)

        Activity

        Hide
        Hiroshi Nakamura added a comment -

        The same report based on 0.6.1. http://twitter.com/cyross/status/12628621727

        Show
        Hiroshi Nakamura added a comment - The same report based on 0.6.1. http://twitter.com/cyross/status/12628621727
        Hide
        Hiroshi Nakamura added a comment -

        This error occurs on JRuby 1.4 + jruby-complete.jar. JRuby 1.4 + non-complete.jar is safe. JRuby 1.5 is safe. Still investigating.

        Show
        Hiroshi Nakamura added a comment - This error occurs on JRuby 1.4 + jruby-complete.jar. JRuby 1.4 + non-complete.jar is safe. JRuby 1.5 is safe. Still investigating.
        Hide
        Nicholas Padilla added a comment -

        Hello All,

        I am attempting to use jruby-openssl gem inside a project that is packaged inside the jruby-complete.jar. Everything else works - except the jruby-openssl. It is installed inside a gems directory on root, along with the specifications directory. I have attempted several other possible fixes, as explained here : http://www.ruby-forum.com/topic/3889596#1052333 I have gotten two errors, one is a stackoverflow error - which has something to do with the jopenssl java code. I edited the layout and now get this:

        NameError: uninitialized constant OpenSSL::Digest::OPENSSL_VERSION_NUMBER

        When trying to use NET::SMTP. I am hoping there is a work around for this problem, as I need to have this up and running asap. I am using the latest JRuby - 1.6.7 and this is happening. All you have to do is create a 'hello world' app and package it inside of the JRuby-Complete.jar - then 'require 'smtp''. This will attempt to load OpenSSL but will fail to do so. I have read all kinds of possible culprits for this problem but no real fix. Do I just need to move away from using SMTP in JRuby and just use straight Java? Seems like the only solution to me at this point, I'd rather not have to go that route. Is there a good reason for JRuby not including a working OpenSSL implementation?

        Show
        Nicholas Padilla added a comment - Hello All, I am attempting to use jruby-openssl gem inside a project that is packaged inside the jruby-complete.jar. Everything else works - except the jruby-openssl. It is installed inside a gems directory on root, along with the specifications directory. I have attempted several other possible fixes, as explained here : http://www.ruby-forum.com/topic/3889596#1052333 I have gotten two errors, one is a stackoverflow error - which has something to do with the jopenssl java code. I edited the layout and now get this: NameError: uninitialized constant OpenSSL::Digest::OPENSSL_VERSION_NUMBER When trying to use NET::SMTP. I am hoping there is a work around for this problem, as I need to have this up and running asap. I am using the latest JRuby - 1.6.7 and this is happening. All you have to do is create a 'hello world' app and package it inside of the JRuby-Complete.jar - then 'require 'smtp''. This will attempt to load OpenSSL but will fail to do so. I have read all kinds of possible culprits for this problem but no real fix. Do I just need to move away from using SMTP in JRuby and just use straight Java? Seems like the only solution to me at this point, I'd rather not have to go that route. Is there a good reason for JRuby not including a working OpenSSL implementation?
        Hide
        Nicholas Padilla added a comment -

        Hello Again!

        I have solved my problem here, this was the solution. In the jruby-complete.jar you will add to the gem/ dir the jruby-openssl gem. Then take the jruby-openssl/lib/share to the root of the jruby-complete.jar - minus the openssl.jar. This ensures jruby can find all files and initialize the fields as needed.

        Show
        Nicholas Padilla added a comment - Hello Again! I have solved my problem here, this was the solution. In the jruby-complete.jar you will add to the gem/ dir the jruby-openssl gem. Then take the jruby-openssl/lib/share to the root of the jruby-complete.jar - minus the openssl.jar. This ensures jruby can find all files and initialize the fields as needed.
        Hide
        Hiroshi Nakamura added a comment -

        Thanks for providing a workaround! We're now planning to merge JRuby-OSSL to JRuby so this kind of problem would not happen again after that. Users encouraged to use the workaround.

        Show
        Hiroshi Nakamura added a comment - Thanks for providing a workaround! We're now planning to merge JRuby-OSSL to JRuby so this kind of problem would not happen again after that. Users encouraged to use the workaround.

          People

          • Assignee:
            Hiroshi Nakamura
            Reporter:
            Jason Goecke
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: