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
BedrockMission!

Learn More

View all

Sign in to view all badges

Unite test failing - for com.day.commons.httpclient

Avatar

Avatar
Validate 1
Level 2
ashishkhadpe
Level 2

Likes

4 likes

Total Posts

48 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Ignite 1
Boost 3
Boost 1
View profile

Avatar
Validate 1
Level 2
ashishkhadpe
Level 2

Likes

4 likes

Total Posts

48 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Ignite 1
Boost 3
Boost 1
View profile
ashishkhadpe
Level 2

01-02-2021

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 com.day.commons.httpclient class showing below error : 

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

at org.apache.commons.httpclient.HttpState.<init>(HttpState.java:114)
at org.apache.commons.httpclient.HttpClient.<init>(HttpClient.java:183)
at org.apache.commons.httpclient.HttpClient.<init>(HttpClient.java:97)

 

Unite test code looks like below : 

@Test
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?

Accepted Solutions (0)

Answers (1)

Answers (1)

Avatar

Avatar
Ignite 1
MVP
SureshDhulipudi
MVP

Likes

163 likes

Total Posts

174 posts

Correct Reply

49 solutions
Top badges earned
Ignite 1
Give Back 5
Give Back 3
Give Back 10
Give Back
View profile

Avatar
Ignite 1
MVP
SureshDhulipudi
MVP

Likes

163 likes

Total Posts

174 posts

Correct Reply

49 solutions
Top badges earned
Ignite 1
Give Back 5
Give Back 3
Give Back 10
Give Back
View profile
SureshDhulipudi
MVP

02-02-2021

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

How about your regular class functionality?