Problem with soap4r+httpclient from within a jar.

Discussion in 'Ruby' started by Brian Wallace, Sep 19, 2009.

  1. [Note: parts of this message were removed to make it a legal post.]

    Hi all,

    I'm attempting to package up my JRuby soap4r client application into a jar,
    but I'm not having much luck getting it working. I've tried using both rawr
    and Netbeans to build the jar but I get the same results.

    I have the soap4r and httpclient gems inside the jruby-complete.jar.. I put
    the gems here:

    \META-INF\jruby.home\lib\ruby\gems\1.8\gems\httpclient-2.1.5.2\

    The problem seems to be with the httpclient gem. Its failing when it reads
    in the cacert.p7s file. I've verified that the file is there, and everything
    works fine when its not running from a jar. I believe I can use "net/http"
    as the client, but I'm hoping I wont have to.

    Has anyone successfully wrapped a soap4r client into a jar? See the stack
    trace below ...

    file:/C:/Users/dev/Documents/NetBeansProjects/Java and Ruby/dist/lib/jruby-c
    omplete.jar!/META-INF/jruby.home/lib/ruby/gems/1.8/gems/httpclient-2.1.5.2/lib/h
    ttpclient/ssl_config.rb:149:in `set_trust_ca': file not found:
    file:\C:\Users\
    dev\Documents\NetBeansProjects\Java and
    Ruby\dist\lib\jruby-complete.jar!\META
    -INF\jruby.home\lib\ruby\gems\1.8\gems\httpclient-2.1.5.2\lib\httpclient\cacert.
    p7s (The filename, directory name, or volume label syntax is incorrect)
    (OpenSSL
    ::X509::StoreError)
    from file:/C:/Users/dev/Documents/NetBeansProjects/Java and Ruby/dis
    t/lib/jruby-complete.jar!/META-INF/jruby.home/lib/ruby/gems/1.8/gems/httpclient-
    2.1.5.2/lib/httpclient/ssl_config.rb:353:in `load_cacerts'
    from file:/C:/Users/dev/Documents/NetBeansProjects/Java and Ruby/dis
    t/lib/jruby-complete.jar!/META-INF/jruby.home/lib/ruby/gems/1.8/gems/httpclient-
    2.1.5.2/lib/httpclient/ssl_config.rb:342:in `each'
    from file:/C:/Users/dev/Documents/NetBeansProjects/Java and Ruby/dis
    t/lib/jruby-complete.jar!/META-INF/jruby.home/lib/ruby/gems/1.8/gems/httpclient-
    2.1.5.2/lib/httpclient/ssl_config.rb:342:in `load_cacerts'
    from file:/C:/Users/dev/Documents/NetBeansProjects/Java and Ruby/dis
    t/lib/jruby-complete.jar!/META-INF/jruby.home/lib/ruby/gems/1.8/gems/httpclient-
    2.1.5.2/lib/httpclient/ssl_config.rb:85:in `initialize'
    from file:/C:/Users/dev/Documents/NetBeansProjects/Java and Ruby/dis
    t/lib/jruby-complete.jar!/META-INF/jruby.home/lib/ruby/gems/1.8/gems/httpclient-
    2.1.5.2/lib/httpclient.rb:353:in `initialize'
    from file:/C:/Users/dev/Documents/NetBeansProjects/Java and Ruby/dis
    t/lib/jruby-complete.jar!/META-INF/jruby.home/lib/ruby/gems/1.8/gems/soap4r-1.5.
    8/lib/wsdl/xmlSchema/importer.rb:66:in `fetch'
    from file:/C:/Users/dev/Documents/NetBeansProjects/Java and Ruby/dis
    t/lib/jruby-complete.jar!/META-INF/jruby.home/lib/ruby/gems/1.8/gems/soap4r-1.5.
    8/lib/wsdl/xmlSchema/importer.rb:36:in `import'
    from file:/C:/Users/dev/Documents/NetBeansProjects/Java and Ruby/dis
    t/lib/jruby-complete.jar!/META-INF/jruby.home/lib/ruby/gems/1.8/gems/soap4r-1.5.
    8/lib/wsdl/importer.rb:18:in `import'
    from file:/C:/Users/dev/Documents/NetBeansProjects/Java and Ruby/dis
    t/lib/jruby-complete.jar!/META-INF/jruby.home/lib/ruby/gems/1.8/gems/soap4r-1.5.
    8/lib/soap/wsdlDriver.rb:146:in `import'
    from file:/C:/Users/dev/Documents/NetBeansProjects/Java and Ruby/dis
    t/lib/jruby-complete.jar!/META-INF/jruby.home/lib/ruby/gems/1.8/gems/soap4r-1.5.
    8/lib/soap/wsdlDriver.rb:32:in `initialize'
    from file:/C:/Users/dev/Documents/NetBeansProjects/Java and Ruby/dis
    t/Java_and_Ruby.jar!/scripts/ap.rb:58:in `get_wsdl'
    from file:/C:/Users/dev/Documents/NetBeansProjects/Java and Ruby/dis
    t/Java_and_Ruby.jar!/scripts/ap.rb:331
    from file:/C:/Users/dev/Documents/NetBeansProjects/Java and Ruby/dis
    t/Java_and_Ruby.jar!/scripts/ap.rb:1:in `require'
    from -e:1

    Thanks,

    Brian
     
    Brian Wallace, Sep 19, 2009
    #1
    1. Advertising

  2. [Note: parts of this message were removed to make it a legal post.]

    Ok, I believe I've tracked this bug down a bit more (I'm still a newbie ..
    but a persistent one :) )

    It appears as though the recently added JRuby
    "OpenSSL::X509::Store#add_file" method doesn't work with file URL's , which
    are obviously used when referencing files from within a jar. (See JRuby-3692
    for the add_file patch). I've reproduced the issue in irb.

    I guess I should log a bug on JRuby's jira site ... since I couldn't write
    code in Java to save my life.

    On Sat, Sep 19, 2009 at 12:55 AM, Brian Wallace <> wrote:

    > Hi all,
    >
    > I'm attempting to package up my JRuby soap4r client application into a
    > jar, but I'm not having much luck getting it working. I've tried using both
    > rawr and Netbeans to build the jar but I get the same results.
    >
    > I have the soap4r and httpclient gems inside the jruby-complete.jar.. I put
    > the gems here:
    >
    > \META-INF\jruby.home\lib\ruby\gems\1.8\gems\httpclient-2.1.5.2\
    >
    > The problem seems to be with the httpclient gem. Its failing when it reads
    > in the cacert.p7s file. I've verified that the file is there, and everything
    > works fine when its not running from a jar. I believe I can use "net/http"
    > as the client, but I'm hoping I wont have to.
    >
    > Has anyone successfully wrapped a soap4r client into a jar? See the stack
    > trace below ...
    >
    > file:/C:/Users/dev/Documents/NetBeansProjects/Java and
    > Ruby/dist/lib/jruby-c
    >
    > omplete.jar!/META-INF/jruby.home/lib/ruby/gems/1.8/gems/httpclient-2.1.5.2/lib/h
    > ttpclient/ssl_config.rb:149:in `set_trust_ca': file not found:
    > file:\C:\Users\
    > dev\Documents\NetBeansProjects\Java and
    > Ruby\dist\lib\jruby-complete.jar!\META
    >
    > -INF\jruby.home\lib\ruby\gems\1.8\gems\httpclient-2.1.5.2\lib\httpclient\cacert.
    > p7s (The filename, directory name, or volume label syntax is incorrect)
    > (OpenSSL
    > ::X509::StoreError)
    > from file:/C:/Users/dev/Documents/NetBeansProjects/Java and
    > Ruby/dis
    >
    > t/lib/jruby-complete.jar!/META-INF/jruby.home/lib/ruby/gems/1.8/gems/httpclient-
    > 2.1.5.2/lib/httpclient/ssl_config.rb:353:in `load_cacerts'
    > from file:/C:/Users/dev/Documents/NetBeansProjects/Java and
    > Ruby/dis
    >
    > t/lib/jruby-complete.jar!/META-INF/jruby.home/lib/ruby/gems/1.8/gems/httpclient-
    > 2.1.5.2/lib/httpclient/ssl_config.rb:342:in `each'
    > from file:/C:/Users/dev/Documents/NetBeansProjects/Java and
    > Ruby/dis
    >
    > t/lib/jruby-complete.jar!/META-INF/jruby.home/lib/ruby/gems/1.8/gems/httpclient-
    > 2.1.5.2/lib/httpclient/ssl_config.rb:342:in `load_cacerts'
    > from file:/C:/Users/dev/Documents/NetBeansProjects/Java and
    > Ruby/dis
    >
    > t/lib/jruby-complete.jar!/META-INF/jruby.home/lib/ruby/gems/1.8/gems/httpclient-
    > 2.1.5.2/lib/httpclient/ssl_config.rb:85:in `initialize'
    > from file:/C:/Users/dev/Documents/NetBeansProjects/Java and
    > Ruby/dis
    >
    > t/lib/jruby-complete.jar!/META-INF/jruby.home/lib/ruby/gems/1.8/gems/httpclient-
    > 2.1.5.2/lib/httpclient.rb:353:in `initialize'
    > from file:/C:/Users/dev/Documents/NetBeansProjects/Java and
    > Ruby/dis
    >
    > t/lib/jruby-complete.jar!/META-INF/jruby.home/lib/ruby/gems/1.8/gems/soap4r-1.5.
    > 8/lib/wsdl/xmlSchema/importer.rb:66:in `fetch'
    > from file:/C:/Users/dev/Documents/NetBeansProjects/Java and
    > Ruby/dis
    >
    > t/lib/jruby-complete.jar!/META-INF/jruby.home/lib/ruby/gems/1.8/gems/soap4r-1.5.
    > 8/lib/wsdl/xmlSchema/importer.rb:36:in `import'
    > from file:/C:/Users/dev/Documents/NetBeansProjects/Java and
    > Ruby/dis
    >
    > t/lib/jruby-complete.jar!/META-INF/jruby.home/lib/ruby/gems/1.8/gems/soap4r-1.5.
    > 8/lib/wsdl/importer.rb:18:in `import'
    > from file:/C:/Users/dev/Documents/NetBeansProjects/Java and
    > Ruby/dis
    >
    > t/lib/jruby-complete.jar!/META-INF/jruby.home/lib/ruby/gems/1.8/gems/soap4r-1.5.
    > 8/lib/soap/wsdlDriver.rb:146:in `import'
    > from file:/C:/Users/dev/Documents/NetBeansProjects/Java and
    > Ruby/dis
    >
    > t/lib/jruby-complete.jar!/META-INF/jruby.home/lib/ruby/gems/1.8/gems/soap4r-1.5.
    > 8/lib/soap/wsdlDriver.rb:32:in `initialize'
    > from file:/C:/Users/dev/Documents/NetBeansProjects/Java and
    > Ruby/dis
    > t/Java_and_Ruby.jar!/scripts/ap.rb:58:in `get_wsdl'
    > from file:/C:/Users/dev/Documents/NetBeansProjects/Java and
    > Ruby/dis
    > t/Java_and_Ruby.jar!/scripts/ap.rb:331
    > from file:/C:/Users/dev/Documents/NetBeansProjects/Java and
    > Ruby/dis
    > t/Java_and_Ruby.jar!/scripts/ap.rb:1:in `require'
    > from -e:1
    >
    > Thanks,
    >
    > Brian
    >
    >
     
    Brian Wallace, Sep 20, 2009
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Arnold Peters
    Replies:
    0
    Views:
    587
    Arnold Peters
    Jan 5, 2005
  2. muttley
    Replies:
    0
    Views:
    2,732
    muttley
    Oct 20, 2005
  3. cyberco
    Replies:
    4
    Views:
    3,774
    Roedy Green
    Feb 14, 2006
  4. Arnold Peters
    Replies:
    0
    Views:
    672
    Arnold Peters
    Jan 5, 2005
  5. laredotornado
    Replies:
    23
    Views:
    1,279
    Arne Vajhøj
    Jan 26, 2011
Loading...

Share This Page