Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to register extension com.exxeta.eis.son ar.esql.core.EsqlSourceImporter #7

Closed
PriteshDad opened this issue May 4, 2016 · 9 comments
Assignees

Comments

@PriteshDad
Copy link

Tried with the Scanner 2.6 and sonarqube-5.5 and received following error. Trying to see what could be causing it,

INFO: ------------------------------------------------------------------------
ERROR: Error during SonarQube Scanner execution
java.lang.IllegalStateException: Unable to register extension com.exxeta.eis.son
ar.esql.core.EsqlSourceImporter
at org.sonar.core.platform.ComponentContainer.addExtension(ComponentCont
ainer.java:248)
at org.sonar.batch.bootstrap.ExtensionInstaller.doInstall(ExtensionInsta
ller.java:76)
at org.sonar.batch.bootstrap.ExtensionInstaller.install(ExtensionInstall
er.java:57)
at org.sonar.batch.scan.ModuleScanContainer.addExtensions(ModuleScanCont
ainer.java:176)
at org.sonar.batch.scan.ModuleScanContainer.doBeforeStart(ModuleScanCont
ainer.java:94)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentC
ontainer.java:140)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer
.java:127)
at org.sonar.batch.scan.ProjectScanContainer.scan(ProjectScanContainer.j
ava:265)
at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScan
Container.java:260)
at org.sonar.batch.scan.ProjectScanContainer.doAfterStart(ProjectScanCon
tainer.java:250)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentC
ontainer.java:142)
at org.sonar.batch.scan.ProjectScanContainer.startComponents(ProjectScan
Container.java:128)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer
.java:127)
at org.sonar.batch.task.ScanTask.execute(ScanTask.java:55)
at org.sonar.batch.task.TaskContainer.doAfterStart(TaskContainer.java:86
)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentC
ontainer.java:142)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer
.java:127)
at org.sonar.batch.bootstrap.GlobalContainer.executeTask(GlobalContainer
.java:124)
at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:119)
at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.exec
ute(BatchIsolatedLauncher.java:62)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(Iso
latedLauncherProxy.java:60)
at $Proxy0.execute(Unknown Source)
at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner
.java:240)
at org.sonarsource.scanner.api.EmbeddedScanner.runAnalysis(EmbeddedScann
er.java:151)
at org.sonarsource.scanner.cli.Main.runAnalysis(Main.java:110)
at org.sonarsource.scanner.cli.Main.execute(Main.java:72)
at org.sonarsource.scanner.cli.Main.main(Main.java:60)
Caused by: java.lang.NoClassDefFoundError: org/sonar/api/resources/ProjectFileSy
stem
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2442)
at java.lang.Class.getDeclaredMethods(Class.java:1808)
at org.picocontainer.injectors.AdaptingInjection$1.run(AdaptingInjection
.java:203)
at java.security.AccessController.doPrivileged(Native Method)
at org.picocontainer.injectors.AdaptingInjection.injectionMethodAnnotate
d(AdaptingInjection.java:200)
at org.picocontainer.injectors.AdaptingInjection.methodAnnotatedInjectio
nAdapter(AdaptingInjection.java:171)
at org.picocontainer.injectors.AdaptingInjection.createComponentAdapter(
AdaptingInjection.java:70)
at org.picocontainer.behaviors.AbstractBehaviorFactory.createComponentAd
apter(AbstractBehaviorFactory.java:44)
at org.picocontainer.behaviors.OptInCaching.createComponentAdapter(OptIn
Caching.java:45)
at org.picocontainer.DefaultPicoContainer.addComponent(DefaultPicoContai
ner.java:536)
at org.picocontainer.DefaultPicoContainer.access$300(DefaultPicoContaine
r.java:84)
at org.picocontainer.DefaultPicoContainer$AsPropertiesPicoContainer.addC
omponent(DefaultPicoContainer.java:1149)
at org.sonar.core.platform.ComponentContainer.addExtension(ComponentCont
ainer.java:246)
... 30 more
Caused by: java.lang.ClassNotFoundException: org.sonar.api.resources.ProjectFile
System
at org.sonar.classloader.ParentFirstStrategy.loadClass(ParentFirstStrate
gy.java:39)
at org.sonar.classloader.ClassRealm.loadClass(ClassRealm.java:87)
at org.sonar.classloader.ClassRealm.loadClass(ClassRealm.java:76)
... 44 more

@PriteshDad
Copy link
Author

I was able to resolve this exception when used Sonar qube 5.2, however now the parsing errors when the plug-in analyzes the esql.

@ThomasPohl ThomasPohl self-assigned this May 9, 2016
@ThomasPohl
Copy link
Member

I have only tested the plugin with SonarQube 4.5.2, but it's great to know that it works with 5.2. When I'll find some time I will check what is necessary to make the plugin compatible with 5.5.

In the meantime could you please provide the line(s) where the parse-errors occure? Maybe you found a bug in the parser.

@PriteshDad
Copy link
Author

I was able to run the plug in sonar-esql-plugin-1.0.1 with sonarqube-5.2 and sonar-scanner-2.6. However, seems like not all the rule errors are reported. I fed all the esql files under resources in the project to simulate the errors (and I am sure they were scanned) and see only two were reported in the report, the only two errors caught were

  • The line contains 151 characters which is greater than 120 authorized.
  • This if has a nesting level of 4, which is higher than the maximum allowed 3

Rest were not reported. Is there a way to analyze why other rules errors were not reported, eventhough esql files had those.
sonar_screen

@ThomasPohl
Copy link
Member

There is a rule called "Parser failure". Please check if it is activated in your Quality profile. If not, activate it and reanalyze your code.

@PriteshDad
Copy link
Author

CREATE FIELD OutputRoot.JSON.Data.item.featureList IDENTITY (JSON.Array)featureList;

This is the line at which seems like parsing error is occurring. Not sure what could be the reason.

ThomasPohl added a commit that referenced this issue May 24, 2016
- issue #7
- variable names
- case functions and statements
@ThomasPohl
Copy link
Member

That's a bug in the ESQL-parser of the plugin. The fix will be included in the next release.

@rashisaxena
Copy link

@ThomasPohl : can you please let us know when are you planning to release the next version.

We are running sonar 5.4 and we get the following error when esql is installed


[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.0.2:sonar (default-cli) on project sandbox-project: Unable to register extension com.exxeta.eis.sonar.esql.core.EsqlSourceImporter: org/sonar/api/resources/ProjectFileSystem: org.sonar.api.resources.ProjectFileSystem

@ThomasPohl
Copy link
Member

I just released version 1.1.0
This version is compiled for SonarQube 4.5.2.
Currently I can't tell you when the plugin will support 5.4, but feel free to create a pull request. https://help.github.com/articles/using-pull-requests/

@ThomasPohl
Copy link
Member

Probably I will publish the next release candidate next week. It will require at least SonarQube Version 5.6.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants