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

Rule.toString() sometimes throws org.hibernate.LazyInitializationException

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.11, 2.12
    • Fix Version/s: 2.13
    • Component/s: Plugin API
    • Labels:
      None

      Description

      org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: org.sonar.api.rules.Rule.params, no session or session was closed
              at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationException(AbstractPersistentCollection.java:380) [hibernate-core-3.3.2.GA.jar:3.3.2.GA]
              at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationExceptionIfNotConnected(AbstractPersistentCollection.java:372) [hibernate-core-3.3.2.GA.jar:3.3.2.GA]
              at org.hibernate.collection.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:365) [hibernate-core-3.3.2.GA.jar:3.3.2.GA]
              at org.hibernate.collection.AbstractPersistentCollection.read(AbstractPersistentCollection.java:108) [hibernate-core-3.3.2.GA.jar:3.3.2.GA]
              at org.hibernate.collection.PersistentBag.toString(PersistentBag.java:506) [hibernate-core-3.3.2.GA.jar:3.3.2.GA]
              at java.lang.String.valueOf(String.java:2826) [na:1.6.0_29]
              at java.lang.StringBuffer.append(StringBuffer.java:219) [na:1.6.0_29]
              at org.apache.commons.lang.builder.ToStringStyle.appendDetail(ToStringStyle.java:597) [commons-lang-2.6.jar:2.6]
              at org.apache.commons.lang.builder.ToStringStyle.appendInternal(ToStringStyle.java:472) [commons-lang-2.6.jar:2.6]
              at org.apache.commons.lang.builder.ToStringStyle.append(ToStringStyle.java:435) [commons-lang-2.6.jar:2.6]
              at org.apache.commons.lang.builder.ToStringBuilder.append(ToStringBuilder.java:851) [commons-lang-2.6.jar:2.6]
              at org.apache.commons.lang.builder.ReflectionToStringBuilder.appendFieldsIn(ReflectionToStringBuilder.java:606) [commons-lang-2.6.jar:2.6]
              at org.apache.commons.lang.builder.ReflectionToStringBuilder.toString(ReflectionToStringBuilder.java:765) [commons-lang-2.6.jar:2.6]
              at org.sonar.api.rules.Rule.toString(Rule.java:399) [sonar-plugin-api-2.13-SNAPSHOT.jar:na]
      

      This is a regression after changes for SONAR-2655 in https://github.com/SonarSource/sonar/commit/804d3141d8dee14082a9a10b75ad191e386c5576#diff-11.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              godin OLD - Evgeny Mandrikov
              Reporter:
              godin OLD - Evgeny Mandrikov
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: