Error creating bean with name 'jdk.internal.loader.ClassLoaders$AppClassLoader@5ffd2b27-org.sonar.se

Hello community

I’m trying to run sonarqube server with postgresql with the following command

/Applications/Sonarqube/bin/macosx-universal-64/sonar.sh console

I’m getting this error every time I’m running it

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jdk.internal.loader.ClassLoaders$AppClassLoader@5ffd2b27-org.sonar.server.rule.RegisterRules': Initialization of bean failed; nested exception is java.lang.NoSuchMethodError: 'org.sonar.api.server.rule.RulesDefinition$NewRule org.sonar.api.server.rule.RulesDefinition$NewRule.setDebtSubCharacteristic(java.lang.String)'
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:628)
	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:918)
	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.PlatformLevelStartup.access$001(PlatformLevelStartup.java:55)
	at org.sonar.server.platform.platformlevel.PlatformLevelStartup$1.doPrivileged(PlatformLevelStartup.java:127)
	at org.sonar.server.user.DoPrivileged.execute(DoPrivileged.java:45)
	at org.sonar.server.platform.platformlevel.PlatformLevelStartup.start(PlatformLevelStartup.java:124)
	at org.sonar.server.platform.PlatformImpl.executeStartupTasks(PlatformImpl.java:183)
	at org.sonar.server.platform.PlatformImpl$AutoStarterRunnable.runIfNotAborted(PlatformImpl.java:344)
	at org.sonar.server.platform.PlatformImpl$1.doRun(PlatformImpl.java:107)
	at org.sonar.server.platform.PlatformImpl$AutoStarterRunnable.run(PlatformImpl.java:328)
	at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: java.lang.NoSuchMethodError: 'org.sonar.api.server.rule.RulesDefinition$NewRule org.sonar.api.server.rule.RulesDefinition$NewRule.setDebtSubCharacteristic(java.lang.String)'
	at org.sonar.squidbridge.rules.SqaleXmlLoader.processRule(SqaleXmlLoader.java:124)
	at org.sonar.squidbridge.rules.SqaleXmlLoader.processSubChar(SqaleXmlLoader.java:92)
	at org.sonar.squidbridge.rules.SqaleXmlLoader.processRoot(SqaleXmlLoader.java:78)
	at org.sonar.squidbridge.rules.SqaleXmlLoader.loadXmlResource(SqaleXmlLoader.java:65)
	at org.sonar.squidbridge.rules.SqaleXmlLoader.load(SqaleXmlLoader.java:52)
	at com.backelite.sonarqube.swift.issues.swiftlint.SwiftLintRulesDefinition.define(SwiftLintRulesDefinition.java:61)
	at org.sonar.server.rule.RuleDefinitionsLoader.load(RuleDefinitionsLoader.java:56)
	at org.sonar.server.rule.RegisterRules.start(RegisterRules.java:125)
	at org.sonar.core.platform.StartableBeanPostProcessor.postProcessBeforeInitialization(StartableBeanPostProcessor.java:33)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:440)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1796)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:620)
	... 19 common frames omitted

I’ve tried a lot of things to fix it but it didn’t work
Could you advice with this ?

You have to remove the swift plugin, it is now built in and part of developer/Enterprise edition: On my setup I had to delete this file and then restart: /opt/sonarqube/extensions/plugins/backelite-sonar-swift-plugin-0.4.6.jar

1 Like

Thank you so so much
It’s working perfectly now :smile:

How can you tell which plugin is causing the error?

I have a similar 'Error creating bean with name 'jdk.internal.loader.ClassLoaders$AppClassLoader@… ’ message during my upgrade attempt, and I have the approved versions of my plugins as per the plugin matrix, but still I get this error when attempting to start Sonarqube.
Thanks,

Hi ,
I am having the same issue and similar to what the logs above shown I removed swift plugin and deploying again but same result. anything else that I can look at ?
Thank you

I am having the same issue, did you ever find a solution? Thanks!