当前位置: 首页 > 知识库问答 >
问题:

Sonarqube更新后不工作

李弘光
2023-03-14

我把SonarQube升级到了4.2,现在Jenkins不工作了。T.T

Jenkins和SonarQube安装在同一台服务器上,我使用的是mysql。此外,SonarQube的Jenkins设置指向mysql数据库。

... 詹金斯的Maven版本是3.0.5

我没有在java项目中设置声纳maven插件。

它与声纳3.4.1工作正常,我没有改变詹金斯更新SonarQube后的任何设置。

这里是错误跟踪。


    [ERROR] Expected one result (or null) to be returned by selectOne(), but found: 2
    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD FAILURE
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: 16.495s
    [INFO] Finished at: Tue Apr 15 06:10:08 GMT 2014
    [INFO] Final Memory: 20M/89M
    [INFO] ------------------------------------------------------------------------
    [ERROR] Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.2:sonar (default-cli) on project java-utils: Can not execute SonarQube analysis: Expected one result (or null) to be returned by selectOne(), but found: 2 -> [Help 1]
    org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.2:sonar (default-cli) on project java-utils: Can not execute SonarQube analysis
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
    Caused by: org.apache.maven.plugin.MojoExecutionException: Can not execute SonarQube analysis
        at org.codehaus.mojo.sonar.Bootstraper.executeMojo(Bootstraper.java:109)
        at org.codehaus.mojo.sonar.Bootstraper.start(Bootstraper.java:67)
        at org.codehaus.mojo.sonar.SonarMojo.execute(SonarMojo.java:109)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
        ... 19 more
    Caused by: org.apache.maven.plugin.MojoExecutionException: Expected one result (or null) to be returned by selectOne(), but found: 2
        at org.sonar.maven.ExceptionHandling.handle(ExceptionHandling.java:37)
        at org.sonar.maven.SonarMojo.execute(SonarMojo.java:175)
        at org.codehaus.mojo.sonar.Bootstraper.executeMojo(Bootstraper.java:104)
        ... 23 more`enter code here`
    Caused by: org.apache.ibatis.exceptions.TooManyResultsException: Expected one result (or null) to be returned by selectOne(), but found: 2
        at org.apache.ibatis.session.defaults.DefaultSqlSession.selectOne(DefaultSqlSession.java:66)
        at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:63)
        at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:43)
        at com.sun.proxy.$Proxy61.selectByNameAndLanguage(Unknown Source)
        at org.sonar.core.qualityprofile.db.QualityProfileDao.selectByNameAndLanguage(QualityProfileDao.java:181)
        at org.sonar.core.qualityprofile.db.QualityProfileDao.selectByNameAndLanguage(QualityProfileDao.java:188)
        at org.sonar.batch.rule.ModuleQProfiles.loadQProfile(ModuleQProfiles.java:105)
        at org.sonar.batch.rule.ModuleQProfiles.(ModuleQProfiles.java:92)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
        at org.picocontainer.injectors.AbstractInjector.newInstance(AbstractInjector.java:145)
        at org.picocontainer.injectors.ConstructorInjector$1.run(ConstructorInjector.java:342)
        at org.picocontainer.injectors.AbstractInjector$ThreadLocalCyclicDependencyGuard.observe(AbstractInjector.java:270)
        at org.picocontainer.injectors.ConstructorInjector.getComponentInstance(ConstructorInjector.java:364)
        at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.getComponentInstance(AbstractInjectionFactory.java:56)
        at org.picocontainer.behaviors.AbstractBehavior.getComponentInstance(AbstractBehavior.java:64)
        at org.picocontainer.behaviors.Stored.getComponentInstance(Stored.java:91)
        at org.picocontainer.DefaultPicoContainer.getInstance(DefaultPicoContainer.java:698)
        at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:646)
        at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:631)
        at org.picocontainer.parameters.BasicComponentParameter$1.resolveInstance(BasicComponentParameter.java:118)
        at org.picocontainer.parameters.ComponentParameter$1.resolveInstance(ComponentParameter.java:136)
        at org.picocontainer.injectors.SingleMemberInjector.getParameter(SingleMemberInjector.java:78)
        at org.picocontainer.injectors.SingleMemberInjector.getMemberArguments(SingleMemberInjector.java:61)
        at org.picocontainer.injectors.MethodInjector.getMemberArguments(MethodInjector.java:100)
        at org.picocontainer.injectors.MethodInjector$2.run(MethodInjector.java:112)
        at org.picocontainer.injectors.AbstractInjector$ThreadLocalCyclicDependencyGuard.observe(AbstractInjector.java:270)
        at org.picocontainer.injectors.MethodInjector.decorateComponentInstance(MethodInjector.java:120)
        at org.picocontainer.injectors.CompositeInjector.decorateComponentInstance(CompositeInjector.java:58)
        at org.picocontainer.injectors.Reinjector.reinject(Reinjector.java:142)
        at org.picocontainer.injectors.ProviderAdapter.getComponentInstance(ProviderAdapter.java:96)
        at org.picocontainer.DefaultPicoContainer.getInstance(DefaultPicoContainer.java:698)
        at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:646)
        at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:631)
        at org.picocontainer.parameters.BasicComponentParameter$1.resolveInstance(BasicComponentParameter.java:118)
        at org.picocontainer.parameters.ComponentParameter$1.resolveInstance(ComponentParameter.java:136)
        at org.picocontainer.injectors.SingleMemberInjector.getParameter(SingleMemberInjector.java:78)
        at org.picocontainer.injectors.ConstructorInjector$CtorAndAdapters.getParameterArguments(ConstructorInjector.java:309)
        at org.picocontainer.injectors.ConstructorInjector$1.run(ConstructorInjector.java:335)
        at org.picocontainer.injectors.AbstractInjector$ThreadLocalCyclicDependencyGuard.observe(AbstractInjector.java:270)
        at org.picocontainer.injectors.ConstructorInjector.getComponentInstance(ConstructorInjector.java:364)
        at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.getComponentInstance(AbstractInjectionFactory.java:56)
        at org.picocontainer.behaviors.AbstractBehavior.getComponentInstance(AbstractBehavior.java:64)
        at org.picocontainer.behaviors.Stored.getComponentInstance(Stored.java:91)
        at org.picocontainer.DefaultPicoContainer.instantiateComponentAsIsStartable(DefaultPicoContainer.java:1033)
        at org.picocontainer.DefaultPicoContainer.addAdapterIfStartable(DefaultPicoContainer.java:1025)
        at org.picocontainer.DefaultPicoContainer.startAdapters(DefaultPicoContainer.java:1002)
        at org.picocontainer.DefaultPicoContainer.start(DefaultPicoContainer.java:766)
        at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:91)
        at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:77)
        at org.sonar.batch.scan.ProjectScanContainer.scan(ProjectScanContainer.java:199)
        at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:194)
        at org.sonar.batch.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:187)
        at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:92)
        at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:77)
        at org.sonar.batch.scan.ScanTask.scan(ScanTask.java:56)
        at org.sonar.batch.scan.ScanTask.execute(ScanTask.java:44)
        at org.sonar.batch.bootstrap.TaskContainer.doAfterStart(TaskContainer.java:82)
        at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:92)
        at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:77)
        at org.sonar.batch.bootstrap.BootstrapContainer.executeTask(BootstrapContainer.java:144)
        at org.sonar.batch.bootstrap.BootstrapContainer.doAfterStart(BootstrapContainer.java:132)
        at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:92)
        at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:77)
        at org.sonar.batch.bootstrapper.Batch.startBatch(Batch.java:92)
        at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:74)
        at org.sonar.runner.batch.IsolatedLauncher.execute(IsolatedLauncher.java:45)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:87)
        at org.sonar.runner.impl.BatchLauncher$1.run(BatchLauncher.java:75)
        at java.security.AccessController.doPrivileged(Native Method)
        at org.sonar.runner.impl.BatchLauncher.doExecute(BatchLauncher.java:69)
        at org.sonar.runner.impl.BatchLauncher.execute(BatchLauncher.java:50)
        at org.sonar.runner.api.EmbeddedRunner.doExecute(EmbeddedRunner.java:102)
        at org.sonar.runner.api.Runner.execute(Runner.java:90)
        at org.sonar.maven.SonarMojo.execute(SonarMojo.java:173)
        ... 24 more
    [ERROR] 
    [ERROR] Re-run Maven using the -X switch to enable full debug logging.
    [ERROR] 
    [ERROR] For more information about the errors and possible solutions, please read the following articles:
    [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

共有3个答案

柳镜
2023-03-14

我是完全相同的问题。我是两个具有相同确切名称的质量剖面(在将声纳从3.5升级到4.2之后)。我删除了旧的“声纳方式”,并保留了新的“声纳方式”质量剖面,它起作用了。

耿和韵
2023-03-14

也许您没有更新您的SonarQube数据库

http://<sonarqubeserver>/setup

然后按照那里的指示去做。

如果升级导致数据库更改,则此更新有时是必要的。然而,如果你在浏览器中启动SonarQube,它应该发布一条维护消息。

浦德义
2023-03-14

您面临的http://jira.codehaus.org/browse/SONAR-5196在即将到来的版本(4.3)中已经修复。这意味着您有两个相同的质量配置文件(相同的名称,但不同的大小写)用于同一语言。您能删除一个并再次运行分析吗?

 类似资料:
  • 有没有人知道发生了什么,或者我如何进一步调试为什么什么都没有发生? 更新2016-11-15:以下是启动SonarQube服务器时的日志。当我点击安装页面上的“升级”时,这个日志中没有添加任何一行

  • 我在使用nginx1.19版本。并在我的linux服务器上安装了PHP5-FPM。我的nginx php配置如下: 在我将nginx更新到1.6版之后。2和升级linux,我的php文件不工作。php请求返回白色页面,没有错误。 (在我的/var/run文件夹中找不到php-fpm.sock) 如何重新启动PHP?

  • 我已经将android studio更新到android studio V2.3.3(2017年6月),当我在android studio模拟器上启动应用程序时,adb停止显示日志 日志显示: $adb push C:\users\1\androidStudioProjects\don'twakemeApp4\app\build\outputs\apk\app-debug.apk/data/loc

  • 在我将Visual Studio 2017更新到15.3.2版本后,Git现在不工作,所以我无法提交/拉/推等。它给错误。同样得到这个错误: 另一个git进程似乎正在该存储库中运行,例如,由“git提交”打开的编辑器。请确保所有进程都已终止,然后重试。如果仍然失败,那么git进程可能已经在此存储库中崩溃:手动删除该文件以继续。

  • 我刚刚通过Android SDK管理器更新了我的eclipse,我的eclipse弹出并出现了关于Android SDK的错误。 此Android SDK需要Android Developer Toolkit版本23.0.0或更高版本。当前版本为22.6.2.v201403212031-1085508 当我按下“检查更新”按钮时,eclipse的结果是“没有找到更新” 上图左角列出的所有项目都包含