I am trying to upgrade SonarQube
from version 4.4
to version 5.1
and I keep running into problems on Windows
64-bit.
4.4 is currently running on 9000 and I'm pretty sure I've changed the wrapper
and sonar
conf files correctly.
Can someone tell me the correct steps to upgrade this correctly or point me in the right direction?
I am getting this error in the logs about upgrading the database:
Impossible to upgrade database
Migration failed: com/thoughtworks/xstream/XStream . Please check logs.
Migration failed: com/thoughtworks/xstream/XStream .
2015.06.15 15:46:09 ERROR web[o.s.s.ui.JRubyFacade] Fail to upgrade database
com/thoughtworks/xstream/XStream
org.sonar.plugins.findbugs.xml.FindBugsFilter.createXStream(FindBugsFilter.java:157)
org.sonar.plugins.findbugs.FindbugsProfileImporter.importProfile(FindbugsProfileImporter.java:54)
org.sonar.plugins.findbugs.SonarWayWithFindbugsProfile.createProfile(SonarWayWithFindbugsProfile.java:43)
org.sonar.server.qualityprofile.RegisterQualityProfiles.profilesByLanguage(RegisterQualityProfiles.java:182)
org.sonar.server.qualityprofile.RegisterQualityProfiles.start(RegisterQualityProfiles.java:91)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:606)
org.picocontainer.lifecycle.ReflectionLifecycleStrategy.invokeMethod(ReflectionLifecycleStrategy.java:110)
org.picocontainer.lifecycle.ReflectionLifecycleStrategy.start(ReflectionLifecycleStrategy.java:89)
org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.start(AbstractInjectionFactory.java:84)
org.picocontainer.behaviors.AbstractBehavior.start(AbstractBehavior.java:169)
org.picocontainer.behaviors.Stored$RealComponentLifecycle.start(Stored.java:132)
org.picocontainer.behaviors.Stored.start(Stored.java:110)
org.picocontainer.DefaultPicoContainer.potentiallyStartAdapter(DefaultPicoContainer.java:1015)
org.picocontainer.DefaultPicoContainer.startAdapters(DefaultPicoContainer.java:1008)
org.picocontainer.DefaultPicoContainer.start(DefaultPicoContainer.java:766)
org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:91)
org.sonar.server.platform.ServerComponents$1.doPrivileged(ServerComponents.java:851)
org.sonar.server.user.DoPrivileged.execute(DoPrivileged.java:43)
org.sonar.server.platform.ServerComponents.executeStartupTasks(ServerComponents.java:847)
org.sonar.server.platform.Platform.executeStartupTasks(Platform.java:126)
org.sonar.server.platform.Platform.startLevel34Containers(Platform.java:122)
org.sonar.server.platform.Platform.doStart(Platform.java:81)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:606)
org.jruby.javasupport.JavaMethod.invokeDirectWithExceptionHandling(JavaMethod.java:440)
org.jruby.javasupport.JavaMethod.invokeDirect(JavaMethod.java:304)
org.jruby.java.invokers.InstanceMethodInvoker.call(InstanceMethodInvoker.java:52)
org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:306)
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:136)
org.jruby.ast.CallNoArgNode.interpret(CallNoArgNode.java:60)
org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
org.jruby.evaluator.ASTInterpreter.INTERPRET_METHOD(ASTInterpreter.java:74)
org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:139)
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:182)
org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:306)
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:136)
org.jruby.ast.CallNoArgNode.interpret(CallNoArgNode.java:60)
org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
org.jruby.ast.RescueNode.executeBody(RescueNode.java:221)
org.jruby.ast.RescueNode.interpret(RescueNode.java:116)
org.jruby.ast.BeginNode.interpret(BeginNode.java:83)
org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
org.jruby.evaluator.ASTInterpreter.INTERPRET_BLOCK(ASTInterpreter.java:112)
org.jruby.runtime.InterpretedBlock.evalBlockBody(InterpretedBlock.java:384)
org.jruby.runtime.InterpretedBlock.yield(InterpretedBlock.java:336)
org.jruby.runtime.BlockBody.call(BlockBody.java:73)
org.jruby.runtime.Block.call(Block.java:101)
org.jruby.RubyProc.call(RubyProc.java:290)
org.jruby.RubyProc.call(RubyProc.java:228)
org.jruby.internal.runtime.RubyRunnable.run(RubyRunnable.java:97)
java.lang.Thread.run(Thread.java:745)
(I'm a coder, not an IT architect. Sorry for the naivety)
The problem is that the
sonar-findbugs-plugin
depends on the xstream jar which up until sonar version < 5.0 was provided transitively by thesonar-plugin-api
. This dependency was removed from thesonar-plugin-api
in version 5.0 as can be seen in SONAR-4118.This however was only carried out after the
sonar-findbugs-plugin
ensured it had explicitly declared its dependency on thexstream
module (so that it now packages it within its own jar). This was handled by SONARFBUGS-9 which is now available in thesonar-findbugs-plugin
as of 2.4.Given this, you will have to upgrade your
sonar-findbugs-plugin
to at least 2.4 and make sure you also upgrade thesonar-java-plugin
to 2.4 as well since findbugs 2.4 seems to require that (else findbugs will throw an exception stating that it needs it).This should solve the error thrown by the findbugs plugin when attempting to instantiate an XStream object