Open landryb opened 1 year ago
looking at mvn dependency:tree
only shows this version.. so i dunno what drags client 4.5.13 & core 4.4.13 ?
[ESC[1;34mINFOESC[m] org.georchestra.mapstore:mapstore-georchestra:war:1.0-SNAPSHOT
[ESC[1;34mINFOESC[m] +- it.geosolutions.mapstore:mapstore-services:jar:1.4-SNAPSHOT:compile
[ESC[1;34mINFOESC[m] | +- com.codahale.metrics:metrics-httpclient:jar:3.0.2:compile
[ESC[1;34mINFOESC[m] | | \- org.apache.httpcomponents:httpclient:jar:4.2.5:compile
[ESC[1;34mINFOESC[m] | | \- org.apache.httpcomponents:httpcore:jar:4.2.4:compile
dropping the 'last' versions yields:
java.nio.file.NoSuchFileException: /srv/tomcat/georchestra/webapps/mapstore/WEB-INF/lib/httpclient-4.5.13.jar
java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:92)
so something else drags them.
and dropping httpcore 4.2.4 gives the same error:
java.nio.file.NoSuchFileException: /srv/tomcat/georchestra/webapps/mapstore/WEB-INF/lib/httpcore-4.2.4.jar
java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:92)
an upstream mapstore2 war has httpclient-4.5.13.jar
& httpcore-4.4.13.jar
so i guess the conflict come from here ?
@pmauduit @tdipisa @offtherailz any hints on how to solve this ? updating to 2023.01 will update the dependencies and automagically fix it ?
apparently the conflict isnt on httpcore but on httpclient, as the problematic class comes from httpclient-4.5.13.jar
which is the sole hit in all the jars:
root@demo:/srv/tomcat/georchestra/webapps/mapstore/WEB-INF/lib# jar tf httpclient-4.5.13.jar |grep ManagedHttpClientConnectionFactory
org/apache/http/impl/conn/ManagedHttpClientConnectionFactory.class
tried repackaging that jar without the problematic class but that doesnt help. also tried removing only httpclient-4.2.5.jar
but some other jar still depends on it.
apparently that's not new that it causes some kind of conflicts, cf https://github.com/geosolutions-it/MapStore2/issues/7950#issuecomment-1209067089 & https://github.com/geosolutions-it/MapStore2/pull/8468
looking at https://github.com/geosolutions-it/MapStore2/blob/25aeef423d7a1213f7a7971c68c5a3db768dd02d/java/web/pom.xml#L48 it seems the 2022.02.xx branch we're tracking in the MS2 submodule doesnt have geosolutions-it/MapStore2#8468
@landryb unfortunately I don't have much time today for a deeper check but after a quick look I can say that most probably that problem will be fixed after the update to 2023.01.xx where we have provided some dependency management fixes also for that.
testing 2023.02, it seems there's indeed only a single version of httpclient libs/jars:
$unzip -l /usr/share/lib/georchestra-mapstore/mapstore-generic.war |grep httpc
328593 2023-03-08 16:15 WEB-INF/lib/httpcore-4.4.13.jar
328324 2023-06-21 17:53 WEB-INF/lib/httpcore-4.4.15.jar
305001 2023-05-09 10:53 WEB-INF/lib/commons-httpclient-3.1.jar
780321 2023-05-09 11:07 WEB-INF/lib/httpclient-4.5.13.jar
12002 2023-06-21 17:53 WEB-INF/lib/metrics-httpclient-4.2.12.jar
and the internal mapstore proxy works. So... fixed in master, still affecting the now unmaintained/unsupported 2022.02 branch ?
We have the same problem with the Docker image in production ( https://hub.docker.com/layers/geosolutionsit/mapstore2-georchestra/2022.02.02-geOrchestra/images/sha256-dc45f092a3d9b26e35709e0b2ca3e025b1434ac1fec63488497e660c216a5100?context=explores) and the consequence is that we can't use the Geobretagne OGC services. @pmauduit modified the docker image to remove the jars files in conflict.
Describe the bug
like #603 but for httpclient/httpcore jars, right now using the mapstore proxy on master yields an error (cf georchestra/datadir#308):
looking at the content of the war, there are two (conflicting?) versions of http client libs: