Example.of() mehtod breaks out by NoClassDefFoundError on Quarkus project - java

I'm new on Quarkus to build my project.
It shows NoClassDefFoundError while I using org.springframework.data.domain.Example in quarkus-spring-data-jpa and the error message below:
ERROR [io.qua.ver.htt.run.QuarkusErrorHandler] (executor-thread-7) HTTP Request to /ledger/overview-list-15-0 failed, error id: a1af07be-cbf2-4e41-8371-0bff2f671b93-4: org.jboss.resteasy.spi.UnhandledException: java.lang.NoClassDefFoundError: org/springframework/data/domain/TypedExample
at org.jboss.resteasy.core.ExceptionHandler.handleApplicationException(ExceptionHandler.java:106)
at org.jboss.resteasy.core.ExceptionHandler.handleException(ExceptionHandler.java:372)
at org.jboss.resteasy.core.SynchronousDispatcher.writeException(SynchronousDispatcher.java:218)
at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:519)
at org.jboss.resteasy.core.SynchronousDispatcher.lambda$invoke$4(SynchronousDispatcher.java:261)
at org.jboss.resteasy.core.SynchronousDispatcher.lambda$preprocess$0(SynchronousDispatcher.java:161)
at org.jboss.resteasy.core.interception.jaxrs.PreMatchContainerRequestContext.filter(PreMatchContainerRequestContext.java:364)
at org.jboss.resteasy.core.SynchronousDispatcher.preprocess(SynchronousDispatcher.java:164)
at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:247)
at io.quarkus.resteasy.runtime.standalone.RequestDispatcher.service(RequestDispatcher.java:73)
at io.quarkus.resteasy.runtime.standalone.VertxRequestHandler.dispatch(VertxRequestHandler.java:138)
at io.quarkus.resteasy.runtime.standalone.VertxRequestHandler.access$000(VertxRequestHandler.java:41)
at io.quarkus.resteasy.runtime.standalone.VertxRequestHandler$1.run(VertxRequestHandler.java:93)
at io.quarkus.runtime.CleanableExecutor$CleaningRunnable.run(CleanableExecutor.java:231)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2415)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1452)
at org.jboss.threads.DelegatingRunnable.run(DelegatingRunnable.java:29)
at org.jboss.threads.ThreadLocalResettingRunnable.run(ThreadLocalResettingRunnable.java:29)
at java.base/java.lang.Thread.run(Thread.java:834)
at org.jboss.threads.JBossThread.run(JBossThread.java:501)
Caused by: java.lang.NoClassDefFoundError: org/springframework/data/domain/TypedExample
at org.springframework.data.domain.Example.of(Example.java:39)
at chain.B.ledger.LedgerResource.listOverview(LedgerResource.java:59)
at chain.B.ledger.LedgerResource_ClientProxy.listOverview(LedgerResource_ClientProxy.zig:169)
at jdk.internal.reflect.GeneratedMethodAccessor162.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:170)
at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:130)
at org.jboss.resteasy.core.ResourceMethodInvoker.internalInvokeOnTarget(ResourceMethodInvoker.java:643)
at org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTargetAfterFilter(ResourceMethodInvoker.java:507)
at org.jboss.resteasy.core.ResourceMethodInvoker.lambda$invokeOnTarget$2(ResourceMethodInvoker.java:457)
at org.jboss.resteasy.core.interception.jaxrs.PreMatchContainerRequestContext.filter(PreMatchContainerRequestContext.java:364)
at org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTarget(ResourceMethodInvoker.java:459)
at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:419)
at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:393)
at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:68)
at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:492)
... 18 more
Finally found that necessary classes in Example.class missing!!
How can I fix this?

The Query By Example of Spring Data JPA is currently not supported in the quarkus-spring-data-jpa extension.
See https://quarkus.io/guides/spring-data-jpa#what-is-currently-unsupported

Related

infinispan server fails to start when adding serialization configuration

extending infinispan configuration with a configmap on kubernetes
I have the following configuration:
<infinispan>
<cache-container>
<serialization marshaller="org.infinispan.commons.marshall.JavaSerializationMarshaller">
<allow-list>
<class>org.keycloak.cluster.infinispan.WrapperClusterEvent</class>
<class>java.time.Instant</class>
<regex>.*</regex>
</allow-list>
</serialization>
</cache-container>
</infinispan>
I checked several times and my ispn starts normally without the serialization tag and using other tags such as replicated-cache-configuration works and pods start normally,
so I know that the serialization tag is the culprit but I can't understand why
https://infinispan.org/docs/13.0.x/titles/encoding/encoding.html#adding-deserialization-allowlist_marshaller-implementations
am I missing something from the docs?
the error:
15:49:13,130 FATAL (main) [org.infinispan.SERVER] ISPN080028: Infinispan Server failed to start org.infinispan.manager.EmbeddedCacheManagerStartupException: org.infinispan.commons.CacheConfigurationException: Error starting component org.infinispan.persistence.manager.PersistenceManager
at org.infinispan.manager.DefaultCacheManager.internalStart(DefaultCacheManager.java:770)
at org.infinispan.manager.DefaultCacheManager.start(DefaultCacheManager.java:734)
at org.infinispan.server.SecurityActions.lambda$startCacheManager$1(SecurityActions.java:69)
at org.infinispan.security.Security.doPrivileged(Security.java:56)
at org.infinispan.server.SecurityActions.doPrivileged(SecurityActions.java:40)
at org.infinispan.server.SecurityActions.startCacheManager(SecurityActions.java:72)
at org.infinispan.server.Server.run(Server.java:398)
at org.infinispan.server.Bootstrap.runInternal(Bootstrap.java:165)
at org.infinispan.server.tool.Main.run(Main.java:98)
at org.infinispan.server.Bootstrap.main(Bootstrap.java:50)
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:566)
at org.infinispan.server.loader.Loader.run(Loader.java:106)
at org.infinispan.server.loader.Loader.main(Loader.java:51)
Caused by: org.infinispan.commons.CacheConfigurationException: Error starting component org.infinispan.persistence.manager.PersistenceManager
at org.infinispan.factories.impl.BasicComponentRegistryImpl.startWrapper(BasicComponentRegistryImpl.java:585)
at org.infinispan.factories.impl.BasicComponentRegistryImpl.access$700(BasicComponentRegistryImpl.java:30)
at org.infinispan.factories.impl.BasicComponentRegistryImpl$ComponentWrapper.running(BasicComponentRegistryImpl.java:808)
at org.infinispan.factories.impl.BasicComponentRegistryImpl.startDependencies(BasicComponentRegistryImpl.java:635)
at org.infinispan.factories.impl.BasicComponentRegistryImpl.doStartWrapper(BasicComponentRegistryImpl.java:599)
at org.infinispan.factories.impl.BasicComponentRegistryImpl.startWrapper(BasicComponentRegistryImpl.java:577)
at org.infinispan.factories.impl.BasicComponentRegistryImpl.access$700(BasicComponentRegistryImpl.java:30)
at org.infinispan.factories.impl.BasicComponentRegistryImpl$ComponentWrapper.running(BasicComponentRegistryImpl.java:808)
at org.infinispan.factories.impl.BasicComponentRegistryImpl.startDependencies(BasicComponentRegistryImpl.java:635)
at org.infinispan.factories.impl.BasicComponentRegistryImpl.doStartWrapper(BasicComponentRegistryImpl.java:599)
at org.infinispan.factories.impl.BasicComponentRegistryImpl.startWrapper(BasicComponentRegistryImpl.java:577)
at org.infinispan.factories.impl.BasicComponentRegistryImpl.access$700(BasicComponentRegistryImpl.java:30)
at org.infinispan.factories.impl.BasicComponentRegistryImpl$ComponentWrapper.running(BasicComponentRegistryImpl.java:808)
at org.infinispan.factories.impl.BasicComponentRegistryImpl.startDependencies(BasicComponentRegistryImpl.java:635)
at org.infinispan.factories.impl.BasicComponentRegistryImpl.doStartWrapper(BasicComponentRegistryImpl.java:599)
at org.infinispan.factories.impl.BasicComponentRegistryImpl.startWrapper(BasicComponentRegistryImpl.java:577)
at org.infinispan.factories.impl.BasicComponentRegistryImpl.access$700(BasicComponentRegistryImpl.java:30)
at org.infinispan.factories.impl.BasicComponentRegistryImpl$ComponentWrapper.running(BasicComponentRegistryImpl.java:808)
at org.infinispan.factories.impl.BasicComponentRegistryImpl.startDependencies(BasicComponentRegistryImpl.java:635)
at org.infinispan.factories.impl.BasicComponentRegistryImpl.doStartWrapper(BasicComponentRegistryImpl.java:599)
at org.infinispan.factories.impl.BasicComponentRegistryImpl.startWrapper(BasicComponentRegistryImpl.java:577)
at org.infinispan.factories.impl.BasicComponentRegistryImpl.access$700(BasicComponentRegistryImpl.java:30)
at org.infinispan.factories.impl.BasicComponentRegistryImpl$ComponentWrapper.running(BasicComponentRegistryImpl.java:808)
at org.infinispan.factories.AbstractComponentRegistry.internalStart(AbstractComponentRegistry.java:354)
at org.infinispan.factories.AbstractComponentRegistry.start(AbstractComponentRegistry.java:250)
at org.infinispan.factories.ComponentRegistry.start(ComponentRegistry.java:216)
at org.infinispan.cache.impl.CacheImpl.start(CacheImpl.java:1014)
at org.infinispan.cache.impl.AbstractDelegatingCache.start(AbstractDelegatingCache.java:512)
at org.infinispan.manager.DefaultCacheManager.wireAndStartCache(DefaultCacheManager.java:714)
at org.infinispan.manager.DefaultCacheManager.createCache(DefaultCacheManager.java:660)
at org.infinispan.manager.DefaultCacheManager.internalGetCache(DefaultCacheManager.java:549)
at org.infinispan.manager.DefaultCacheManager.getCache(DefaultCacheManager.java:517)
at org.infinispan.security.actions.GetCacheAction.run(GetCacheAction.java:26)
at org.infinispan.security.actions.GetCacheAction.run(GetCacheAction.java:14)
at org.infinispan.security.Security.doPrivileged(Security.java:61)
at org.infinispan.globalstate.impl.SecurityActions.doPrivileged(SecurityActions.java:30)
at org.infinispan.globalstate.impl.SecurityActions.getCache(SecurityActions.java:39)
at org.infinispan.globalstate.impl.GlobalConfigurationManagerImpl.start(GlobalConfigurationManagerImpl.java:104)
at org.infinispan.globalstate.impl.CorePackageImpl$2.start(CorePackageImpl.java:60)
at org.infinispan.globalstate.impl.CorePackageImpl$2.start(CorePackageImpl.java:48)
at org.infinispan.factories.impl.BasicComponentRegistryImpl.invokeStart(BasicComponentRegistryImpl.java:617)
at org.infinispan.factories.impl.BasicComponentRegistryImpl.doStartWrapper(BasicComponentRegistryImpl.java:608)
at org.infinispan.factories.impl.BasicComponentRegistryImpl.startWrapper(BasicComponentRegistryImpl.java:577)
at org.infinispan.factories.impl.BasicComponentRegistryImpl.access$700(BasicComponentRegistryImpl.java:30)
at org.infinispan.factories.impl.BasicComponentRegistryImpl$ComponentWrapper.running(BasicComponentRegistryImpl.java:808)
at org.infinispan.factories.AbstractComponentRegistry.internalStart(AbstractComponentRegistry.java:354)
at org.infinispan.factories.AbstractComponentRegistry.start(AbstractComponentRegistry.java:250)
at org.infinispan.manager.DefaultCacheManager.internalStart(DefaultCacheManager.java:766)
... 15 more
Caused by: java.util.concurrent.CompletionException: org.infinispan.persistence.spi.PersistenceException: java.io.StreamCorruptedException: invalid stream header: 9801ED07
at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:314)
at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:319)
at java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1739)
at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1982)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1348)
at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: org.infinispan.persistence.spi.PersistenceException: java.io.StreamCorruptedException: invalid stream header: 9801ED07
at org.infinispan.persistence.file.SingleFileStore.blockingStart(SingleFileStore.java:231)
at java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1736)
... 5 more
Caused by: java.io.StreamCorruptedException: invalid stream header: 9801ED07
at java.base/java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:940)
at java.base/java.io.ObjectInputStream.<init>(ObjectInputStream.java:379)
at org.infinispan.commons.marshall.CheckedInputStream.<init>(CheckedInputStream.java:18)
at org.infinispan.commons.marshall.JavaSerializationMarshaller.objectFromByteBuffer(JavaSerializationMarshaller.java:52)
at org.infinispan.commons.marshall.AbstractMarshaller.objectFromByteBuffer(AbstractMarshaller.java:82)
at org.infinispan.marshall.core.impl.DelegatingUserMarshaller.objectFromByteBuffer(DelegatingUserMarshaller.java:63)
at org.infinispan.marshall.protostream.impl.MarshallableUserObject$Marshaller.read(MarshallableUserObject.java:139)
at org.infinispan.marshall.protostream.impl.MarshallableUserObject$Marshaller.read(MarshallableUserObject.java:100)
at org.infinispan.protostream.impl.ProtobufTagMarshallerDelegate.unmarshall(ProtobufTagMarshallerDelegate.java:32)
at org.infinispan.protostream.WrappedMessage.readMessage(WrappedMessage.java:539)
at org.infinispan.protostream.WrappedMessage.read(WrappedMessage.java:351)
at org.infinispan.protostream.ProtobufUtil.fromWrappedByteArray(ProtobufUtil.java:129)
at org.infinispan.marshall.protostream.impl.AbstractInternalProtoStreamMarshaller.objectFromByteBuffer(AbstractInternalProtoStreamMarshaller.java:97)
at org.infinispan.persistence.file.SingleFileStore.rebuildIndex(SingleFileStore.java:395)
at org.infinispan.persistence.file.SingleFileStore.blockingStart(SingleFileStore.java:205)
... 6 more

