-
1. Re: java.lang.ClassNotFoundException: org.apache.commons.httpclient.HttpMethod from [Module "org.jboss.resteasy.resteasy-jaxrs:main"
badr Oct 24, 2011 7:26 AM (in response to dkumaran)The problem is in the commons-httpclient-3.1 jar witch is not present in the jboss server, to get arround the problem you cad add it as
a module in your JBoss server at: <JBossAS7_HOME>/modules/org/apache/commons/httpclient/main directory. Basically you need to create the directory structure, put the commons-httpclient-3.1.jar in the main directory, and create a modules.xml file as bellow
<module xmlns="urn:jboss:module:1.0" name="org.apache.commons.httpclient">
<resources>
<resource-root path="commons-httpclient-3.1.jar"/>
<!-- Insert resources here -->
</resources><dependencies>
<module name="org.apache.commons.logging"/>
<module name="org.apache.commons.codec"/>
</dependencies>
</module> -
2. Re: java.lang.ClassNotFoundException: org.apache.commons.httpclient.HttpMethod from [Module "org.jboss.resteasy.resteasy-jaxrs:main"
intr13 Oct 25, 2011 4:47 AM (in response to badr)don't work
update 1:
is need add "org.apache.commons.httpclient" dependency for "org.jboss.resteasy.resteasy-jaxrs" module.
-
3. Re: java.lang.ClassNotFoundException: org.apache.commons.httpclient.HttpMethod from [Module "org.jboss.resteasy.resteasy-jaxrs:main"
rigazilla Oct 25, 2011 7:25 AM (in response to intr13)I had the same problem.
fixed adding commons-httpclient-3.1.jar as dependency into my pom.
-
4. Re: java.lang.ClassNotFoundException: org.apache.commons.httpclient.HttpMethod from [Module "org.jboss.resteasy.resteasy-jaxrs:main"
fissy101 Oct 28, 2011 10:44 AM (in response to dkumaran)I did the following to fix this problem:
- Add "Dependencies: org.apache.httpcomponents" to my war's META-INF/MANIFEST.MF file.
- Specify HttpClient4 in Resteasy's creation of the rest proxy (3.1 is still the default even though AS7 does not come with it).
Here is my code:
{code}
YahooPlacefinderApi client = ProxyFactory.create(
YahooPlacefinderApi.class,
YahooPlacefinderApi.BASE_URL,
new ApacheHttpClient4Executor());
{code}
ApacheHttpClient4Executor is a resteasy class, so you don't have to add any http client libraries to your war.
Dave
-
5. Re: java.lang.ClassNotFoundException: org.apache.commons.httpclient.HttpMethod from [Module "org.jboss.resteasy.resteasy-jaxrs:main"
rigazilla Oct 28, 2011 7:17 PM (in response to fissy101)David,
thanks for your clean solution for the client, I'll remove http-client-3.
I also want to configure resteasy to use httpclient4 on the service side:
I have some annotated classes exposed as rest services.
Can you help me on this point?
Thanks,
Vittorio
-
6. Re: java.lang.ClassNotFoundException: org.apache.commons.httpclient.HttpMethod from [Module "org.jboss.resteasy.resteasy-jaxrs:main"
fissy101 Oct 28, 2011 8:41 PM (in response to rigazilla)Hi Vittorio,
I also have some rest services and haven't done any extra configuration. HttpClient isn't used to provide rest services, just clients.
David
-
7. Re: java.lang.ClassNotFoundException: org.apache.commons.httpclient.HttpMethod from [Module "org.jboss.resteasy.resteasy-jaxrs:main"
rigazilla Oct 29, 2011 6:41 PM (in response to fissy101)Solved.
My rest service uses a rest client
Thanks Dave.
Vittorio
-
8. Re: java.lang.ClassNotFoundException: org.apache.commons.httpclient.HttpMethod from [Module "org.jboss.resteasy.resteasy-jaxrs:main"
badr Nov 25, 2011 2:40 PM (in response to rigazilla)Here is also a nice fix bug https://issues.jboss.org/browse/RESTEASY-526