Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

[AEM Gems Webinar] Accelerating Experience Manager as a Cloud Service development with Rapid Development Environments

Unite test failing - for


Level 3

Hi All,


We have upgraded our AEM version from 6.2 to 6.5.6. While updating our codebase we observed that our unit test cases are failing for class showing below error : 

java.lang.NoClassDefFoundError: com/day/commons/httpclient/impl/ProxyWrapper

at org.apache.commons.httpclient.HttpState.<init>(
at org.apache.commons.httpclient.HttpClient.<init>(
at org.apache.commons.httpclient.HttpClient.<init>(


Unite test code looks like below : 

public void provideHttpClient_singleton() {

Injector injector = Guice.createInjector(peaberryRssClientModule);

HttpClient httpClientA = injector.getInstance(HttpClient.class);
HttpClient httpClientB = injector.getInstance(HttpClient.class);

assertEquals(httpClientA, httpClientB);



I assume that Uber 6.5 jar provide httpclient version of 4.5.2 and due to which it it giving error for HttpState(which is deprecated list of AEM 6.5). Any quick solution to fix this?

0 Replies


Community Advisor

It is better to rewrite http client code to newer version of apache.http(4.x).

How about your regular class functionality?


Level 3
Hi Suresh, Thank you for your comment. My regular classes looks to be working fine with import org.apache.commons.httpclient.HttpClient. It is just an issue with my unit test cases which are failing currently.


Community Advisor
If the issue only with Unit tests, can't you ignore for this class?, if not, the only option is to update the depricated classes


Level 3
Hi Suresh, for now we have added the Ignore annotation only but we would be happy to fix this. Issue is I am not sure why it is only breaking in unit test only. Also we are hesitant to modify any regular code just to fix unit test.