Failed to init Reactor's debug agent at org.springframework.boot.reactor.DebugAgentEnvironmentPostProcessor

I am using webflux and trying to host on GCP cloud run and getting the error below
java.lang.RuntimeException: Failed to init Reactor's debug agent
at org.springframework.boot.reactor.DebugAgentEnvironmentPostProcessor.postProcessEnvironment(DebugAgentEnvironmentPostProcessor.java:52)
at org.springframework.boot.env.EnvironmentPostProcessorApplicationListener.onApplicationEnvironmentPreparedEvent(EnvironmentPostProcessorApplicationListener.java:102)
at org.springframework.boot.env.EnvironmentPostProcessorApplicationListener.onApplicationEvent(EnvironmentPostProcessorApplicationListener.java:87)
at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:176)
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:169)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:143)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:131)
at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:82)
at org.springframework.boot.SpringApplicationRunListeners.lambda$environmentPrepared$2(SpringApplicationRunListeners.java:63)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:117)
at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:111)
at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:62)
at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:374)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:332)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1343)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1332)
at com.sigma.news.SigmaApplication.main(SigmaApplication.java:13)
Caused by: java.lang.reflect.InvocationTargetException: null
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:566)
at org.springframework.boot.reactor.DebugAgentEnvironmentPostProcessor.postProcessEnvironment(DebugAgentEnvironmentPostProcessor.java:49)
... 17 common frames omitted
Caused by: java.lang.IllegalStateException: Could not self-attach to current VM using external process
at reactor.tools.shaded.net.bytebuddy.agent.ByteBuddyAgent.installExternal(ByteBuddyAgent.java:695)
at reactor.tools.shaded.net.bytebuddy.agent.ByteBuddyAgent.install(ByteBuddyAgent.java:626)
at reactor.tools.shaded.net.bytebuddy.agent.ByteBuddyAgent.install(ByteBuddyAgent.java:606)
at reactor.tools.shaded.net.bytebuddy.agent.ByteBuddyAgent.install(ByteBuddyAgent.java:558)
at reactor.tools.shaded.net.bytebuddy.agent.ByteBuddyAgent.install(ByteBuddyAgent.java:535)
at reactor.tools.agent.ReactorDebugAgent.init(ReactorDebugAgent.java:56)
"java.lang.RuntimeException: Failed to init Reactor's debug agent
at org.springframework.boot.reactor.DebugAgentEnvironmentPostProcessor.postProcessEnvironment(DebugAgentEnvironmentPostProcessor.java:52)
at org.springframework.boot.env.EnvironmentPostProcessorApplicationListener.onApplicationEnvironmentPreparedEvent(EnvironmentPostProcessorApplicationListener.java:102)
at org.springframework.boot.env.EnvironmentPostProcessorApplicationListener.onApplicationEvent(EnvironmentPostProcessorApplicationListener.java:87)
at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:176)
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:169)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:143)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:131)
at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:82)
at org.springframework.boot.SpringApplicationRunListeners.lambda$environmentPrepared$2(SpringApplicationRunListeners.java:63)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:117)
at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:111)
at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:62)
at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:374)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:332)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1343)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1332)
at com.sigma.news.SigmaApplication.main(SigmaApplication.java:13)
Caused by: java.lang.reflect.InvocationTargetException: null
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:566)
at org.springframework.boot.reactor.DebugAgentEnvironmentPostProcessor.postProcessEnvironment(DebugAgentEnvironmentPostProcessor.java:49)
... 17 common frames omitted
Caused by: java.lang.IllegalStateException: Could not self-attach to current VM using external process
at reactor.tools.shaded.net.bytebuddy.agent.ByteBuddyAgent.installExternal(ByteBuddyAgent.java:695)
at reactor.tools.shaded.net.bytebuddy.agent.ByteBuddyAgent.install(ByteBuddyAgent.java:626)
at reactor.tools.shaded.net.bytebuddy.agent.ByteBuddyAgent.install(ByteBuddyAgent.java:606)
at reactor.tools.shaded.net.bytebuddy.agent.ByteBuddyAgent.install(ByteBuddyAgent.java:558)
at reactor.tools.shaded.net.bytebuddy.agent.ByteBuddyAgent.install(ByteBuddyAgent.java:535)
at reactor.tools.agent.ReactorDebugAgent.init(ReactorDebugAgent.java:56)
I am using the below docker file to run the application
FROM openjdk:11-jdk-oracle
WORKDIR /app
COPY .mvn/ .mvn
COPY mvnw pom.xml ./
RUN ./mvnw dependency:go-offline
COPY src ./src
CMD ["./mvnw", "spring-boot:run"]
this spring boot project is running without errors at local with docker run it is showing the above issue when using google cloud run from google cloud build. how can I resolve the issue?
Please try (!) running it under gen2 available with gcloud beta run deploy ... --execution-environment.
See: https://cloud.google.com/run/docs/about-execution-environments#choose
IIUC (!?) Cloud Run virtualizes syscalls. gen1 uses one mechanism (gVisor?) and gen2 another.
I've experienced issues very occasionally wherein a container will run elsewhere but not on Cloud Run gen1. Next time that happens, I'm going to try gen2 but I've not yet had the opportunity.

