2 Replies Latest reply on Jul 22, 2009 10:38 AM by dringo1980

    Accessing https server from within JBoss (using JBoss AS 5.1

    dringo1980

      Hi there,

      we're using JBoss AS 5.1.0 on a linux server with sun-jdk-6.

      Following scenario:

      From within JBoss we want to access a webservice on a remote server (don't know what software the server runs, don't care, cause it's not under our jurisdiction) with HTTPS.

      We use Apache Commons HttpClient 3.1 to communicate with the server.

      The problem:

      The client.executeMethod(method) gives me a HttpStatus.SC_OK back, but the method.getResponseBodyAsString() is empty (the method.getResponseBodyAsStream() is empty, too).

      I get no exception whatsoever. Just an empty answer.

      And now the kicker:

      When I use the same (Apache Commons HttpClient) code (to talk to the remote server) in a completely JBoss-unrelated command-line application
      it works. I get the HttpStatus.SC_OK and I get a response string object, which I then can parse with my XML parser.

      The request is the same in both cases. Only one time - from within JBoss - it doesn't work and the other time - from a standalone client - it works.

      Questions: Why? What's wrong?

      My guess: it may be some kind of configuration problem. But where to start? Or maybe Apache Commons HttpClient 3.1 is not compatible with JBoss AS 5.1.0?!

      Help please, I'm fresh out of ideas? Does anybody know about this problem and can give me a hand? Please?

      Ciao
      Daniel
      PS: If this is the wrong forum, feel free to move to the correct one. I don't know your rules here, yet.

        • 1. Re: Accessing https server from within JBoss (using JBoss AS
          xmedeko

          Hmm, might be some problem with class loading. Maybe JBoss JARs contain some classes which are used by the HttpClient but have different version.

          Try to debug it, (in a debugger, like Eclipse, or I guess JRE has some option for debugging class loading) or try clasloader isolation with parent delegation set to false.

          • 2. Re: Accessing https server from within JBoss (using JBoss AS
            dringo1980

            Argh!

            Now I feel so stupid....

            Solved it. Somebody (maybe even yours truly) fucked up the config of the test and live system.

            There was a typo in the URL for the https server.

            Now it works.

            And I only found it because I wanted to try and change the DNS name to the actual IP and then it hit me...

            Damn stupid typos in my URLs!

            Thanks anyway, guys & girls!