Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin incompatible with 10.1.0 SonarQube bug #782

Closed
rnoberger opened this issue Jun 21, 2023 · 12 comments
Closed

Plugin incompatible with 10.1.0 SonarQube bug #782

rnoberger opened this issue Jun 21, 2023 · 12 comments
Labels
bug Something isn't working

Comments

@rnoberger
Copy link

Describe the bug
UI does not show up on upgrade to SonarQube 10.1.0

To Reproduce
Perform an upgrade to 10.1.0

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Software Versions

  • SonarQube Version: 10.1.0 (build 73491)
  • Plugin Version: 1.15.0-SNAPSHOT from Pull-Request

Additional context
Here is the error message:

2023.06.21 11:55:45 WARN  web[][o.s.c.a.AnnotationConfigApplicationContext] Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'jdk.internal.loader.ClassLoaders$AppClassLoader@251a69d7-org.sonar.server.ws.WebServiceEngine': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'jdk.internal.loader.ClassLoaders$AppClassLoader@251a69d7-com.github.mc1arke.sonarqube.plugin.server.pullrequest.ws.pullrequest.PullRequestWs': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jdk.internal.loader.ClassLoaders$AppClassLoader@251a69d7-com.github.mc1arke.sonarqube.plugin.server.pullrequest.ws.pullrequest.action.ListAction': Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.github.mc1arke.sonarqube.plugin.server.pullrequest.ws.pullrequest.action.ListAction]: Constructor threw exception; nested exception is java.lang.IncompatibleClassChangeError: Inconsistent constant pool data in classfile for class org/sonar/server/ws/WsUtils. Method 'void writeProtobuf(com.google.protobuf.Message, org.sonar.api.server.ws.Request, org.sonar.api.server.ws.Response)' at index 432 is CONSTANT_MethodRef and should be CONSTANT_InterfaceMethodRef
2023.06.21 11:55:45 ERROR web[][o.s.s.p.Platform] Background initialization failed. Stopping SonarQube
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'jdk.internal.loader.ClassLoaders$AppClassLoader@251a69d7-org.sonar.server.ws.WebServiceEngine': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'jdk.internal.loader.ClassLoaders$AppClassLoader@251a69d7-com.github.mc1arke.sonarqube.plugin.server.pullrequest.ws.pullrequest.PullRequestWs': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jdk.internal.loader.ClassLoaders$AppClassLoader@251a69d7-com.github.mc1arke.sonarqube.plugin.server.pullrequest.ws.pullrequest.action.ListAction': Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.github.mc1arke.sonarqube.plugin.server.pullrequest.ws.pullrequest.action.ListAction]: Constructor threw exception; nested exception is java.lang.IncompatibleClassChangeError: Inconsistent constant pool data in classfile for class org/sonar/server/ws/WsUtils. Method 'void writeProtobuf(com.google.protobuf.Message, org.sonar.api.server.ws.Request, org.sonar.api.server.ws.Response)' at index 432 is CONSTANT_MethodRef and should be CONSTANT_InterfaceMethodRef
        at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:800)
        at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:229)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1372)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1222)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542)
        at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:955)
        at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:920)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583)
        at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:187)
        at org.sonar.server.platform.platformlevel.PlatformLevel.start(PlatformLevel.java:80)
        at org.sonar.server.platform.platformlevel.PlatformLevel4.start(PlatformLevel4.java:662)
        at org.sonar.server.platform.PlatformImpl.start(PlatformImpl.java:214)
        at org.sonar.server.platform.PlatformImpl.startLevel34Containers(PlatformImpl.java:194)
        at org.sonar.server.platform.PlatformImpl$AutoStarterRunnable.runIfNotAborted(PlatformImpl.java:362)
        at org.sonar.server.platform.PlatformImpl$1.doRun(PlatformImpl.java:113)
        at org.sonar.server.platform.PlatformImpl$AutoStarterRunnable.run(PlatformImpl.java:346)
        at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'jdk.internal.loader.ClassLoaders$AppClassLoader@251a69d7-com.github.mc1arke.sonarqube.plugin.server.pullrequest.ws.pullrequest.PullRequestWs': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jdk.internal.loader.ClassLoaders$AppClassLoader@251a69d7-com.github.mc1arke.sonarqube.plugin.server.pullrequest.ws.pullrequest.action.ListAction': Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.github.mc1arke.sonarqube.plugin.server.pullrequest.ws.pullrequest.action.ListAction]: Constructor threw exception; nested exception is java.lang.IncompatibleClassChangeError: Inconsistent constant pool data in classfile for class org/sonar/server/ws/WsUtils. Method 'void writeProtobuf(com.google.protobuf.Message, org.sonar.api.server.ws.Request, org.sonar.api.server.ws.Response)' at index 432 is CONSTANT_MethodRef and should be CONSTANT_InterfaceMethodRef
        at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:800)
        at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:229)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1372)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1222)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542)
        at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208)
        at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.addCandidateEntry(DefaultListableBeanFactory.java:1609)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:1573)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveMultipleBeans(DefaultListableBeanFactory.java:1439)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1349)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1311)
        at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:887)
        at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:791)
        ... 21 common frames omitted
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jdk.internal.loader.ClassLoaders$AppClassLoader@251a69d7-com.github.mc1arke.sonarqube.plugin.server.pullrequest.ws.pullrequest.action.ListAction': Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.github.mc1arke.sonarqube.plugin.server.pullrequest.ws.pullrequest.action.ListAction]: Constructor threw exception; nested exception is java.lang.IncompatibleClassChangeError: Inconsistent constant pool data in classfile for class org/sonar/server/ws/WsUtils. Method 'void writeProtobuf(com.google.protobuf.Message, org.sonar.api.server.ws.Request, org.sonar.api.server.ws.Response)' at index 432 is CONSTANT_MethodRef and should be CONSTANT_InterfaceMethodRef
        at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:315)
        at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:296)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1372)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1222)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542)
        at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208)
        at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.addCandidateEntry(DefaultListableBeanFactory.java:1609)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:1573)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveMultipleBeans(DefaultListableBeanFactory.java:1439)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1349)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1311)
        at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:887)
        at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:791)
        ... 38 common frames omitted
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.github.mc1arke.sonarqube.plugin.server.pullrequest.ws.pullrequest.action.ListAction]: Constructor threw exception; nested exception is java.lang.IncompatibleClassChangeError: Inconsistent constant pool data in classfile for class org/sonar/server/ws/WsUtils. Method 'void writeProtobuf(com.google.protobuf.Message, org.sonar.api.server.ws.Request, org.sonar.api.server.ws.Response)' at index 432 is CONSTANT_MethodRef and should be CONSTANT_InterfaceMethodRef
        at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:224)
        at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:117)
        at org.springframework.beans.factory.support.ConstructorResolver.lambda$instantiate$0(ConstructorResolver.java:307)
        at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
        at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:306)
        ... 55 common frames omitted
