Dependency Inheritance with HtmlUnit and Apache HttpClient

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Dependency Inheritance with HtmlUnit and Apache HttpClient

Amit
Hello All

I have a Grails project, which is dependent on HtmlUnit. Anyway, I've supplied a maven dependency:

compile 'net.sourceforge.htmlunit:htmlunit:2.7'

(group:artifactId:version)

But I get the following run time error when calling new WebClient():

org/apache/commons/httpclient/protocol/ProtocolSocketFactory
java.lang.NoClassDefFoundError: org/apache/commons/httpclient/protocol/ProtocolSocketFactory

It seems like HtmlUnit's dependencies are not correctly inherited? Anyone has a hint about it?

Thanks, Amit.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: Dependency Inheritance with HtmlUnit and Apache HttpClient

ld@ldaley.com

On 11/08/2011, at 8:00 PM, Amit Jakubowicz wrote:

> Hello All
>
> I have a Grails project, which is dependent on HtmlUnit. Anyway, I've supplied a maven dependency:
>
> compile 'net.sourceforge.htmlunit:htmlunit:2.7'
>
> (group:artifactId:version)
>
> But I get the following run time error when calling new WebClient():
>
> org/apache/commons/httpclient/protocol/ProtocolSocketFactory
> java.lang.NoClassDefFoundError: org/apache/commons/httpclient/protocol/ProtocolSocketFactory
>
> It seems like HtmlUnit's dependencies are not correctly inherited? Anyone has a hint about it?

What's probably happening is that the version of commons-httpclient that htmlunit 2.7 depends on is being evicted and replaced by a later version that another dependency you are using depends on. And this later version of commons-httpclient does not have the class that htmlunit needs.



---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email