Hi Bianca,

On 07.04.25 10:12, Bianca Batsch wrote:
Hello,

I just tried the RC3 on our project here (367 modules and counting).
We have a BOM-structured project and I am not finished yet, to ‚remove‘ all 
transient dependencies properly, but I am on it.

We need to use Java 8 and have maven 3.9.9 in the project. I just switched to 
the following settings:
$ mvn --version
Apache Maven 4.0.0-rc-3 (3952d00ce65df6753b63a51e86b1f626c55a8df2)
Maven home: C:\dev\tools\apache-maven-4.0.0-rc-3
Java version: 21, vendor: Eclipse Adoptium, runtime: C:\dev\tools\jdk-21-35
Default locale: de_DE, platform encoding: UTF-8
OS name: "windows 11", version: "10.0", arch: "amd64", family: "winnt"

I get the following Errors:

[ERROR] Errors:
[ERROR]   XmlSerializerTest.testMarshalObject:76 » Conversion No converter 
available
---- Debugging information ----
message             : No converter available
type                : java.util.Arrays$ArrayList
converter           : 
com.thoughtworks.xstream.converters.reflection.ReflectionConverter
message[1]          : Unable to make field protected transient int 
java.util.AbstractList.modCount accessible: module java.base does not "opens 
java.util" to unnamed module @4909b8da
-------------------------------
[ERROR]   XmlSerializerTest.testMarshalObjectOutputStream:43 » Conversion No 
converter available
---- Debugging information ----
message             : No converter available
type                : java.util.Arrays$ArrayList
converter           : 
com.thoughtworks.xstream.converters.reflection.ReflectionConverter
message[1]          : Unable to make field protected transient int 
java.util.AbstractList.modCount accessible: module java.base does not "opens 
java.util" to unnamed module @4909b8da
-------------------------------
[ERROR]   XmlSerializerTest.testMarshalObjectWriter:61 » Conversion No 
converter available
---- Debugging information ----
message             : No converter available
type                : java.util.Arrays$ArrayList
converter           : 
com.thoughtworks.xstream.converters.reflection.ReflectionConverter
message[1]          : Unable to make field protected transient int 
java.util.AbstractList.modCount accessible: module java.base does not "opens 
java.util" to unnamed module @4909b8da
-------------------------------
[ERROR]   CacheTest.before:47 » NoClassDefFound Could not initialize class 
org.mockito.internal.creation.cglib.ClassImposterizer$3
[ERROR]   CacheTest.before:47 » NoClassDefFound Could not initialize class 
org.mockito.internal.creation.cglib.ClassImposterizer$3
[ERROR]   CacheTest.before:47 » NoClassDefFound Could not initialize class 
org.mockito.internal.creation.cglib.ClassImposterizer$3
[ERROR]   CacheTest.before:47 » NoClassDefFound Could not initialize class 
org.mockito.internal.creation.cglib.ClassImposterizer$3
[ERROR]   CacheTest.before:47 » NoClassDefFound Could not initialize class 
org.mockito.internal.creation.cglib.ClassImposterizer$3
[ERROR]   CacheTest.before:47 » NoClassDefFound Could not initialize class 
org.mockito.internal.creation.cglib.ClassImposterizer$3
[ERROR]   CacheTest.before:47 » ExceptionInInitializer
[ERROR]   CacheTest.before:47 » NoClassDefFound Could not initialize class 
org.mockito.internal.creation.cglib.ClassImposterizer$3
[ERROR]   CacheTest.before:47 » NoClassDefFound Could not initialize class 
org.mockito.internal.creation.cglib.ClassImposterizer$3
[ERROR]   CacheTest.before:47 » NoClassDefFound Could not initialize class 
org.mockito.internal.creation.cglib.ClassImposterizer$3
[ERROR]   CacheTest.before:47 » NoClassDefFound Could not initialize class 
org.mockito.internal.creation.cglib.ClassImposterizer$3
[ERROR]   CacheTest.before:47 » NoClassDefFound Could not initialize class 
org.mockito.internal.creation.cglib.ClassImposterizer$3
[ERROR]   MapToBeanTest.testGetAnzahlDynamischeVorgabe:279 » NoClassDefFound 
Could not initialize class 
org.mockito.internal.creation.cglib.ClassImposterizer$3
[ERROR]   MapToBeanTest.testGetAnzahlFesteVorgabe:268 » NoClassDefFound Could 
not initialize class org.mockito.internal.creation.cglib.ClassImposterizer$3
[ERROR]   MapToBeanTest.testGetAnzahlKeineVorgabe:290 » NoClassDefFound Could 
not initialize class org.mockito.internal.creation.cglib.ClassImposterizer$3