Caused by: java.lang.IncompatibleClassChangeError: Inconsistent constant pool data in classfile for class org/sonar/server/ws/WsUtils. Method 'void writeProtobuf(com.google.protobuf.Message, org.sonar.api.server.ws.Request, org.sonar.api.server.ws.Response)' at index 432 is CONSTANT_MethodRef and should be CONSTANT_InterfaceMethodRef
        at com.github.mc1arke.sonarqube.plugin.server.pullrequest.ws.pullrequest.action.ListAction.<init>(ListAction.java:63)
        at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77)
        at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
        at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480)
        at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:211)
        ... 59 common frames omitted
2023.06.21 11:55:45 INFO  web[][o.s.p.ProcessEntryPoint] Hard stopping process
2023.06.21 11:55:46 INFO  web[][c.z.h.HikariDataSource] HikariPool-1 - Shutdown initiated...
2023.06.21 11:55:46 INFO  web[][c.z.h.HikariDataSource] HikariPool-1 - Shutdown completed.
2023.06.21 11:55:46 WARN  web[][o.a.c.l.WebappClassLoaderBase] The web application [ROOT] appears to have started a thread named [Thread-1] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:\n [email protected]/sun.nio.ch.SocketDispatcher.read0(Native Method)\n [email protected]/sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:47)\n [email protected]/sun.nio.ch.NioSocketImpl.tryRead(NioSocketImpl.java:261)\n [email protected]/sun.nio.ch.NioSocketImpl.implRead(NioSocketImpl.java:312)\n [email protected]/sun.nio.ch.NioSocketImpl.read(NioSocketImpl.java:350)\n [email protected]/sun.nio.ch.NioSocketImpl$1.read(NioSocketImpl.java:803)\n [email protected]/java.net.Socket$SocketInputStream.read(Socket.java:966)\n [email protected]/sun.security.ssl.SSLSocketInputRecord.read(SSLSocketInputRecord.java:484)\n [email protected]/sun.security.ssl.SSLSocketInputRecord.readHeader(SSLSocketInputRecord.java:478)\n [email protected]/sun.security.ssl.SSLSocketInputRecord.bytesInCompletePacket(SSLSocketInputRecord.java:70)\n [email protected]/sun.security.ssl.SSLSocketImpl.readApplicationRecord(SSLSocketImpl.java:1465)\n [email protected]/sun.security.ssl.SSLSocketImpl$AppInputStream.read(SSLSocketImpl.java:1069)\n [email protected]/java.io.BufferedInputStream.fill(BufferedInputStream.java:244)\n [email protected]/java.io.BufferedInputStream.read1(BufferedInputStream.java:284)\n [email protected]/java.io.BufferedInputStream.read(BufferedInputStream.java:343)\n [email protected]/com.sun.jndi.ldap.Connection.run(Connection.java:856)\n [email protected]/java.lang.Thread.run(Thread.java:833)
@rnoberger rnoberger added the bug Something isn't working label Jun 21, 2023
@tkardaridis
Copy link

