5 Replies Latest reply on Sep 5, 2006 4:23 PM by awclemen

    JBoss and HttpClient

    wpfeiffe

      I'm trying to use the latest Apache Commons HttpClient in my webapp, but it appears as if JBoss is ignoring the version of this jar in my WEB-INF/lib directory and instead using the class in its (OLD) version of this jar.

      Can anybody explain and possibly offer workaround (other than just using the old version of the lib?

      Thanks!

      PS. I'm including a snip of the stack trace I get:

      2003-07-18 13:37:26,611 ERROR [org.jboss.web.localhost.Engine] ----- Root Cause -----
      java.lang.NoSuchMethodError: org.apache.commons.httpclient.methods.PostMethod.setRequestBody(Ljava/lang/String;)V
      at org.arbfile.web.docket.details.actions.HearingNoticeUtil.getUPSPTrackInfo(HearingNoticeUtil.java:138)

        • 1. Re: JBoss and HttpClient
          jonlee

          Can you replace the old httpclient that JBoss has? I haven't tried this but if existing interfaces that JBoss uses have not changed, then you might be ok.

          • 2. Re: JBoss and HttpClient
            wpfeiffe

            I can do this and it works..., but it kind of kills my clean JBoss installation. I'm just wondering if there is a better way to do this.

            I think this is general problem. If I want to use later versions of a library than the JBoss app level lib, what is the proper thing to do?

            Thanks for your response,


            Bill

            • 3. Re: JBoss and HttpClient
              jonlee

              Oh. In that case, have you tried switching off the Java2 classloading compliance in the web container's jboss-service.xml?

              true

              Due to some apparent confusion between the Java 2 spec and the Servlet spec about delegating class loading. However, I'm not sure if it will work as the httpclient library is a system library. You could give it a try.

              • 4. Re: JBoss and HttpClient
                ndrake

                Hi,

                I'm having the same problem. I tried switching the Java2ClassLoadingCompliance attribute, but that didn't seem to help.

                Anyone have a nice solution for this?

                Thanks,

                Nate

                • 5. Re: JBoss and HttpClient
                  awclemen

                  Sorry to drag this issue out from the depths of nowhere, but three years later, I'm still having the exact same problem.... any ideas on how to handle this?

                  Thanks,
                  Andy