我正在使用onarQube 6.5(6.5.0.27846)并且在成功分析之后,它有时间进行声纳背景任务计算,但我遇到了这个例外:
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:81)
at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:82)
at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:59)
at com.sun.proxy.$Proxy41.select(Unknown Source)
at org.sonar.db.source.FileSourceDao.selectSourceByFileUuid(FileSourceDao.java:44)
at org.sonar.server.computation.task.projectanalysis.filemove.FileMoveDetectionStep.getFile(FileMoveDetectionStep.java:233)
at org.sonar.server.computation.task.projectanalysis.filemove.FileMoveDetectionStep.computeScoreMatrix(FileMoveDetectionStep.java:206)
at org.sonar.server.computation.task.projectanalysis.filemove.FileMoveDetectionStep.execute(FileMoveDetectionStep.java:127)
at org.sonar.server.computation.task.step.ComputationStepExecutor.executeSteps(ComputationStepExecutor.java:64)
at org.sonar.server.computation.task.step.ComputationStepExecutor.execute(ComputationStepExecutor.java:52)
at org.sonar.server.computation.task.projectanalysis.taskprocessor.ReportTaskProcessor.process(ReportTaskProcessor.java:75)
at org.sonar.ce.taskprocessor.CeWorkerImpl.executeTask(CeWorkerImpl.java:92)
at org.sonar.ce.taskprocessor.CeWorkerImpl.call(CeWorkerImpl.java:59)
at org.sonar.ce.taskprocessor.CeWorkerImpl.call(CeWorkerImpl.java:35)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
答案 0 :(得分:1)
陷入同样的问题。它是由无效的'引起的。 FILE_SOURCES中的记录 表:
已修复此查询:
delete
from FILE_SOURCES
where PROJECT_UUID not in
(
select distinct PROJECT_UUID from PROJECTS
where SCOPE = 'PRJ' and QUALIFIER = 'TRK'
);