Project that depends on HtmlUnit transitively depends on Jetty Websocket 8.
The problem is that when one project depends on both HtmlUnit
(and thus transitively on Jetty 8) and Jetty 9, there is a collision.
Example: GWT depends on HtmlUnit for its unit test toolchain and
thus on Jetty Websocket 8. In the same time GWT depends on full
blown Jetty server for its codeserver Super Dev Mode (SDM) toolchain.
Problem: Projects that consume GWT (e.g.: Gerrit Code Review) that
depend on latest GWT 2.7 (that still depends on Jetty 8 because of
transitive dependency on Jetty Websocket 8) and in addition on Jetty 9
have classes collision. That's because Jetty 8 and Jetty 9 cannot co-exist.
Q:
Why GWT project cannot upgrade to Jetty 9 and still depends on outdated Jetty 8?
A:
Because GWT depends on HtmlUnit that depends on outdated Jetty 8
Q: Why projects that consume GWT would like to use Jetty 9 internally and not
just use outdated Jetty 8?
A:
Because Jetty 8 is outdated.
Q:
What is the workaround?
There are only ugly hacks out there atm:
Given project "foo" that depends on both GWT 2.7 and on Jetty 9:
foo => GWT => HtmlUnit => Jetty Websocket 8
| |
| Jetty 8
|
Jetty 9
Outdated Jetty 8 in GWT is only needed to run codeserver proces (needed for SDM).
The idea in this hack is to isolate that process from actual process running Jetty 9.
Big disadvantage: two separate processes are needed to make that work.
Hack #2 solves this problem by merging those two processes in one:
All those problems can be avoided when HtmlUnit could upgrade its Websocket
dependency to Jetty 9.
See also this discussion n GWT contrib ML: [1].
[1] https://groups.google.com/d/topic/google-web-toolkit-contributors/Dfld00oBJW8/discussion
Patch attached.
Last edit: David Ostrovsky 2014-12-21
David, many thanks for the patch. Jetty 9 requires java 7, as far as i know. Because we still have no java7 on our build machine available, our long planned migration to java7 is blocked at the moment. Hopefully we can solve this soon.
Hi David,
Thanks a lot for the patch, it has been committed.
You can get the latest artifacts from https://ci.canoo.com/teamcity/viewLog.html?buildId=137468&buildTypeId=Htmlunit_CheckInBuild&tab=artifacts