Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

two versions of groovy jars in the classpath #267

Closed
landryb opened this issue Dec 6, 2023 · 5 comments · Fixed by #279
Closed

two versions of groovy jars in the classpath #267

landryb opened this issue Dec 6, 2023 · 5 comments · Fixed by #279
Assignees
Milestone

Comments

@landryb
Copy link
Member

landryb commented Dec 6, 2023

as found out by @pmauduit in georchestra/ansible#125 (comment) the geonetwork war we ship so far has two versions of groovy libs in the classpath:

-rw-r----- 1 tomcat tomcat 5443828 May  9  2023 /srv/tomcat/georchestra/webapps/geonetwork/WEB-INF/lib/groovy-2.5.5.jar
-rw-r----- 1 tomcat tomcat 7203079 May  9  2023 /srv/tomcat/georchestra/webapps/geonetwork/WEB-INF/lib/groovy-all-2.4.21.jar

this prevents GN4 to start with an ugly ton of backtraces in the logs, removing groovy-2.5.5.jar from the webapp fixes the issue.

@landryb landryb mentioned this issue Dec 7, 2023
8 tasks
@landryb
Copy link
Member Author

landryb commented Dec 8, 2023

with groovy 2.5.5 removed, sometimes i see this in the log:

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.codehaus.groovy.vmplugin.v7.Java7$1 (file:/srv/tomcat/georchestra/webapps/geonetwork/WEB-INF/lib/groovy-all-2.4.21.jar) to constructor java.lang.invoke.MethodHandles$Lookup(java.lang.Class,int)
WARNING: Please consider reporting this to the maintainers of org.codehaus.groovy.vmplugin.v7.Java7$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release

@pmauduit
Copy link
Member

pmauduit commented Dec 8, 2023

this is due to some changes in Java 9 as far as I remember, see also:
https://issues.apache.org/jira/browse/GROOVY-8339

@landryb
Copy link
Member Author

landryb commented Jan 2, 2024

@pmauduit could we use some kind of exclude for groovy-2.5.5.jar in

<packagingExcludes>
to workaround this crap ?

@landryb
Copy link
Member Author

landryb commented Jan 3, 2024

i've tried the obvious diff:

[03/01 14:50] [email protected]:/data/src/georchestra/georchestra/geonetwork $git diff web/pom.xml
diff --git a/web/pom.xml b/web/pom.xml
index 1bc6a323b7..e0c1a2534d 100644
--- a/web/pom.xml
+++ b/web/pom.xml
@@ -947,6 +947,7 @@
             WEB-INF/data/index/**,
             WEB-INF/data/data/backup/**,
             WEB-INF/data/data/resources/htmlcache/**,
+            WEB-INF/lib/groovy-2.5.5.jar,
             catalog/lib/style/bootstrap/docs/**,
             catalog/lib/style/bootstrap/fonts/**,
             catalog/lib/style/bootstrap/grunt/**,

but the jar is still packaged in the war regardless:

$unzip -l /data/src/georchestra/georchestra/geonetwork/web/target/geonetwork-generic.war|grep groovy.*jar
    20372  2023-12-29 11:01   WEB-INF/lib/camel-groovy-2.25.1.jar
  5443828  2023-12-29 11:01   WEB-INF/lib/groovy-2.5.5.jar
  7203079  2023-12-29 10:56   WEB-INF/lib/groovy-all-2.4.21.jar

@landryb
Copy link
Member Author

landryb commented Jan 15, 2024

according to https://stackoverflow.com/a/36646805 packagingExcludes doesnt apply to jars coming from dependencies.

according to mvn dependency:tree the dependency comes from camel-groovy 2.25.1:

 org.geonetwork-opensource:gn-workers:pom:4.2.2-georchestra
 +- org.apache.camel:camel-groovy:jar:2.25.1:compile
 |  \- org.codehaus.groovy:groovy:jar:2.5.5:compile

an update to 2.25.4 was attempted in geonetwork/core-geonetwork#6364 but reverted later on for causing regressions.

landryb added a commit to landryb/geonetwork that referenced this issue Jan 15, 2024
@landryb landryb linked a pull request Jan 15, 2024 that will close this issue
@landryb landryb self-assigned this Jan 16, 2024
@landryb landryb added this to the 23.0.7 milestone Jan 16, 2024
landryb added a commit that referenced this issue Jan 18, 2024
dont ship an extra version of groovy jar (fixes #267)
github-actions bot pushed a commit that referenced this issue Jan 18, 2024
that extra jar breaks geonetwork startup, cf georchestra/ansible#125 (comment)

(cherry picked from commit 1533f8b)
f-necas pushed a commit that referenced this issue Jan 25, 2024
dont ship an extra version of groovy jar (fixes #267)
f-necas pushed a commit that referenced this issue Jan 26, 2024
dont ship an extra version of groovy jar (fixes #267)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants