Please update to use HttpComponents 4.5.
Use of HtmlUnit 2.17 and HttpComponents 4.5 generates the following exception:
java.lang.IllegalArgumentException: Cannot locate declared field class org.apache.http.impl.client.HttpClientBuilder.sslcontext
at org.apache.commons.lang3.Validate.isTrue(Validate.java:155)
at org.apache.commons.lang3.reflect.FieldUtils.readDeclaredField(FieldUtils.java:512)
at com.gargoylesoftware.htmlunit.HttpWebConnection.createConnectionManager(HttpWebConnection.java:890)
at com.gargoylesoftware.htmlunit.HttpWebConnection.getResponse(HttpWebConnection.java:166)
at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseFromWebConnection(WebClient.java:1316)
at com.gargoylesoftware.htmlunit.WebClient.loadWebResponse(WebClient.java:1233)
at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:341)
at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:410)
at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:395)
HttpComponents 4.5 fixes this critical issue in SSL domain validation: https://issues.apache.org/jira/browse/HTTPCLIENT-1613
Already fixed in SVN, please check https://ci.canoo.com/teamcity/project.html?projectId=HtmlUnit
You need to use 18-SNAPSHOT, as 2.17 is fixed to the previous version httpcomponents.
I don't suppose there is an expected ETA on 2.18 to be released? I am currently working on merging HtmlUnit support [1] into the Spring Framework 4.2 release which relies on httpcomponents 4.5.
[1] https://github.com/spring-projects/spring-test-htmlunit
Thanks!
Rob
Hi,
2.18 would be released in 1 to 2 months.
Thanks for the fast reply!
We'd love to be able to include the HtmlUnit support in Spring Framework's 4.2 GA which will be out at the end of July. In order to do this, we need HtmlUnit to support httpcomponents 4.5. If there is anyway that could be taken into consideration for a release it would be greatly appreciated.
Thanks again!
Rob
Noted.
We plan to release 20-22 July, pending discussion with other members.
Ahmed
Thanks for the fast reply! This date looks promising for us to be able to include the new support. Thank you again for your excellent support.
Cheers,
Rob
Hi Ahmed,
We are really looking forward to getting our hands on HtmlUnit 2.18 (with HttpComponents 4.5 support) as soon as possible so that we and the Spring community can begin testing against it prior to the release of Spring Framework 4.2 next week.
Since July 22nd is just around the corner, do you still think you'll be able to put out a release this week?
Thanks for any insight you can provide!
Sam
Last edit: Sam Brannen 2015-07-21
Try us :)
Releasing takes 2 hours (as long as the build is green), and if SourceForge was up, 2.18 would have already been released.
We are internally coordinating about this, don't worry.
Last edit: Ahmed Ashour 2015-07-21
Awesome! :)
Will you post back here once 2.18 has been released? Or should I follow a different channel to get notified about that?
Cheers and good luck with the release,
Sam
I will post here.
cool.
Thx!
Sadly, SourceForge will take more time as hinted in [1]
So, the question to you, what is the last HtmlUnit release day you can handle?
[1] http://t.co/kwtEyY2b99
Hi Ahmed,
That is indeed sad news. We will keep our fingers crossed that SF can get up and running again with all systems in a timely fashion.
Thanks for keeping us in the loop, and we'll get back to you soon regarding a cut-off for an HtmlUnit release date on our end.
Cheers,
Sam
Hi Ahmed,
The last feasible release date for HtmlUnit 2.18 for us would be next Monday, July 27th.
In the interim, would it be possible for us to test against a published snapshot?
Regards,
Sam
I see that the 2.18-SNAPSHOT has been built here:
https://ci.canoo.com/teamcity/viewLog.html?buildTypeId=HtmlUnit_FastBuild&buildId=lastSuccessful&tab=artifacts
So what Maven repository URL do we need to use to build against that snapshot?
I may have already answered my own question...
I'm assuming this is the right place to pull the snapshots from:
https://oss.sonatype.org/content/repositories/snapshots/net/sourceforge/htmlunit/htmlunit/2.18-SNAPSHOT/
Correct? ;)
Hi,
Thanks for feedback.
ci.canoo is our build server, the Jars are always the latest.
And the maven snapshot is outdated by one to two weeks, still you can use it, since there is usually no major API changes.
Update: Spring now has a build running against the latest HtmlUnit 2.18 snapshot (i.e., the one from a few weeks ago): https://build.spring.io/browse/SPR-PUB4
So that should help until 2.18 is officially released.
Thanks to Ronald, 2.18 was just released,
Unfortunately I am out of office with limited internet access, but he would be available to support.
Best wishes for Spring release
Yes, Ronald informed me via email.
Quite nice of him. ;)
And now... the artifacts finally showed up in Maven Central:
http://search.maven.org/#search|gav|1|g%3A%22net.sourceforge.htmlunit%22%20AND%20a%3A%22htmlunit%22
Wihoo!
Thanks for all of your hard work.
We'll let you know if we run into any issues.
Cheers,
Sam and the rest of the Spring Team :)
Update:
All tests passed in my local build, and the feature branch for Spring is currently building against HtmlUnit 2.18 GA here:
https://build.spring.io/browse/SPR-PUB4-6
So everything looks good so far!