I have the same problem on a windows server running sonarqube as a service. The service is starting and after a while stops with the following error on the web.log file of sonarqube. If I comment out the two properties sonar.web.javaAdditionalOpts and sonar.ce.javaAdditionalOpts in the configuration file then the application starts correctly.

2023.06.28 21:04:39 WARN web[][o.s.c.a.AnnotationConfigApplicationContext] Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'jdk.internal.loader.ClassLoaders$[email protected]': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'jdk.internal.loader.ClassLoaders$AppClassLoader@6f94fa3e-com.github.mc1arke.sonarqube.plugin.server.pullrequest.ws.pullrequest.PullRequestWs': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jdk.internal.loader.ClassLoaders$AppClassLoader@6f94fa3e-com.github.mc1arke.sonarqube.plugin.server.pullrequest.ws.pullrequest.action.ListAction': Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.github.mc1arke.sonarqube.plugin.server.pullrequest.ws.pullrequest.action.ListAction]: Constructor threw exception; nested exception is java.lang.IncompatibleClassChangeError: Inconsistent constant pool data in classfile for class org/sonar/server/ws/WsUtils. Method 'void writeProtobuf(com.google.protobuf.Message, org.sonar.api.server.ws.Request, org.sonar.api.server.ws.Response)' at index 432 is CONSTANT_MethodRef and should be CONSTANT_InterfaceMethodRef
2023.06.28 21:04:39 ERROR web[][o.s.s.p.Platform] Background initialization failed. Stopping SonarQube
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'jdk.internal.loader.ClassLoaders$[email protected]': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'jdk.internal.loader.ClassLoaders$AppClassLoader@6f94fa3e-com.github.mc1arke.sonarqube.plugin.server.pullrequest.ws.pullrequest.PullRequestWs': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jdk.internal.loader.ClassLoaders$AppClassLoader@6f94fa3e-com.github.mc1arke.sonarqube.plugin.server.pullrequest.ws.pullrequest.action.ListAction': Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.github.mc1arke.sonarqube.plugin.server.pullrequest.ws.pullrequest.action.ListAction]: Constructor threw exception; nested exception is java.lang.IncompatibleClassChangeError: Inconsistent constant pool data in classfile for class org/sonar/server/ws/WsUtils. Method 'void writeProtobuf(com.google.protobuf.Message, org.sonar.api.server.ws.Request, org.sonar.api.server.ws.Response)' at index 432 is CONSTANT_MethodRef and should be CONSTANT_InterfaceMethodRef
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:800)
at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:229)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1372)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1222)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:955)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:920)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583)
at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:187)
at org.sonar.server.platform.platformlevel.PlatformLevel.start(PlatformLevel.java:80)
at org.sonar.server.platform.platformlevel.PlatformLevel4.start(PlatformLevel4.java:662)
at org.sonar.server.platform.PlatformImpl.start(PlatformImpl.java:214)
at org.sonar.server.platform.PlatformImpl.startLevel34Containers(PlatformImpl.java:194)
at org.sonar.server.platform.PlatformImpl$AutoStarterRunnable.runIfNotAborted(PlatformImpl.java:362)
at org.sonar.server.platform.PlatformImpl$1.doRun(PlatformImpl.java:113)
at org.sonar.server.platform.PlatformImpl$AutoStarterRunnable.run(PlatformImpl.java:346)
at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'jdk.internal.loader.ClassLoaders$AppClassLoader@6f94fa3e-com.github.mc1arke.sonarqube.plugin.server.pullrequest.ws.pullrequest.PullRequestWs': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jdk.internal.loader.ClassLoaders$AppClassLoader@6f94fa3e-com.github.mc1arke.sonarqube.plugin.server.pullrequest.ws.pullrequest.action.ListAction': Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.github.mc1arke.sonarqube.plugin.server.pullrequest.ws.pullrequest.action.ListAction]: Constructor threw exception; nested exception is java.lang.IncompatibleClassChangeError: Inconsistent constant pool data in classfile for class org/sonar/server/ws/WsUtils. Method 'void writeProtobuf(com.google.protobuf.Message, org.sonar.api.server.ws.Request, org.sonar.api.server.ws.Response)' at index 432 is CONSTANT_MethodRef and should be CONSTANT_InterfaceMethodRef
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:800)
at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:229)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1372)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1222)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208)
at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.addCandidateEntry(DefaultListableBeanFactory.java:1609)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:1573)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveMultipleBeans(DefaultListableBeanFactory.java:1439)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1349)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1311)
at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:887)
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:791)
... 21 common frames omitted
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jdk.internal.loader.ClassLoaders$AppClassLoader@6f94fa3e-com.github.mc1arke.sonarqube.plugin.server.pullrequest.ws.pullrequest.action.ListAction': Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.github.mc1arke.sonarqube.plugin.server.pullrequest.ws.pullrequest.action.ListAction]: Constructor threw exception; nested exception is java.lang.IncompatibleClassChangeError: Inconsistent constant pool data in classfile for class org/sonar/server/ws/WsUtils. Method 'void writeProtobuf(com.google.protobuf.Message, org.sonar.api.server.ws.Request, org.sonar.api.server.ws.Response)' at index 432 is CONSTANT_MethodRef and should be CONSTANT_InterfaceMethodRef
at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:315)
at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:296)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1372)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1222)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208)
at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.addCandidateEntry(DefaultListableBeanFactory.java:1609)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:1573)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveMultipleBeans(DefaultListableBeanFactory.java:1439)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1349)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1311)
at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:887)
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:791)
... 38 common frames omitted
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.github.mc1arke.sonarqube.plugin.server.pullrequest.ws.pullrequest.action.ListAction]: Constructor threw exception; nested exception is java.lang.IncompatibleClassChangeError: Inconsistent constant pool data in classfile for class org/sonar/server/ws/WsUtils. Method 'void writeProtobuf(com.google.protobuf.Message, org.sonar.api.server.ws.Request, org.sonar.api.server.ws.Response)' at index 432 is CONSTANT_MethodRef and should be CONSTANT_InterfaceMethodRef
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:224)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:117)
at org.springframework.beans.factory.support.ConstructorResolver.lambda$instantiate$0(ConstructorResolver.java:307)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:306)
... 55 common frames omitted
Caused by: java.lang.IncompatibleClassChangeError: Inconsistent constant pool data in classfile for class org/sonar/server/ws/WsUtils. Method 'void writeProtobuf(com.google.protobuf.Message, org.sonar.api.server.ws.Request, org.sonar.api.server.ws.Response)' at index 432 is CONSTANT_MethodRef and should be CONSTANT_InterfaceMethodRef
at com.github.mc1arke.sonarqube.plugin.server.pullrequest.ws.pullrequest.action.ListAction.(ListAction.java:63)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480)
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:211)
... 59 common frames omitted
2023.06.28 21:04:39 INFO web[][o.s.p.ProcessEntryPoint] Hard stopping process
2023.06.28 21:04:39 INFO web[][c.z.h.HikariDataSource] HikariPool-1 - Shutdown initiated...
2023.06.28 21:04:39 INFO web[][c.z.h.HikariDataSource] HikariPool-1 - Shutdown completed.

