Some Plugins Crashing New version of SonarQube

Good afternoon.

I updated SonarQube to the latest version earlier today. And when trying to enable the plugins per the picture it keeps crashing the SonarQube service.

See error lo below:

> java.lang.IllegalStateException: Fail to instantiate class [org.sonar.plugins.roslynsdk.RoslynSdkGeneratedPlugin] of plugin [codecrackercsharp]
> 	at org.sonar.core.platform.PluginLoader.instantiatePluginClasses(PluginLoader.java:134)
> 	at org.sonar.core.platform.PluginLoader.load(PluginLoader.java:66)
> 	at org.sonar.server.plugins.ServerPluginRepository.loadInstances(ServerPluginRepository.java:267)
> 	at org.sonar.server.plugins.ServerPluginRepository.start(ServerPluginRepository.java:107)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> 	at java.lang.reflect.Method.invoke(Unknown Source)
> 	at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.invokeMethod(ReflectionLifecycleStrategy.java:110)
> 	at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.start(ReflectionLifecycleStrategy.java:89)
> 	at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.start(AbstractInjectionFactory.java:84)
> 	at org.picocontainer.behaviors.AbstractBehavior.start(AbstractBehavior.java:169)
> 	at org.picocontainer.behaviors.Stored$RealComponentLifecycle.start(Stored.java:132)
> 	at org.picocontainer.behaviors.Stored.start(Stored.java:110)
> 	at org.picocontainer.DefaultPicoContainer.potentiallyStartAdapter(DefaultPicoContainer.java:1016)
> 	at org.picocontainer.DefaultPicoContainer.startAdapters(DefaultPicoContainer.java:1009)
> 	at org.picocontainer.DefaultPicoContainer.start(DefaultPicoContainer.java:767)
> 	at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:135)
> 	at org.sonar.server.platform.platformlevel.PlatformLevel.start(PlatformLevel.java:90)
> 	at org.sonar.server.platform.platformlevel.PlatformLevel2.start(PlatformLevel2.java:110)
> 	at org.sonar.server.platform.Platform.start(Platform.java:211)
> 	at org.sonar.server.platform.Platform.startLevel2Container(Platform.java:177)
> 	at org.sonar.server.platform.Platform.init(Platform.java:87)
> 	at org.sonar.server.platform.web.PlatformServletContextListener.contextInitialized(PlatformServletContextListener.java:45)
> 	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4745)
> 	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5207)
> 	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
> 	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1419)
> 	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1409)
> 	at java.util.concurrent.FutureTask.run(Unknown Source)
> 	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
> 	at java.lang.Thread.run(Unknown Source)
> Caused by: java.lang.NoClassDefFoundError: org/sonar/api/ServerExtension
> 	at java.lang.ClassLoader.defineClass1(Native Method)
> 	at java.lang.ClassLoader.defineClass(Unknown Source)
> 	at java.security.SecureClassLoader.defineClass(Unknown Source)
> 	at java.net.URLClassLoader.defineClass(Unknown Source)
> 	at java.net.URLClassLoader.access$100(Unknown Source)
> 	at java.net.URLClassLoader$1.run(Unknown Source)
> 	at java.net.URLClassLoader$1.run(Unknown Source)
> 	at java.security.AccessController.doPrivileged(Native Method)
> 	at java.net.URLClassLoader.findClass(Unknown Source)
> 	at org.sonar.classloader.ClassRealm.loadClassFromSelf(ClassRealm.java:125)
> 	at org.sonar.classloader.ParentFirstStrategy.loadClass(ParentFirstStrategy.java:37)
> 	at org.sonar.classloader.ClassRealm.loadClass(ClassRealm.java:87)
> 	at org.sonar.classloader.ClassRealm.loadClass(ClassRealm.java:76)
> 	at org.sonar.plugins.roslynsdk.RoslynSdkGeneratedPlugin.<clinit>(RoslynSdkGeneratedPlugin.java:28)
> 	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
> 	at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
> 	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
> 	at java.lang.reflect.Constructor.newInstance(Unknown Source)
> 	at java.lang.Class.newInstance(Unknown Source)
> 	at org.sonar.core.platform.PluginLoader.instantiatePluginClasses(PluginLoader.java:129)
> 	... 32 common frames omitted
> Caused by: java.lang.ClassNotFoundException: org.sonar.api.ServerExtension
> 	at org.sonar.classloader.ParentFirstStrategy.loadClass(ParentFirstStrategy.java:39)
> 	at org.sonar.classloader.ClassRealm.loadClass(ClassRealm.java:87)
> 	at org.sonar.classloader.ClassRealm.loadClass(ClassRealm.java:76)
> 	... 52 common frames omitted
> 2018.08.14 17:19:12 ERROR web[][o.s.a.u.i.DefaultTempFolder] Failed to delete temp folder
> java.nio.file.FileSystemException: C:\sonarqube\temp\tmp\sonar-plugin-api-deps4676284192442394924jar: The process cannot access the file because it is being used by another process.
> 
> 	at sun.nio.fs.WindowsException.translateToIOException(Unknown Source)
> 	at sun.nio.fs.WindowsException.rethrowAsIOException(Unknown Source)
> 	at sun.nio.fs.WindowsException.rethrowAsIOException(Unknown Source)
> 	at sun.nio.fs.WindowsFileSystemProvider.implDelete(Unknown Source)
> 	at sun.nio.fs.AbstractFileSystemProvider.deleteIfExists(Unknown Source)
> 	at java.nio.file.Files.deleteIfExists(Unknown Source)
> 	at org.sonar.api.utils.internal.DefaultTempFolder$DeleteRecursivelyFileVisitor.visitFile(DefaultTempFolder.java:115)
> 	at org.sonar.api.utils.internal.DefaultTempFolder$DeleteRecursivelyFileVisitor.visitFile(DefaultTempFolder.java:110)
> 	at java.nio.file.Files.walkFileTree(Unknown Source)
> 	at java.nio.file.Files.walkFileTree(Unknown Source)
> 	at org.sonar.api.utils.internal.DefaultTempFolder.clean(DefaultTempFolder.java:97)
> 	at org.sonar.api.utils.internal.TempFolderCleaner.stop(TempFolderCleaner.java:47)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> 	at java.lang.reflect.Method.invoke(Unknown Source)
> 	at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.invokeMethod(ReflectionLifecycleStrategy.java:110)
> 	at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.stop(ReflectionLifecycleStrategy.java:96)
> 	at org.sonar.core.platform.StopSafeReflectionLifecycleStrategy.stop(StopSafeReflectionLifecycleStrategy.java:44)
> 	at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.stop(AbstractInjectionFactory.java:88)
> 	at org.picocontainer.behaviors.AbstractBehavior.stop(AbstractBehavior.java:179)
> 	at org.picocontainer.behaviors.Stored$RealComponentLifecycle.stop(Stored.java:141)
> 	at org.picocontainer.behaviors.Stored.stop(Stored.java:118)
> 	at org.picocontainer.DefaultPicoContainer.stopAdapters(DefaultPicoContainer.java:1048)
> 	at org.picocontainer.DefaultPicoContainer.stop(DefaultPicoContainer.java:803)
> 	at org.sonar.core.platform.ComponentContainer.stopComponents(ComponentContainer.java:165)
> 	at org.sonar.server.platform.platformlevel.PlatformLevel.stop(PlatformLevel.java:99)
> 	at org.sonar.server.platform.Platform.stopLevel1Container(Platform.java:222)
> 	at org.sonar.server.platform.Platform.doStop(Platform.java:266)
> 	at org.sonar.server.platform.web.PlatformServletContextListener.stopQuietly(PlatformServletContextListener.java:60)
> 	at org.sonar.server.platform.web.PlatformServletContextListener.contextInitialized(PlatformServletContextListener.java:53)
> 	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4745)
> 	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5207)
> 	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
> 	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1419)
> 	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1409)
> 	at java.util.concurrent.FutureTask.run(Unknown Source)
> 	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
> 	at java.lang.Thread.run(Unknown Source)