KeyCloak Server Caused by: java.lang.ClassNotFoundException: java.security.acl.Group with java 11

I am trying to secure my spring application with keycloak and when I invoke the REST API I get the following error:
Caused by: java.lang.ClassNotFoundException: java.security.acl.Group
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:606) ~[na:na]
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:168) ~[na:na]
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522) ~[na:na]
... 19 common frames omitted
I found another post with the same problem (KeyCloak Server Caused by: java.lang.ClassNotFoundException: java.security.acl.Group) and it was solved using Java 11, but I already used it and I'm still getting the same error.
Any idea about how to solve it?
I am using the KC 12.0.4, the config is exported here:
https://github.com/aleon91/keycloak/blob/main/realm-export.json
The Spring Security config is here:
https://github.com/aleon91/keycloak/blob/main/src/main/java/com/leonlyon/auth/config/KeycloakSecurityConfig.java
And the pom.xml here:
https://github.com/aleon91/keycloak/blob/main/pom.xml

Eclipse: Testing with Coverage throws java.lang.instrument.IllegalClassFormatException

I recently changed a couple of things in my Eclipse settings, mainly I upgraded the Java version from 8 to 15 and it took me a while to notice, but I cannot Test with Coverage anymore on any of my Projects as it throws a java.lang.instrument.IllegalClassFormatException with a gigantic StackTrace.
It also gives a PopUp Error, that says "No tests found with test runner 'Junit5'" Something, somewhere in the Java Librarys, Junit, or something must've broken, and I cannot figure out what it is. Normal Testing, Debug Testing and even Maven test all function normally with no indication of anything being wrong.
Here's the Junit Failure Trace:
java.util.ServiceConfigurationError: Locale provider adapter "CLDR"cannot be instantiated.
at java.base/sun.util.locale.provider.LocaleProviderAdapter.forType(LocaleProviderAdapter.java:199)
at java.base/sun.util.locale.provider.LocaleProviderAdapter.findAdapter(LocaleProviderAdapter.java:287)
at java.base/sun.util.locale.provider.LocaleProviderAdapter.getAdapter(LocaleProviderAdapter.java:258)
at java.base/java.text.DecimalFormatSymbols.getInstance(DecimalFormatSymbols.java:180)
at java.base/java.util.Formatter.getZero(Formatter.java:2437)
at java.base/java.util.Formatter.(Formatter.java:1956)
at java.base/java.util.Formatter.(Formatter.java:1978)
at java.base/java.lang.String.format(String.java:3292)
at org.junit.runner.Description.formatDisplayName(Description.java:114)
at org.junit.runner.Description.createTestDescription(Description.java:86)
at org.junit.runners.BlockJUnit4ClassRunner.describeChild(BlockJUnit4ClassRunner.java:121)
at org.junit.runners.BlockJUnit4ClassRunner.describeChild(BlockJUnit4ClassRunner.java:63)
at org.junit.runners.ParentRunner.getDescription(ParentRunner.java:401)
at org.junit.runners.model.RunnerBuilder.configureRunner(RunnerBuilder.java:81)
at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:72)
at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:37)
at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:70)
at org.junit.internal.requests.ClassRequest.createRunner(ClassRequest.java:28)
at org.junit.internal.requests.MemoizingRequest.getRunner(MemoizingRequest.java:19)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.createUnfilteredTest(JUnit4TestLoader.java:90)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.createTest(JUnit4TestLoader.java:76)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.loadTests(JUnit4TestLoader.java:49)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:526)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:770)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:464)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:210)
Caused by: java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:64)
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 java.base/sun.util.locale.provider.LocaleProviderAdapter.forType(LocaleProviderAdapter.java:188)
... 25 more
Caused by: java.util.ServiceConfigurationError: sun.util.locale.provider.LocaleDataMetaInfo: Unable to load sun.util.resources.cldr.provider.CLDRLocaleDataMetaInfo
at java.base/java.util.ServiceLoader.fail(ServiceLoader.java:584)
at java.base/java.util.ServiceLoader.loadProvider(ServiceLoader.java:856)
at java.base/java.util.ServiceLoader$ModuleServicesLookupIterator.hasNext(ServiceLoader.java:1078)
at java.base/java.util.ServiceLoader$2.hasNext(ServiceLoader.java:1301)
at java.base/java.util.ServiceLoader$3.hasNext(ServiceLoader.java:1386)
at java.base/sun.util.cldr.CLDRLocaleProviderAdapter$1.run(CLDRLocaleProviderAdapter.java:89)
at java.base/sun.util.cldr.CLDRLocaleProviderAdapter$1.run(CLDRLocaleProviderAdapter.java:86)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:554)
at java.base/sun.util.cldr.CLDRLocaleProviderAdapter.(CLDRLocaleProviderAdapter.java:86)
... 31 more
Caused by: java.lang.LinkageError: loader 'platform' attempted duplicate class definition for sun.util.resources.cldr.provider.CLDRLocaleDataMetaInfo. (sun.util.resources.cldr.provider.CLDRLocaleDataMetaInfo is in module jdk.localedata of loader 'platform')
at java.base/java.lang.ClassLoader.defineClass2(Native Method)
at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1108)
at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:183)
at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:784)
at java.base/jdk.internal.loader.BuiltinClassLoader.findClassInModuleOrNull(BuiltinClassLoader.java:705)
at java.base/jdk.internal.loader.BuiltinClassLoader.findClass(BuiltinClassLoader.java:586)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:634)
at java.base/java.lang.Class.forName(Class.java:546)
at java.base/java.util.ServiceLoader.loadProvider(ServiceLoader.java:854)
... 38 more
And here the console StackTrace:
java.lang.instrument.IllegalClassFormatException: Error while instrumenting sun/util/resources/cldr/provider/CLDRLocaleDataMetaInfo.
at org.jacoco.agent.rt.internal_43f5073.CoverageTransformer.transform(CoverageTransformer.java:94)
at java.instrument/java.lang.instrument.ClassFileTransformer.transform(ClassFileTransformer.java:246)
at java.instrument/sun.instrument.TransformerManager.transform(TransformerManager.java:188)
at java.instrument/sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:563)
at java.base/java.lang.ClassLoader.defineClass2(Native Method)
at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1108)
at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:183)
at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:784)
at java.base/jdk.internal.loader.BuiltinClassLoader.findClassInModuleOrNull(BuiltinClassLoader.java:705)
at java.base/jdk.internal.loader.BuiltinClassLoader.findClass(BuiltinClassLoader.java:586)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:634)
at java.base/java.lang.Class.forName(Class.java:546)
at java.base/java.util.ServiceLoader.loadProvider(ServiceLoader.java:854)
at java.base/java.util.ServiceLoader$ModuleServicesLookupIterator.hasNext(ServiceLoader.java:1078)
at java.base/java.util.ServiceLoader$2.hasNext(ServiceLoader.java:1301)
at java.base/java.util.ServiceLoader$3.hasNext(ServiceLoader.java:1386)
at java.base/sun.util.cldr.CLDRLocaleProviderAdapter$1.run(CLDRLocaleProviderAdapter.java:89)
at java.base/sun.util.cldr.CLDRLocaleProviderAdapter$1.run(CLDRLocaleProviderAdapter.java:86)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:554)
at java.base/sun.util.cldr.CLDRLocaleProviderAdapter.(CLDRLocaleProviderAdapter.java:86)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:64)
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 java.base/sun.util.locale.provider.LocaleProviderAdapter.forType(LocaleProviderAdapter.java:188)
at java.base/sun.util.locale.provider.LocaleProviderAdapter.findAdapter(LocaleProviderAdapter.java:287)
at java.base/sun.util.locale.provider.LocaleProviderAdapter.getAdapter(LocaleProviderAdapter.java:258)
at java.base/java.text.DecimalFormatSymbols.getInstance(DecimalFormatSymbols.java:180)
at java.base/java.util.Formatter.getZero(Formatter.java:2437)
at java.base/java.util.Formatter.(Formatter.java:1956)
at java.base/java.util.Formatter.(Formatter.java:1978)
at java.base/java.lang.String.format(String.java:3292)
at org.junit.runner.Description.formatDisplayName(Description.java:114)
at org.junit.runner.Description.createTestDescription(Description.java:86)
at org.junit.runners.BlockJUnit4ClassRunner.describeChild(BlockJUnit4ClassRunner.java:121)
at org.junit.runners.BlockJUnit4ClassRunner.describeChild(BlockJUnit4ClassRunner.java:63)
at org.junit.runners.ParentRunner.getDescription(ParentRunner.java:401)
at org.junit.runners.model.RunnerBuilder.configureRunner(RunnerBuilder.java:81)
at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:72)
at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:37)
at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:70)
at org.junit.internal.requests.ClassRequest.createRunner(ClassRequest.java:28)
at org.junit.internal.requests.MemoizingRequest.getRunner(MemoizingRequest.java:19)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.createUnfilteredTest(JUnit4TestLoader.java:90)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.createTest(JUnit4TestLoader.java:76)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.loadTests(JUnit4TestLoader.java:49)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:526)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:770)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:464)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:210)
Caused by: java.io.IOException: Error while instrumenting sun/util/resources/cldr/provider/CLDRLocaleDataMetaInfo.
at org.jacoco.agent.rt.internal_43f5073.core.instr.Instrumenter.instrumentError(Instrumenter.java:159)
at org.jacoco.agent.rt.internal_43f5073.core.instr.Instrumenter.instrument(Instrumenter.java:109)
at org.jacoco.agent.rt.internal_43f5073.CoverageTransformer.transform(CoverageTransformer.java:92)
... 50 more
Caused by: java.lang.IllegalArgumentException: Unsupported class file major version 59
at org.jacoco.agent.rt.internal_43f5073.asm.ClassReader.(ClassReader.java:195)
at org.jacoco.agent.rt.internal_43f5073.asm.ClassReader.(ClassReader.java:176)
at org.jacoco.agent.rt.internal_43f5073.asm.ClassReader.(ClassReader.java:162)
at org.jacoco.agent.rt.internal_43f5073.core.internal.instr.InstrSupport.classReaderFor(InstrSupport.java:280)
at org.jacoco.agent.rt.internal_43f5073.core.instr.Instrumenter.instrument(Instrumenter.java:75)
at org.jacoco.agent.rt.internal_43f5073.core.instr.Instrumenter.instrument(Instrumenter.java:107)
... 51 more
What I find weird about the Stack Trace is that seems to try and use Junit4, despite the fact that I've always used 5 both before and after my changes in Eclipse, but that's about the only thing I can read out of it.
Does someone know which setting in my Eclipse broke or help me decode the StackTrace?
Try with Java 11 or java 1.8.281
JaCoCo version 0.8.5