@stifm
Copy link

stifm commented Jun 29, 2023

I can confirm this.
Had the error with the incompatible 1.14 version of the plugin and hoped to fix it with the 1.15 SNAPSHOT from the PR, but it seems to yield the same result.

@gjabouley-invn
Copy link

Hello

could it be possible that SonarQube version should be updated in file build.gradle to match proper version 10.1.0.73491 ?

Sorry i don't have a 10.1 instance at hand to test, maybe you could build locally and see if it works

bluebu added a commit to bluebu/sonarqube-community-branch-plugin that referenced this issue Jul 21, 2023
    based on the branch: feature/sonarqube-10_0-support

    1. upgrade sonarqubeVersion to '10.0.0.68432'
    2. fixed dbClient.componentDao().insert(DbSession session, ComponentDto item, boolean isMainBranch)
    3. fixed UT code
@bluebu
Copy link
Contributor

bluebu commented Jul 21, 2023

Hello

could it be possible that SonarQube version should be updated in file build.gradle to match proper version 10.1.0.73491 ?

Sorry i don't have a 10.1 instance at hand to test, maybe you could build locally and see if it works

I have make a pull request for that:
#786

Tested in the 10.1.0 SonarQube instance

bluebu added a commit to bluebu/sonarqube-community-branch-plugin that referenced this issue Jul 21, 2023
    based on the branch: feature/sonarqube-10_0-support

    1. upgrade sonarqubeVersion to '10.0.0.68432'
    2. fixed dbClient.componentDao().insert(DbSession session, ComponentDto item, boolean isMainBranch)
    3. fixed UT code
