Yeah, protostuff (third-party lib) does not support Java 17. From my 
understanding there's no way around this. 

My suggestion is to just document it, wait for an update from the authors, and 
remove ROP support from Cayenne 5.0 :) 

Andrus


> On Dec 2, 2021, at 5:20 PM, John Huss <johnth...@gmail.com> wrote:
> 
> After correcting the gradle issue, I'm seeing these test failures on JDK
> 17.0.1:
> 
> [*INFO*] *--- *maven-surefire-plugin:2.22.2:test *(default-test)* @
> cayenne-protostuff* ---*
> 
> [*INFO*]
> 
> [*INFO*] -------------------------------------------------------
> 
> [*INFO*]  T E S T S
> 
> [*INFO*] -------------------------------------------------------
> 
> [*INFO*] Running org.apache.cayenne.configuration.rop.client.
> *ProtostuffModuleProviderTest*
> 
> [*INFO*] *Tests run: 2*, Failures: 0, Errors: 0, Skipped: 0, Time elapsed:
> 0.025 s - in org.apache.cayenne.configuration.rop.client.
> *ProtostuffModuleProviderTest*
> 
> [*INFO*] Running org.apache.cayenne.
> *ObjectContextChangeLogSubListMessageFactoryTest*
> 
> [*ERROR*] *Tests **run: 1*, Failures: 0, *Errors: 1*, Skipped: 0, Time
> elapsed: 0.038 s* <<< FAILURE!* - in org.apache.cayenne.
> *ObjectContextChangeLogSubListMessageFactoryTest*
> 
> [*ERROR*]
> testGetDiffsSerializable(org.apache.cayenne.ObjectContextChangeLogSubListMessageFactoryTest)
> Time elapsed: 0.038 s  <<< ERROR!
> 
> java.lang.ExceptionInInitializerError
> 
> at
> org.apache.cayenne.ObjectContextChangeLogSubListMessageFactoryTest.testGetDiffsSerializable(ObjectContextChangeLogSubListMessageFactoryTest.java:48)
> 
> Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make
> field private final java.lang.Object
> java.util.Collections$SingletonSet.element accessible: module java.base
> does not "opens java.util" to unnamed module @fe48b45
> 
> at
> org.apache.cayenne.ObjectContextChangeLogSubListMessageFactoryTest.testGetDiffsSerializable(ObjectContextChangeLogSubListMessageFactoryTest.java:48)
> 
> 
> [*INFO*] Running org.apache.cayenne.rop.protostuff.
> *ProtostuffROPSerializationTest*
> 
> [*ERROR*] *Tests **run: 3*, Failures: 0, *Errors: 1*, Skipped: 0, Time
> elapsed: 0.019 s* <<< FAILURE!* - in org.apache.cayenne.rop.protostuff.
> *ProtostuffROPSerializationTest*
> 
> [*ERROR*]
> testColumnQuerySerialization(org.apache.cayenne.rop.protostuff.ProtostuffROPSerializationTest)
> Time elapsed: 0.005 s  <<< ERROR!
> 
> java.lang.NoClassDefFoundError: Could not initialize class
> io.protostuff.runtime.PolymorphicCollectionSchema
> 
> at
> org.apache.cayenne.rop.protostuff.ProtostuffROPSerializationTest.testColumnQuerySerialization(ProtostuffROPSerializationTest.java:119)
> 
> 
> [*INFO*] Running org.apache.cayenne.rop.protostuff.
> *ProtostuffPersistentObjectCollectionsTest*
> 
> [*ERROR*] *Tests **run: 6*, Failures: 0, *Errors: 6*, Skipped: 0, Time
> elapsed: 0.006 s* <<< FAILURE!* - in org.apache.cayenne.rop.protostuff.
> *ProtostuffPersistentObjectCollectionsTest*
> 
> [*ERROR*]
> testPersistentObjectMapWithWrapper(org.apache.cayenne.rop.protostuff.ProtostuffPersistentObjectCollectionsTest)
> Time elapsed: 0.004 s  <<< ERROR!
> 
> java.lang.ExceptionInInitializerError
> 
> at
> org.apache.cayenne.rop.protostuff.ProtostuffPersistentObjectCollectionsTest.testPersistentObjectMapWithWrapper(ProtostuffPersistentObjectCollectionsTest.java:150)
> 
> Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make
> field private final java.lang.Object java.util.Collections$SingletonMap.k
> accessible: module java.base does not "opens java.util" to unnamed module
> @fe48b45
> 
> at
> org.apache.cayenne.rop.protostuff.ProtostuffPersistentObjectCollectionsTest.testPersistentObjectMapWithWrapper(ProtostuffPersistentObjectCollectionsTest.java:150)
> 
> 
> [*ERROR*]
> testPersistentObjectMap(org.apache.cayenne.rop.protostuff.ProtostuffPersistentObjectCollectionsTest)
> Time elapsed: 0.001 s  <<< ERROR!
> 
> java.lang.NoClassDefFoundError: Could not initialize class
> io.protostuff.runtime.PolymorphicMapSchema
> 
> at
> org.apache.cayenne.rop.protostuff.ProtostuffPersistentObjectCollectionsTest.testPersistentObjectMap(ProtostuffPersistentObjectCollectionsTest.java:134)
> 
> 
> [*ERROR*]
> testPersistentObjectSet(org.apache.cayenne.rop.protostuff.ProtostuffPersistentObjectCollectionsTest)
> Time elapsed: 0 s  <<< ERROR!
> 
> java.lang.NoClassDefFoundError: Could not initialize class
> io.protostuff.runtime.PolymorphicCollectionSchema
> 
> at
> org.apache.cayenne.rop.protostuff.ProtostuffPersistentObjectCollectionsTest.testPersistentObjectSet(ProtostuffPersistentObjectCollectionsTest.java:98)
> 
> 
> [*ERROR*]
> testPersistentObjectList(org.apache.cayenne.rop.protostuff.ProtostuffPersistentObjectCollectionsTest)
> Time elapsed: 0 s  <<< ERROR!
> 
> java.lang.NoClassDefFoundError: Could not initialize class
> io.protostuff.runtime.PolymorphicCollectionSchema
> 
> at
> org.apache.cayenne.rop.protostuff.ProtostuffPersistentObjectCollectionsTest.testPersistentObjectList(ProtostuffPersistentObjectCollectionsTest.java:63)
> 
> 
> [*ERROR*]
> testPersistentObjectSetWithWrapper(org.apache.cayenne.rop.protostuff.ProtostuffPersistentObjectCollectionsTest)
> Time elapsed: 0.001 s  <<< ERROR!
> 
> java.lang.NoClassDefFoundError: Could not initialize class
> io.protostuff.runtime.PolymorphicCollectionSchema
> 
> at
> org.apache.cayenne.rop.protostuff.ProtostuffPersistentObjectCollectionsTest.testPersistentObjectSetWithWrapper(ProtostuffPersistentObjectCollectionsTest.java:114)
> 
> 
> [*ERROR*]
> testPersistentObjectListWithWrapper(org.apache.cayenne.rop.protostuff.ProtostuffPersistentObjectCollectionsTest)
> Time elapsed: 0 s  <<< ERROR!
> 
> java.lang.NoClassDefFoundError: Could not initialize class
> io.protostuff.runtime.PolymorphicCollectionSchema
> 
> at
> org.apache.cayenne.rop.protostuff.ProtostuffPersistentObjectCollectionsTest.testPersistentObjectListWithWrapper(ProtostuffPersistentObjectCollectionsTest.java:79)
> 
> 
> [*INFO*] Running org.apache.cayenne.query.*PrefetchTreeNodeSchemaTest*
> 
> [*INFO*] *Tests run: 1*, Failures: 0, Errors: 0, Skipped: 0, Time elapsed:
> 0.001 s - in org.apache.cayenne.query.*PrefetchTreeNodeSchemaTest*
> 
> [*INFO*]
> 
> [*INFO*] Results:
> 
> [*INFO*]
> 
> [*ERROR*] *Errors: *
> 
> [*ERROR*] *
> ObjectContextChangeLogSubListMessageFactoryTest.testGetDiffsSerializable:48
> » ExceptionInInitializer*
> 
> [*ERROR*] *
> ProtostuffPersistentObjectCollectionsTest.testPersistentObjectList:63 »
> NoClassDefFound*
> 
> [*ERROR*] *
> ProtostuffPersistentObjectCollectionsTest.testPersistentObjectListWithWrapper:79
> » NoClassDefFound*
> 
> [*ERROR*] *
> ProtostuffPersistentObjectCollectionsTest.testPersistentObjectMap:134 »
> NoClassDefFound*
> 
> [*ERROR*] *
> ProtostuffPersistentObjectCollectionsTest.testPersistentObjectMapWithWrapper:150
> » ExceptionInInitializer*
> 
> [*ERROR*] *
> ProtostuffPersistentObjectCollectionsTest.testPersistentObjectSet:98 »
> NoClassDefFound*
> 
> [*ERROR*] *
> ProtostuffPersistentObjectCollectionsTest.testPersistentObjectSetWithWrapper:114
> » NoClassDefFound*
> 
> [*ERROR*] *
> ProtostuffROPSerializationTest.testColumnQuerySerialization:119 »
> NoClassDefFound*
> 
> [*INFO*]
> 
> [*ERROR*] *Tests run: 13, Failures: 0, Errors: 8, Skipped: 0*
> 
> [*INFO*]
> 
> [*INFO*]
> *------------------------------------------------------------------------*
> 
> [*INFO*] *Reactor Summary for cayenne-parent: Top-level parent of Cayenne
> modules 4.2.B1:*
> 
> [*INFO*]
> 
> [*INFO*] cayenne-parent: Top-level parent of Cayenne modules
> *SUCCESS* [  0.341
> s]
> 
> [*INFO*] build-tools-parent: Cayenne Build Tools Parent .....
> *SUCCESS* [  0.011
> s]
> 
> [*INFO*] cayenne-legal: Cayenne License and Notice Bundle ...
> *SUCCESS* [  0.376
> s]
> 
> [*INFO*] cayenne-test-utilities: Common Unit Test Utilities .
> *SUCCESS* [  0.470
> s]
> 
> [*INFO*] cayenne-checkers: Cayenne Code Checkers ............
> *SUCCESS* [  0.255
> s]
> 
> [*INFO*] cayenne-di: Cayenne Dependency Injection Container .
> *SUCCESS* [  1.480
> s]
> 
> [*INFO*] cayenne-server: Cayenne Server ..................... *SUCCESS* [
> 41.520 s]
> 
> [*INFO*] cayenne-project: Cayenne Project ...................
> *SUCCESS* [  1.123
> s]
> 
> [*INFO*] cayenne-dbsync: Database Synchronization Tools .....
> *SUCCESS* [  4.858
> s]
> 
> [*INFO*] cayenne-cgen: Cayenne Class Generation Tools .......
> *SUCCESS* [  1.382
> s]
> 
> [*INFO*] cayenne-ant: Cayenne Ant Tasks .....................
> *SUCCESS* [  1.977
> s]
> 
> [*INFO*] cayenne-cache-invalidation: Cayenne Cache Invalidation *SUCCESS* [
> 1.406 s]
> 
> [*INFO*] cayenne-web: Cayenne Web Extensions ................
> *SUCCESS* [  0.874
> s]
> 
> [*INFO*] cayenne-rop-server .................................
> *SUCCESS* [  1.068
> s]
> 
> [*INFO*] cayenne-client: Cayenne ROP Client .................
> *SUCCESS* [  7.642
> s]
> 
> [*INFO*] cayenne-client-jetty: Cayenne ROP Client (Jetty) ...
> *SUCCESS* [  1.429
> s]
> 
> [*INFO*] cayenne-commitlog: Cayenne Commit Log Module .......
> *SUCCESS* [  1.832
> s]
> 
> [*INFO*] cayenne-maven-plugins-parent: Maven Plugins parent .
> *SUCCESS* [  0.159
> s]
> 
> [*INFO*] cayenne-maven-plugin: Cayenne Maven Plugin .........
> *SUCCESS* [  5.755
> s]
> 
> [*INFO*] cayenne-crypto: Cayenne Cryptography Extensions ....
> *SUCCESS* [  2.592
> s]
> 
> [*INFO*] cayenne-dbcp2: Cayenne DBCP2 Extension .............
> *SUCCESS* [  0.613
> s]
> 
> [*INFO*] cayenne-gradle-plugin: Cayenne Gradle Plugin ....... *SUCCESS* [
> 35.713 s]
> 
> [*INFO*] cayenne-jcache: Cayenne JCache Integration .........
> *SUCCESS* [  2.241
> s]
> 
> [*INFO*] cayenne-joda: Cayenne Joda Extensions ..............
> *SUCCESS* [  1.499
> s]
> 
> [*INFO*] cayenne-lifecycle: Cayenne Lifecycle Utilities .....
> *SUCCESS* [  1.192
> s]
> 
> [*INFO*] cayenne-project-compatibility ......................
> *SUCCESS* [  1.309
> s]
> 
> [*INFO*] cayenne-protostuff: Cayenne Protostuff Extension ...
> *FAILURE* [  0.704
> s]
> 
> 
> 
> 
> On Thu, Dec 2, 2021 at 9:05 AM Michael Gentry <blackn...@gmail.com> wrote:
> 
>> If this helps make it clearer for anyone...
>> 
>> In your Cayenne source code folder (from Git, not the distribution):
>> 
>> [mrg@odin 09:38:53] ~/Projects/cayenne master> git checkout tags/4.2.B1
>> Note: switching to 'tags/4.2.B1'.
>> ...
>> [mrg@odin 09:39:17] ~/Projects/cayenne (HEAD detached at 4.2.B1)>
>> 
>> 
>> In your distribution source folder (downloaded from the link above):
>> 
>> [mrg@odin 09:40:18] ~/Projects/Cayenne-Release/cayenne-4.2.B1-src > mkdir
>> -p cayenne-gradle-plugin/gradle
>> [mrg@odin 09:41:22] ~/Projects/Cayenne-Release/cayenne-4.2.B1-src > cp -rp
>> ~/Projects/cayenne/cayenne-gradle-plugin/gradle/wrapper
>> cayenne-gradle-plugin/gradle
>> 
>> Maybe we need a copy_gradle_jars.sh or similar to simplify this step?
>> 
>> 
>> On Thu, Dec 2, 2021 at 7:02 AM Nikita Timofeev <ntimof...@objectstyle.com>
>> wrote:
>> 
>>> Hi John,
>>> 
>>> Yeah, that's expected. You need manually copy
>>> 'cayenne-gradle-plugin/gradle' directory from the git checkout to the
>>> source release.
>>> Can't bundle it with the source code release due to the Apache policies.
>>> 
>>> On Wed, Dec 1, 2021 at 9:37 PM John Huss <johnth...@gmail.com> wrote:
>>>> 
>>>> Note, I'm using java 17.0.1 on an M1 mac.
>>>> 
>>>> On Wed, Dec 1, 2021 at 12:34 PM John Huss <johnth...@gmail.com> wrote:
>>>> 
>>>>> Is there a dependency I need to install first for the gradle plugin
>> to
>>>>> build? I'm getting this error when building:
>>>>> 
>>>>> [*INFO*] *--- *exec-maven-plugin:1.6.0:exec *(gradle)* @
>>>>> cayenne-gradle-plugin* ---*
>>>>> 
>>>>> Error: Could not find or load main class
>>>>> org.gradle.wrapper.GradleWrapperMain
>>>>> 
>>>>> Caused by: java.lang.ClassNotFoundException:
>>>>> org.gradle.wrapper.GradleWrapperMain
>>>>> 
>>>>> On Wed, Dec 1, 2021 at 10:19 AM Nikita Timofeev <
>>> ntimof...@objectstyle.com>
>>>>> wrote:
>>>>> 
>>>>>> Hi all,
>>>>>> 
>>>>>> Here's a new build of 4.2.B1.
>>>>>> 
>>>>>> Release notes:
>>>>>> https://github.com/apache/cayenne/blob/4.2.B1/RELEASE-NOTES.txt
>>>>>> Maven repo:
>>>>>> 
>>> 
>> https://repository.apache.org/content/repositories/orgapachecayenne-1046/
>>>>>> Assemblies: https://dist.apache.org/repos/dist/dev/cayenne/4.2.B1/
>>>>>> 
>>>>>> Please evaluate and cast your votes.
>>>>>> 
>>>>>> --
>>>>>> Best regards,
>>>>>> Nikita Timofeev
>>>>>> 
>>>>> 
>>> 
>>> 
>>> 
>>> --
>>> Best regards,
>>> Nikita Timofeev
>>> 
>> 

Reply via email to