{"action":"created","issue":{"url":"https://api.github.com/repos/SonarCommunity/sonar-erlang/issues/3","labels_url":"https://api.github.com/repos/SonarCommunity/sonar-erlang/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/SonarCommunity/sonar-erlang/issues/3/comments","events_url":"https://api.github.com/repos/SonarCommunity/sonar-erlang/issues/3/events","html_url":"https://github.com/SonarCommunity/sonar-erlang/pull/3","id":95785705,"number":3,"title":"Disable the ErlangLibrarySensor plugin","user":{"login":"waisbrot","id":1170218,"avatar_url":"https://avatars.githubusercontent.com/u/1170218?v=3","gravatar_id":"","url":"https://api.github.com/users/waisbrot","html_url":"https://github.com/waisbrot","followers_url":"https://api.github.com/users/waisbrot/followers","following_url":"https://api.github.com/users/waisbrot/following{/other_user}","gists_url":"https://api.github.com/users/waisbrot/gists{/gist_id}","starred_url":"https://api.github.com/users/waisbrot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/waisbrot/subscriptions","organizations_url":"https://api.github.com/users/waisbrot/orgs","repos_url":"https://api.github.com/users/waisbrot/repos","events_url":"https://api.github.com/users/waisbrot/events{/privacy}","received_events_url":"https://api.github.com/users/waisbrot/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-07-18T04:05:22Z","updated_at":"2015-08-07T14:29:06Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/SonarCommunity/sonar-erlang/pulls/3","html_url":"https://github.com/SonarCommunity/sonar-erlang/pull/3","diff_url":"https://github.com/SonarCommunity/sonar-erlang/pull/3.diff","patch_url":"https://github.com/SonarCommunity/sonar-erlang/pull/3.patch"},"body":"I'm using Erlang 17.5, rebar 3.0.0-alpha-6, and SonarQube 5.1. When I run `sonar-runner`, I get an \"Unable to persist\" exception (included in full below).\r\n\r\nI wrote to Tamás, who suggested that the library sensor wasn't particularly informative anyway and that removing it might be a fine idea. Once I attempted this suggestion, the sonar-erlang plugin begin working for me. In case this is useful to others, here's the small patch to comment-out the library sensor (I can rewrite this PR to actually delete the code if nobody uses it).\r\n\r\nException when I leave it in:\r\n```\r\nERROR: Error during Sonar runner execution\r\norg.sonar.runner.impl.RunnerException: Unable to execute Sonar\r\n\tat org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:91)\r\n\tat org.sonar.runner.impl.BatchLauncher$1.run(BatchLauncher.java:75)\r\n\tat java.security.AccessController.doPrivileged(Native Method)\r\n\tat org.sonar.runner.impl.BatchLauncher.doExecute(BatchLauncher.java:69)\r\n\tat org.sonar.runner.impl.BatchLauncher.execute(BatchLauncher.java:50)\r\n\tat org.sonar.runner.api.EmbeddedRunner.doExecute(EmbeddedRunner.java:102)\r\n\tat org.sonar.runner.api.Runner.execute(Runner.java:100)\r\n\tat org.sonar.runner.Main.executeTask(Main.java:70)\r\n\tat org.sonar.runner.Main.execute(Main.java:59)\r\n\tat org.sonar.runner.Main.main(Main.java:53)\r\nCaused by: javax.persistence.PersistenceException: Unable to persist : DependencyDto[id=7,fromSnapshotId=1680,fromResourceId=911,fromScope=PRJ,toSnapshotId=<null>,toResourceId=<null>,toScope=PRJ,weight=1,usage=compile,projectSnapshotId=1680,parentDependencyId=<null>]\r\n\tat org.sonar.jpa.session.JpaDatabaseSession.internalSave(JpaDatabaseSession.java:136)\r\n\tat org.sonar.jpa.session.JpaDatabaseSession.save(JpaDatabaseSession.java:103)\r\n\tat org.sonar.batch.index.DependencyPersister.saveInDB(DependencyPersister.java:82)\r\n\tat org.sonar.batch.index.DependencyPersister.saveDependency(DependencyPersister.java:57)\r\n\tat org.sonar.batch.index.DefaultIndex.addDependency(DefaultIndex.java:288)\r\n\tat org.sonar.batch.deprecated.DeprecatedSensorContext.saveDependency(DeprecatedSensorContext.java:219)\r\n\tat org.sonar.plugins.erlang.libraries.ErlangLibrarySensor.saveDependency(ErlangLibrarySensor.java:110)\r\n\tat org.sonar.plugins.erlang.libraries.ErlangLibrarySensor.analyzeRebarConfigFile(ErlangLibrarySensor.java:84)\r\n\tat org.sonar.plugins.erlang.libraries.ErlangLibrarySensor.analyse(ErlangLibrarySensor.java:53)\r\n\tat org.sonar.batch.phases.SensorsExecutor.executeSensor(SensorsExecutor.java:59)\r\n\tat org.sonar.batch.phases.SensorsExecutor.execute(SensorsExecutor.java:51)\r\n\tat org.sonar.batch.phases.DatabaseModePhaseExecutor.execute(DatabaseModePhaseExecutor.java:120)\r\n\tat org.sonar.batch.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:264)\r\n\tat org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:92)\r\n\tat org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:77)\r\n\tat org.sonar.batch.scan.ProjectScanContainer.scan(ProjectScanContainer.java:235)\r\n\tat org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:230)\r\n\tat org.sonar.batch.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:220)\r\n\tat org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:92)\r\n\tat org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:77)\r\n\tat org.sonar.batch.scan.ScanTask.scan(ScanTask.java:57)\r\n\tat org.sonar.batch.scan.ScanTask.execute(ScanTask.java:45)\r\n\tat org.sonar.batch.bootstrap.TaskContainer.doAfterStart(TaskContainer.java:135)\r\n\tat org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:92)\r\n\tat org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:77)\r\n\tat org.sonar.batch.bootstrap.GlobalContainer.executeTask(GlobalContainer.java:158)\r\n\tat org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:95)\r\n\tat org.sonar.batch.bootstrapper.Batch.execute(Batch.java:67)\r\n\tat org.sonar.runner.batch.IsolatedLauncher.execute(IsolatedLauncher.java:48)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\r\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\r\n\tat java.lang.reflect.Method.invoke(Method.java:483)\r\n\tat org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:87)\r\n\t... 9 more\r\nCaused by: javax.persistence.PersistenceException: org.hibernate.PropertyValueException: not-null property references a null or transient value: org.sonar.api.design.DependencyDto.toResourceId\r\n\tat org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:614)\r\n\tat org.hibernate.ejb.AbstractEntityManagerImpl.persist(AbstractEntityManagerImpl.java:226)\r\n\tat org.sonar.jpa.session.JpaDatabaseSession.internalSave(JpaDatabaseSession.java:130)\r\n\t... 42 more\r\nCaused by: org.hibernate.PropertyValueException: not-null property references a null or transient value: org.sonar.api.design.DependencyDto.toResourceId\r\n\tat org.hibernate.engine.Nullability.checkNullability(Nullability.java:95)\r\n\tat org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:313)\r\n\tat org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:204)\r\n\tat org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:144)\r\n\tat org.hibernate.ejb.event.EJB3PersistEventListener.saveWithGeneratedId(EJB3PersistEventListener.java:49)\r\n\tat org.hibernate.event.def.DefaultPersistEventListener.entityIsTransient(DefaultPersistEventListener.java:154)\r\n\tat org.hibernate.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:110)\r\n\tat org.hibernate.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:61)\r\n\tat org.hibernate.impl.SessionImpl.firePersist(SessionImpl.java:646)\r\n\tat org.hibernate.impl.SessionImpl.persist(SessionImpl.java:620)\r\n\tat org.hibernate.impl.SessionImpl.persist(SessionImpl.java:624)\r\n\tat org.hibernate.ejb.AbstractEntityManagerImpl.persist(AbstractEntityManagerImpl.java:220)\r\n\t... 43 more\r\n```"},"comment":{"url":"https://api.github.com/repos/SonarCommunity/sonar-erlang/issues/comments/128714662","html_url":"https://github.com/SonarCommunity/sonar-erlang/pull/3#issuecomment-128714662","issue_url":"https://api.github.com/repos/SonarCommunity/sonar-erlang/issues/3","id":128714662,"user":{"login":"jlrigau","id":274281,"avatar_url":"https://avatars.githubusercontent.com/u/274281?v=3","gravatar_id":"","url":"https://api.github.com/users/jlrigau","html_url":"https://github.com/jlrigau","followers_url":"https://api.github.com/users/jlrigau/followers","following_url":"https://api.github.com/users/jlrigau/following{/other_user}","gists_url":"https://api.github.com/users/jlrigau/gists{/gist_id}","starred_url":"https://api.github.com/users/jlrigau/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jlrigau/subscriptions","organizations_url":"https://api.github.com/users/jlrigau/orgs","repos_url":"https://api.github.com/users/jlrigau/repos","events_url":"https://api.github.com/users/jlrigau/events{/privacy}","received_events_url":"https://api.github.com/users/jlrigau/received_events","type":"User","site_admin":false},"created_at":"2015-08-07T14:29:06Z","updated_at":"2015-08-07T14:29:06Z","body":"Since Sonar 4.2 version, SensorContext::index(Resource) is deprecated (resource indexing is done by the core) and getResourceFromLibrary(SensorContext context, Library depLib) method from ErlangLibrarySensor fails to index a dependency as a context resource.\r\n\r\nhttp://jira.sonarsource.com/browse/SONAR-5006\r\nhttps://github.com/SonarSource/sonarqube/blob/master/sonar-batch/src/main/java/org/sonar/batch/deprecated/DeprecatedSensorContext.java"}}