bluebu added a commit to bluebu/sonarqube-community-branch-plugin that referenced this issue Jul 21, 2023
    based on the branch: feature/sonarqube-10_0-support

    1. upgrade sonarqubeVersion to '10.0.0.68432'
    2. fixed dbClient.componentDao().insert(DbSession session, ComponentDto item, boolean isMainBranch)
    3. fixed UT code
bluebu added a commit to bluebu/sonarqube-community-branch-plugin that referenced this issue Jul 21, 2023
    based on the branch: feature/sonarqube-10_0-support

    1. upgrade sonarqubeVersion to '10.0.0.68432'
    2. fixed dbClient.componentDao().insert(DbSession session, ComponentDto item, boolean isMainBranch)
    3. fixed UT code
bluebu added a commit to bluebu/sonarqube-community-branch-plugin that referenced this issue Jul 21, 2023
    based on the branch: feature/sonarqube-10_0-support

    1. upgrade sonarqubeVersion to '10.0.0.68432'
    2. fixed dbClient.componentDao().insert(DbSession session, ComponentDto item, boolean isMainBranch)
    3. fixed UT code
@BsctZz
Copy link

BsctZz commented Jul 27, 2023

I had exactly the same problem using helm chart (V8), with a sonar 10 instance and sonarqube-community-branch-plugin-1.14.0.

