I am trying to upgrade a project from Java 8 to Java 12. I am getting following error when to trying to bring up the service and not sure how to fix it. I have searched for java.lang.IllegalAccessError issues and all I see are related to Powermock.
Javassist library is not explicitly specified, but Gradle using the latest version available(org.javassist:javassist:3.28.0-GA) and I don't see multiple version loaded. I tried --illegal-access=permit VM option, but didn't work. Any ideas or suggestion? Thanks in advance
java.lang.IllegalAccessError: class jdk.internal.reflect.ConstructorAccessorImpl loaded by com.company.custom.metadata.run.CompanyLoader @f2ff811 cannot access jdk/internal/reflect superclass jdk.internal.reflect.MagicAccessorImpl
at java.base/java.lang.ClassLoader.defineClass1(Native Method)
at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1016)
at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:877)
at javassist.Loader.findClass(Loader.java:419)
at javassist.Loader.loadClass(Loader.java:350)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
at java.base/java.lang.ClassLoader.defineClass1(Native Method)
at java.base/java.lang.System$2.defineClass(System.java:2189)
at java.base/jdk.internal.reflect.ClassDefiner.defineClass(ClassDefiner.java:65)
at java.base/jdk.internal.reflect.MethodAccessorGenerator$1.run(MethodAccessorGenerator.java:400)
at java.base/jdk.internal.reflect.MethodAccessorGenerator$1.run(MethodAccessorGenerator.java:394)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:310)
at java.base/jdk.internal.reflect.MethodAccessorGenerator.generate(MethodAccessorGenerator.java:393)
at java.base/jdk.internal.reflect.MethodAccessorGenerator.generateConstructor(MethodAccessorGenerator.java:92)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:55)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:500)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:481)
at org.jboss.logging.Logger.doGetMessageLogger(Logger.java:2573)
at org.jboss.logging.Logger.getMessageLogger(Logger.java:2530)
at org.jboss.logging.Logger.getMessageLogger(Logger.java:2516)
at org.hibernate.validator.internal.util.logging.LoggerFactory.make(LoggerFactory.java:22)
at org.hibernate.validator.internal.engine.ValidatorFactoryConfigurationHelper.(ValidatorFactoryConfigurationHelper.java:51)
at org.hibernate.validator.internal.engine.ValidatorFactoryImpl.(ValidatorFactoryImpl.java:135)
at org.hibernate.validator.HibernateValidator.buildValidatorFactory(HibernateValidator.java:38)
at org.hibernate.validator.internal.engine.AbstractConfigurationImpl.buildValidatorFactory(AbstractConfigurationImpl.java:433)
at io.dropwizard.jersey.validation.Validators.newValidatorFactory(Validators.java:26)
at io.dropwizard.setup.Bootstrap.(Bootstrap.java:67)
at io.dropwizard.Application.run(Application.java:86)
at com.company.api.CompanyService.main(CompanyService.java:571)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:567)
at javassist.Loader.run(Loader.java:328)
at com.company.custom.metadata.CompanyServiceRun.run(CompanyServiceRun.java:151)
at com.company.custom.metadata.CompanyServiceRun.main(CompanyServiceRun.java:198)
I am trying to upgrade a project from Java 8 to Java 12. I am getting following error when to trying to bring up the service and not sure how to fix it. I have searched for java.lang.IllegalAccessError issues and all I see are related to Powermock. Javassist library is not explicitly specified, but Gradle using the latest version available(org.javassist:javassist:3.28.0-GA) and I don't see multiple version loaded. I tried
--illegal-access=permit
VM option, but didn't work. Any ideas or suggestion? Thanks in advancejava.lang.IllegalAccessError: class jdk.internal.reflect.ConstructorAccessorImpl loaded by com.company.custom.metadata.run.CompanyLoader @f2ff811 cannot access jdk/internal/reflect superclass jdk.internal.reflect.MagicAccessorImpl at java.base/java.lang.ClassLoader.defineClass1(Native Method) at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1016) at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:877) at javassist.Loader.findClass(Loader.java:419) at javassist.Loader.loadClass(Loader.java:350) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521) at java.base/java.lang.ClassLoader.defineClass1(Native Method) at java.base/java.lang.System$2.defineClass(System.java:2189) at java.base/jdk.internal.reflect.ClassDefiner.defineClass(ClassDefiner.java:65) at java.base/jdk.internal.reflect.MethodAccessorGenerator$1.run(MethodAccessorGenerator.java:400) at java.base/jdk.internal.reflect.MethodAccessorGenerator$1.run(MethodAccessorGenerator.java:394) at java.base/java.security.AccessController.doPrivileged(AccessController.java:310) at java.base/jdk.internal.reflect.MethodAccessorGenerator.generate(MethodAccessorGenerator.java:393) at java.base/jdk.internal.reflect.MethodAccessorGenerator.generateConstructor(MethodAccessorGenerator.java:92) at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:55) at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:500) at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:481) at org.jboss.logging.Logger.doGetMessageLogger(Logger.java:2573) at org.jboss.logging.Logger.getMessageLogger(Logger.java:2530) at org.jboss.logging.Logger.getMessageLogger(Logger.java:2516) at org.hibernate.validator.internal.util.logging.LoggerFactory.make(LoggerFactory.java:22) at org.hibernate.validator.internal.engine.ValidatorFactoryConfigurationHelper.(ValidatorFactoryConfigurationHelper.java:51)
at org.hibernate.validator.internal.engine.ValidatorFactoryImpl.(ValidatorFactoryImpl.java:135)
at org.hibernate.validator.HibernateValidator.buildValidatorFactory(HibernateValidator.java:38)
at org.hibernate.validator.internal.engine.AbstractConfigurationImpl.buildValidatorFactory(AbstractConfigurationImpl.java:433)
at io.dropwizard.jersey.validation.Validators.newValidatorFactory(Validators.java:26)
at io.dropwizard.setup.Bootstrap.(Bootstrap.java:67)
at io.dropwizard.Application.run(Application.java:86)
at com.company.api.CompanyService.main(CompanyService.java:571)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:567)
at javassist.Loader.run(Loader.java:328)
at com.company.custom.metadata.CompanyServiceRun.run(CompanyServiceRun.java:151)
at com.company.custom.metadata.CompanyServiceRun.main(CompanyServiceRun.java:198)