We use the following dependencies (just put in here the ones, which I see in 
the stacktrace):

<dependency>
   <groupId>com.thoughtworks.xstream</groupId>
   <artifactId>xstream</artifactId>
   <version>1.4.21</version>
</dependency>

<dependency>
   <groupId>org.mockito</groupId>
   <artifactId>mockito-all</artifactId>
   <version>1.10.19</version>
   <scope>test</scope>
</dependency>

<dependency>
   <groupId>org.mockito</groupId>
   <artifactId>mockito-core</artifactId>
   <version>1.10.19</version>
   <scope>test</scope>
</dependency>


One thing I see in the list is xstream... in that version 1.4.21 the
docs https://x-stream.github.io/changes.html tells that the runtime
requirement for 1.5+ will be JDK 11 that implies that 1.4X does not
really support JDK9(just an assumption)..


But based on the error message:
Unable to make field protected transient int
java.util.AbstractList.modCount accessible: module java.base does not
"opens java.util" to unnamed module @4909b8da
and:
CacheTest.before:47 » NoClassDefFound Could not initialize class
org.mockito.internal.creation.cglib.ClassImposterizer$3


it looks more like an issue with Mockito...

The part about mockito-all and mockito-core... those versions which are
very old... 1.10.19 is from 2014.... and the contained cglib parts might
not be able to handle JDK 21 build(I bet on that) I would suggest to try
to build with JDK 17 (minimum required for Maven 4.0.0-rc3) or try to
upgrade to more recent versions of Mockito (in the meantime 5.17.0). At
least Mockito 2.1 uses ByteBuddy instead of cglib...
Upgrading to newer mockito versions is in general a better idea...


Furthermore why using "mockito-all" and "mockito-core" ... in test scope?

Usually you should use "mockito-core" and maybe mockito-inline (starting
with 3.x if I correclty remember static mocks)... since Mockito 4.x not
required anymore...
In newer days you should go with mockito-bom instead...

Or you have to go the other suggested way and add some "--add-opens" to
your surefire/failsafe configuration...

Kind regards
Karl Heinz Marbaise


Do I need to adjust something more to the seetings?

Best regards
Bianca
SIGNAL IDUNA Krankenversicherung a. G., Sitz: Dortmund, HR B 2405, AG Dortmund
SIGNAL IDUNA Lebensversicherung a. G., Sitz: Hamburg, HR B 2740, AG Hamburg
SIGNAL IDUNA Allgemeine Versicherung AG, Sitz: Dortmund, HR B 19108, AG Dortmund
Vorstände: Ulrich Leitermann (Vorsitzender),
Martin Berger, Dr. Stefan Lemke, Johannes Rath, Daniela Rode,
Fabian Schneider, Torsten Uhlig, Clemens Vatter
Vorsitzender der Aufsichtsräte: Reinhold Schulte
SIGNAL IDUNA Gruppe Hauptverwaltungen,
44121 Dortmund, Hausanschrift: Joseph-Scherer-Str. 3, 44139 Dortmund
20351 Hamburg, Hausanschrift: Neue Rabenstraße 15-19, 20354 Hamburg
www.signal-iduna.de, i...@signal-iduna.de

http://www.dortmund.ihk24.de - www.business-on.de/hamburg - www.hk24.de



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org

Reply via email to