I was using the jvmOpts and jvmCeOpts properties, which according to the helm doc (https://github.com/SonarSource/helm-chart-sonarqube/blob/master/charts/sonarqube/values.yaml) were obsolete.

So instead of

jvmOpts: "-javaagent:/opt/sonarqube/extensions/plugins/sonarqube-community-branch-plugin-1.14.0.jar=web"
jvmCeOpts: "-javaagent:/opt/sonarqube/extensions/plugins/sonarqube-community-branch-plugin-1.14.0.jar=ce"

I used

sonar.web.javaOpts: "-javaagent:/opt/sonarqube/extensions/plugins/sonarqube-community-branch-plugin-1.14.0.jar=web"
sonar.ce.javaOpts: "-javaagent:/opt/sonarqube/extensions/plugins/sonarqube-community-branch-plugin-1.14.0.jar=ce"

and it works

@rnoberger
Copy link
Author

@bluebu Thank you for the fix, I tested it and it worked well.

@voronsp
Copy link

voronsp commented Aug 11, 2023

It does not work for me :(
I tried with versions of plugin 1.13.0 and 1.14.0 and sonarqube version 10.1.0 in docker-compose.
I am setting envs like:

SONAR_WEB_JAVAOPTS: "-javaagent:/opt/sonarqube/extensions/sonarqube-community-branch-plugin-1.14.0.jar=web" SONAR_CE_JAVAOPTS: "-javaagent:/opt/sonarqube/extensions/sonarqube-community-branch-plugin-1.14.0.jar=ce"
And error still shows.

@Adjunior
Copy link

Adjunior commented Aug 11, 2023

@bluebu Thanks you for the fix.
@voronsp build fix in https://github.com/bluebu/sonarqube-community-branch-plugin/tree/feature/sonarqube-10_1-support with .\gradlew clean build and copy ./build/libs/sonarqube-community-branch-plugin-1.15.0-SNAPSHOT.jar
In the docker-componse add:
SONAR_WEB_JAVAOPTS: "-javaagent:/opt/sonarqube/extensions/sonarqube-community-branch-plugin-1.15.0-SNAPSHOT.jar=web"
SONAR_CE_JAVAOPTS: "-javaagent:/opt/sonarqube/extensions/sonarqube-community-branch-plugin-1.15.0-SNAPSHOT.jar=ce"

It's working for me!

@bjo004
Copy link

bjo004 commented Aug 11, 2023

@Adjunior Is it possible to have this jar file publicly available from git please?

@bjo004
Copy link

bjo004 commented Aug 12, 2023

@Adjunior, one can fetch the artifact here. https://github.com/bluebu/sonarqube-community-branch-plugin/actions/runs/5621946627

Download the snapshot.zip

@praseeb
Copy link

praseeb commented Aug 22, 2023

@bluebu @voronsp @Adjunior we are using SonarQube Docker image "sonarqube:9.9-community" in our ECS cluster, based on the above solutions, how we can use this solution for docker images, could someone help us to understand.

mc1arke pushed a commit that referenced this issue Sep 16, 2023
Updates to the Sonarqube APIs for version 10.1
mc1arke pushed a commit that referenced this issue Dec 29, 2023
Updates to the Sonarqube APIs for version 10.1
mc1arke added a commit that referenced this issue Dec 29, 2023
Sonarqube 10.1 includes classes compiled with a Java 17 target, so the
plugin fails to compile in the container build that uses Java 11. The
build container is therefore being bumped to Java 17, and the
environment file configured to pin to Sonarqube 10.1 to allow repeated
builds.
mc1arke added a commit that referenced this issue Dec 29, 2023
Sonarqube 10.1 includes classes compiled with a Java 17 target, so the
plugin fails to compile in the container build that uses Java 11. The
build container is therefore being bumped to Java 17, and the
environment file configured to pin to Sonarqube 10.1 to allow repeated
builds.
@mc1arke
Copy link
Owner

mc1arke commented Dec 29, 2023

Sonarqube 10.1 support released in 1.16.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.