Hi,

Wow! It’s gratifying to see how quickly you tried (to try) the new version.

We found the same thing ourselves this morning and have already corrected the Plugin Version Matrix and accompanying Marketplace files to mark the latest versions of :

  • FindBugs
  • CheckStyle
  • CodeCracker
  • Guava Helper

incompatible with 7.3.

In case you’d like to know, I installed and successfully started up with every single other plugin install and upgrade available to the community edition through the Marketplace. So if you drop CodeCracker, you should be good.

Sorry for the trouble.

Ann

Hi Ann,

Thanks for this.

Really appreciate your prompt response.

Kind Regards

Hi Joaquim,

FYI the CodeCracker plugin was created using v1 of the SonarQube Roslyn SDK against the CodeCracker NuGet package. The plugins generated by v1 of the SDK are not compatible with SQv7.x.

However, we’ve just released v2 of the SonarQube Roslyn SDK which generates plugins that are compatible with SonarQube 6.7.x onwards. If you want to continue using CodeCracker, you can easily generate a new plugin. The instructions are in the readme of the SDK repo.

Kind regards,
Duncan

1 Like

The plugin I was looking at seems to be the java version, but the code I was looking at seems to be .net.

I’m i missing something?

Kind Regards

I’m not sure what you mean by “the code I was looking at” - are you talking about the code you are trying to analyze, the code of the SonarQube Roslyn SDK, or the code for the Code Cracker analyzers?

SonarQube plugins are written in Java. Roslyn analyzers are written in .NET.

The SonarQube Roslyn SDK is a toolkit that generates a Java SonarQube plugin that wraps a .NET Roslyn analyzer so it can be installed in SonarQube.

The SonarQube Roslyn SDK is written in .NET and it needs to be run on a Windows machine with the .NET Framework v4.6 or later installed. However, you only need to run the SDK once, to produce the Java plugin. You don’t need to build the SDK itself - you can just down and run the binaries in the latest release.

Kind regards,
Duncan

Note @jjferreira that the CodeCracker community seems to be maintaining that plugin, so it’s possible that they issue a fixed version at some point (see this topic).