Uploaded image for project: 'SonarQube'
  1. SonarQube
  2. SONAR-3308

Removing a detached instance org.sonar.api.batch.Event

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.13.1
    • Fix Version/s: 3.1
    • Component/s: Activity
    • Labels:
      None
    • Environment:
      MySql

      Description

      use the attachement for reproduce the error.

      steps:
      1. build the project in version 1.0-SNAPSHOT (install sonar:sonar)
      -> OK
      2. release version: change version (pom.xml) to 1.0
      build the project in version 1.0 (install sonar:sonar)
      -> OK
      3. this version will not released
      change version (pom.xml) to 1.0-SNAPSHOT
      build the project in version 1.0-SNAPSHOT (install sonar:sonar)
      -> OK
      4. release version: change version (pom.xml) to 1.0
      build the project in version 1.0 (install sonar:sonar)
      -> ERROR
      5. build the project again in version 1.0 (install sonar:sonar)
      -> OK

      go back to step 3 for retry.

      [ERROR] Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.0:sonar (default-cli) on project logic: Can not execute Sonar: Removing a detached instance org.sonar.api.batch.Event#639 -> [Help 1]
      org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.0:sonar (default-cli) on project logic: Can not execute Sonar
              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:319)
              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:39)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              at java.lang.reflect.Method.invoke(Method.java:597)
              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 Sonar
              at org.codehaus.mojo.sonar.Bootstraper.executeMojo(Bootstraper.java:118)
              at org.codehaus.mojo.sonar.Bootstraper.start(Bootstraper.java:65)
              at org.codehaus.mojo.sonar.SonarMojo.execute(SonarMojo.java:90)
              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: java.lang.IllegalArgumentException: Removing a detached instance org.sonar.api.batch.Event#639
              at org.hibernate.ejb.event.EJB3DeleteEventListener.performDetachedEntityDeletionCheck(EJB3DeleteEventListener.java:45)
              at org.hibernate.event.def.DefaultDeleteEventListener.onDelete(DefaultDeleteEventListener.java:108)
              at org.hibernate.event.def.DefaultDeleteEventListener.onDelete(DefaultDeleteEventListener.java:74)
              at org.hibernate.impl.SessionImpl.fireDelete(SessionImpl.java:794)
              at org.hibernate.impl.SessionImpl.delete(SessionImpl.java:772)
              at org.hibernate.ejb.AbstractEntityManagerImpl.remove(AbstractEntityManagerImpl.java:253)
              at org.sonar.jpa.session.JpaDatabaseSession.removeWithoutFlush(JpaDatabaseSession.java:141)
              at org.sonar.batch.index.EventPersister.deleteEvent(EventPersister.java:48)
              at org.sonar.batch.index.DefaultPersistenceManager.deleteEvent(DefaultPersistenceManager.java:114)
              at org.sonar.batch.index.DefaultIndex.deleteEvent(DefaultIndex.java:387)
              at org.sonar.batch.DefaultSensorContext.deleteEvent(DefaultSensorContext.java:179)
              at org.sonar.plugins.core.sensors.VersionEventsSensor.deleteDeprecatedEvents(VersionEventsSensor.java:56)
              at org.sonar.plugins.core.sensors.VersionEventsSensor.analyse(VersionEventsSensor.java:44)
              at org.sonar.batch.phases.SensorsExecutor.execute(SensorsExecutor.java:64)
              at org.sonar.batch.phases.Phases.execute(Phases.java:93)
              at org.sonar.batch.bootstrap.ProjectModule.doStart(ProjectModule.java:143)
              at org.sonar.batch.bootstrap.Module.start(Module.java:83)
              at org.sonar.batch.bootstrap.BatchModule.analyze(BatchModule.java:111)
              at org.sonar.batch.bootstrap.BatchModule.doStart(BatchModule.java:101)
              at org.sonar.batch.bootstrap.Module.start(Module.java:83)
              at org.sonar.batch.bootstrap.BootstrapModule.doStart(BootstrapModule.java:102)
              at org.sonar.batch.bootstrap.Module.start(Module.java:83)
              at org.sonar.batch.Batch.execute(Batch.java:100)
              at org.sonar.maven3.SonarMojo.executeBatch(SonarMojo.java:146)
              at org.sonar.maven3.SonarMojo.execute(SonarMojo.java:136)
              at org.codehaus.mojo.sonar.Bootstraper.executeMojo(Bootstraper.java:113)
              ... 23 more
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              fabemn OLD - Fabrice Bellingard
              Reporter:
              stachel15 Torsten Stach
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: