[MGNLLDAP-130] Tester jar not compatible with Java 11 Created: 12/Oct/21  Updated: 26/Oct/21  Resolved: 26/Oct/21

Status: Closed
Project: LDAP Connector
Component/s: None
Affects Version/s: 1.10.3
Fix Version/s: None

Type: Bug Priority: Low
Reporter: Richard Gange Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: java11
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
duplicate
duplicates MGNLLDAP-131 Magnolia LDAP-Tester doesn't work wit... Open
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Date of First Response:

 Description   

When trying to use the LDAP tester jar with Java 11 the following issue is observed in the log:

C:\Users\user\Downloads>java -jar magnolia-ldap-tester-1.10.3.jar info.magnolia.jaas.sp.ldap.LDAPAuthenticationModule ldap.properties balaguerc xxxxx
Okt. 12, 2021 11:44:58 VORM. com.google.inject.internal.MessageProcessor visit
INFO: An exception was caught and reported. Message: java.lang.ClassNotFoundException: javax.annotation.PreDestroy
java.lang.TypeNotPresentException: Type javax.annotation.PreDestroy not present
        at java.base/sun.reflect.generics.factory.CoreReflectionFactory.makeNamedType(CoreReflectionFactory.java:117)
        at java.base/sun.reflect.generics.visitor.Reifier.visitClassTypeSignature(Reifier.java:125)
        at java.base/sun.reflect.generics.tree.ClassTypeSignature.accept(ClassTypeSignature.java:49)
        at java.base/sun.reflect.generics.visitor.Reifier.reifyTypeArguments(Reifier.java:68)
        at java.base/sun.reflect.generics.visitor.Reifier.visitClassTypeSignature(Reifier.java:138)
        at java.base/sun.reflect.generics.tree.ClassTypeSignature.accept(ClassTypeSignature.java:49)
        at java.base/sun.reflect.generics.repository.FieldRepository.computeGenericType(FieldRepository.java:90)
        at java.base/sun.reflect.generics.repository.FieldRepository.getGenericType(FieldRepository.java:82)
        at java.base/java.lang.reflect.Field.getGenericType(Field.java:268)
        at com.google.inject.TypeLiteral.getFieldType(TypeLiteral.java:271)
        at com.google.inject.spi.InjectionPoint.<init>(InjectionPoint.java:94)
        at com.google.inject.spi.InjectionPoint$InjectableField.toInjectionPoint(InjectionPoint.java:463)
        at com.google.inject.spi.InjectionPoint.getInjectionPoints(InjectionPoint.java:749)
        at com.google.inject.spi.InjectionPoint.forInstanceMethodsAndFields(InjectionPoint.java:380)
        at com.google.inject.spi.InjectionPoint.forInstanceMethodsAndFields(InjectionPoint.java:399)
        at com.google.inject.internal.BindingBuilder.toInstance(BindingBuilder.java:84)
        at com.mycila.guice.ext.jsr250.Jsr250Module.configure(Jsr250Module.java:47)
        at com.google.inject.AbstractModule.configure(AbstractModule.java:62)
        at com.google.inject.spi.Elements$RecordingBinder.install(Elements.java:340)
        at com.google.inject.AbstractModule.install(AbstractModule.java:122)
        at info.magnolia.objectfactory.guice.GuiceComponentProviderBuilder$1.configure(GuiceComponentProviderBuilder.java:128)
        at com.google.inject.AbstractModule.configure(AbstractModule.java:62)
        at com.google.inject.spi.Elements$RecordingBinder.install(Elements.java:340)
        at com.google.inject.spi.Elements.getElements(Elements.java:110)
        at com.google.inject.util.Modules$OverrideModule.configure(Modules.java:177)
        at com.google.inject.AbstractModule.configure(AbstractModule.java:62)
        at com.google.inject.spi.Elements$RecordingBinder.install(Elements.java:340)
        at com.google.inject.spi.Elements.getElements(Elements.java:110)
        at com.google.inject.internal.InjectorShell$Builder.build(InjectorShell.java:138)
        at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:104)
        at com.google.inject.Guice.createInjector(Guice.java:96)
        at com.google.inject.Guice.createInjector(Guice.java:84)
        at info.magnolia.objectfactory.guice.GuiceComponentProviderBuilder.build(GuiceComponentProviderBuilder.java:149)
        at info.magnolia.jaas.sp.ldap.Tester.prepare(Tester.java:118)
        at info.magnolia.jaas.sp.ldap.Tester.doMain(Tester.java:88)
        at info.magnolia.ldap.tool.LDAPTester.main(LDAPTester.java:84)
Caused by: java.lang.ClassNotFoundException: javax.annotation.PreDestroy
        at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
        at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
        at java.base/java.lang.Class.forName0(Native Method)
        at java.base/java.lang.Class.forName(Class.java:398)
        at java.base/sun.reflect.generics.factory.CoreReflectionFactory.makeNamedType(CoreReflectionFactory.java:114)
        ... 35 more