Why Gradle build fail with java8?

We have Gradle script it is building multiple projects with different sourceCompatibility and targetCompatibility. If my environment variables JAVA_HOME set to jdk7 all the projects are building successfully. Then I changed the JAVA_HOME to jdk8. Now build fail with below errors:
FATAL ERROR in native method: processing of -javaagent failed
FATAL ERROR in native method: processing of -javaagent failed
ava.lang.VerifyError: Expecting a stackmap frame at branch target 51
Exception Details:
Location:
com/test/Tray.<clinit>()V #42: ifnull
Reason:
Expected stackmap frame at this location.
Bytecode:
0x0000000: 08bd 0063 5903 1264 5359 0412 6553 5905
0x0000010: 1266 5359 0612 6753 5907 1268 53b3 006a
0x0000020: 08bd 006c 5903 00b2 0080 c600 09b2 0080
0x0000030: a700 0c12 82b8 0084 59b3 0080 0053 5904
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:386)
at sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:401)
Caused by: java.lang.RuntimeException: Class java/util/UUID could not be instrumented.
at org.jacoco.agent.rt_6l8m50.core.runtime.ModifiedSystemClassRuntime.createFor(ModifiedSystemClassRuntime.java:138)
at org.jacoco.agent.rt_6l8m50.core.runtime.ModifiedSystemClassRuntime.createFor(ModifiedSystemClassRuntime.java:99)
at org.jacoco.agent.rt_6l8m50.JacocoAgent.createRuntime(JacocoAgent.java:128)
at org.jacoco.agent.rt_6l8m50.JacocoAgent.init(JacocoAgent.java:74)
at org.jacoco.agent.rt_6l8m50.JacocoAgent.premain(JacocoAgent.java:165)
... 6 more
Caused by: java.lang.NoSuchFieldException: $jacocoAccess
at java.lang.Class.getField(Class.java:1703)
at org.jacoco.agent.rt_6l8m50.core.runtime.ModifiedSystemClassRuntime.createFor(ModifiedSystemClassRuntime.java:136)
... 10 more
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option UseSplitVerifier; support was removed in 8.0
Exception in thread "main" Could not write standard input into: Gradle Test Executor 2.
java.io.IOException: The pipe is being closed
at java.io.FileOutputStream.writeBytes(Native Method)
at java.io.FileOutputStream.write(FileOutputStream.java:326)
at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82)
at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:140)
at org.gradle.process.internal.streams.ExecOutputHandleRunner.run(ExecOutputHandleRunner.java:50)
at org.gradle.internal.concurrent.DefaultExecutorFactory$StoppableExecutorImpl$1.run(DefaultExecutorFactory.java:64)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:386)
at sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:401)
Caused by: java.lang.RuntimeException: Class java/util/UUID could not be instrumented.
at org.jacoco.agent.rt_6l8m50.core.runtime.ModifiedSystemClassRuntime.createFor(ModifiedSystemClassRuntime.java:138)
at org.jacoco.agent.rt_6l8m50.core.runtime.ModifiedSystemClassRuntime.createFor(ModifiedSystemClassRuntime.java:99)
at org.jacoco.agent.rt_6l8m50.JacocoAgent.createRuntime(JacocoAgent.java:128)
at org.jacoco.agent.rt_6l8m50.JacocoAgent.init(JacocoAgent.java:74)
at org.jacoco.agent.rt_6l8m50.JacocoAgent.premain(JacocoAgent.java:165)
... 6 more
Could you please tel me how to fix this issue with java8?
You may need to play around with your version of JaCoCo and/or ASM according to this. It's a known issue going back to about 2013. Go to the maven search site, find the latest versions and push your test dependencies to the latest available ones and see if that fixes it.

Categories