Exception in thread "main" com.google.common.util.concurrent.UncheckedExecutionException: com.google.common.util.concurrent.UncheckedExecutionException: java.lang.TypeNotPresentException: Type javax.annotation.PreDestroy not present
        at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2218)
        at com.google.common.cache.LocalCache.get(LocalCache.java:4147)
        at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:4151)
        at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:5140)
        at com.google.common.cache.LocalCache$LocalLoadingCache.getUnchecked(LocalCache.java:5146)
        at com.google.inject.internal.FailableCache.get(FailableCache.java:48)
        at com.google.inject.internal.ConstructorInjectorStore.get(ConstructorInjectorStore.java:50)
        at com.google.inject.internal.ConstructorBindingImpl.initialize(ConstructorBindingImpl.java:136)
        at com.google.inject.internal.InjectorImpl.initializeBinding(InjectorImpl.java:533)
        at com.google.inject.internal.AbstractBindingProcessor$Processor$1.run(AbstractBindingProcessor.java:160)
        at com.google.inject.internal.ProcessedBindingData.initializeBindings(ProcessedBindingData.java:44)
        at com.google.inject.internal.InternalInjectorCreator.initializeStatically(InternalInjectorCreator.java:123)
        at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:107)
        at com.google.inject.Guice.createInjector(Guice.java:96)
        at com.google.inject.Guice.createInjector(Guice.java:84)
        at info.magnolia.objectfactory.guice.GuiceComponentProviderBuilder.build(GuiceComponentProviderBuilder.java:149)
        at info.magnolia.jaas.sp.ldap.Tester.prepare(Tester.java:118)
        at info.magnolia.jaas.sp.ldap.Tester.doMain(Tester.java:88)
        at info.magnolia.ldap.tool.LDAPTester.main(LDAPTester.java:84)
Caused by: com.google.common.util.concurrent.UncheckedExecutionException: java.lang.TypeNotPresentException: Type javax.annotation.PreDestroy not present
        at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2218)
        at com.google.common.cache.LocalCache.get(LocalCache.java:4147)
        at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:4151)
        at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:5140)
        at com.google.common.cache.LocalCache$LocalLoadingCache.getUnchecked(LocalCache.java:5146)
        at com.google.inject.internal.FailableCache.get(FailableCache.java:48)
        at com.google.inject.internal.MembersInjectorStore.get(MembersInjectorStore.java:68)
        at com.google.inject.internal.ConstructorInjectorStore.createConstructor(ConstructorInjectorStore.java:74)
        at com.google.inject.internal.ConstructorInjectorStore.access$000(ConstructorInjectorStore.java:29)
        at com.google.inject.internal.ConstructorInjectorStore$1.create(ConstructorInjectorStore.java:37)
        at com.google.inject.internal.ConstructorInjectorStore$1.create(ConstructorInjectorStore.java:33)
        at com.google.inject.internal.FailableCache$1.load(FailableCache.java:37)
        at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3708)
        at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2416)
        at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2299)
        at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2212)
        ... 18 more
Caused by: java.lang.TypeNotPresentException: Type javax.annotation.PreDestroy not present
        at java.base/sun.reflect.generics.factory.CoreReflectionFactory.makeNamedType(CoreReflectionFactory.java:117)
        at java.base/sun.reflect.generics.visitor.Reifier.visitClassTypeSignature(Reifier.java:125)
        at java.base/sun.reflect.generics.tree.ClassTypeSignature.accept(ClassTypeSignature.java:49)
        at java.base/sun.reflect.generics.visitor.Reifier.reifyTypeArguments(Reifier.java:68)
        at java.base/sun.reflect.generics.visitor.Reifier.visitClassTypeSignature(Reifier.java:138)
        at java.base/sun.reflect.generics.tree.ClassTypeSignature.accept(ClassTypeSignature.java:49)
        at java.base/sun.reflect.generics.repository.FieldRepository.computeGenericType(FieldRepository.java:90)
        at java.base/sun.reflect.generics.repository.FieldRepository.getGenericType(FieldRepository.java:82)
        at java.base/java.lang.reflect.Field.getGenericType(Field.java:268)
        at com.google.inject.TypeLiteral.getFieldType(TypeLiteral.java:271)
        at com.google.inject.spi.InjectionPoint.<init>(InjectionPoint.java:94)
        at com.google.inject.spi.InjectionPoint$InjectableField.toInjectionPoint(InjectionPoint.java:463)
        at com.google.inject.spi.InjectionPoint.getInjectionPoints(InjectionPoint.java:749)
        at com.google.inject.spi.InjectionPoint.forInstanceMethodsAndFields(InjectionPoint.java:380)
        at com.google.inject.internal.MembersInjectorStore.createWithListeners(MembersInjectorStore.java:93)
        at com.google.inject.internal.MembersInjectorStore.access$000(MembersInjectorStore.java:37)
        at com.google.inject.internal.MembersInjectorStore$1.create(MembersInjectorStore.java:45)
        at com.google.inject.internal.MembersInjectorStore$1.create(MembersInjectorStore.java:42)
        at com.google.inject.internal.FailableCache$1.load(FailableCache.java:37)
        at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3708)
        at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2416)
        at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2299)
        at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2212)
        ... 33 more
Caused by: java.lang.ClassNotFoundException: javax.annotation.PreDestroy
        at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
        at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
        at java.base/java.lang.Class.forName0(Native Method)
        at java.base/java.lang.Class.forName(Class.java:398)
        at java.base/sun.reflect.generics.factory.CoreReflectionFactory.makeNamedType(CoreReflectionFactory.java:114)
        ... 55 more

Notes
Due to the removal of the class in Java 11. https://stackoverflow.com/questions/52701459/i-cant-use-postconstruct-and-postdestroy-with-java-11



 Comments   
Comment by Tobias Zischler [ 26/Oct/21 ]

Same issue. Other ticket has patch available.

Generated at Mon Feb 12 02:21:51 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.