sonar-objective-c icon indicating copy to clipboard operation
sonar-objective-c copied to clipboard

java.lang.NoClassDefFoundError: org/sonar/api/resources/ProjectFileSystem

Open aniaMu opened this issue 9 years ago • 35 comments

SonarQube 5.3 changed their API and removed the ProjectFileSystem class and running any analysis against this version throws the following error:

ERROR: Error during Sonar runner execution
org.sonar.runner.impl.RunnerException: Unable to execute Sonar
    at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:91)
    at org.sonar.runner.impl.BatchLauncher$1.run(BatchLauncher.java:75)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.sonar.runner.impl.BatchLauncher.doExecute(BatchLauncher.java:69)
    at org.sonar.runner.impl.BatchLauncher.execute(BatchLauncher.java:50)
    at org.sonar.runner.api.EmbeddedRunner.doExecute(EmbeddedRunner.java:102)
    at org.sonar.runner.api.Runner.execute(Runner.java:100)
    at org.sonar.runner.Main.executeTask(Main.java:70)
    at org.sonar.runner.Main.execute(Main.java:59)
    at org.sonar.runner.Main.main(Main.java:53)
Caused by: java.lang.IllegalStateException: Unable to register extension org.sonar.plugins.objectivec.core.ObjectiveCSourceImporter
    at org.sonar.core.platform.ComponentContainer.addExtension(ComponentContainer.java:238)
    at org.sonar.batch.bootstrap.ExtensionInstaller.doInstall(ExtensionInstaller.java:72)
    at org.sonar.batch.bootstrap.ExtensionInstaller.install(ExtensionInstaller.java:52)
    at org.sonar.batch.scan.ModuleScanContainer.addExtensions(ModuleScanContainer.java:172)
    at org.sonar.batch.scan.ModuleScanContainer.doBeforeStart(ModuleScanContainer.java:92)
    at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:130)
    at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:117)
    at org.sonar.batch.scan.ProjectScanContainer.scan(ProjectScanContainer.java:243)
    at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:238)
    at org.sonar.batch.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:228)
    at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:132)
    at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:117)
    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(ComponentContainer.java:132)
    at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:117)
    at org.sonar.batch.bootstrap.GlobalContainer.executeTask(GlobalContainer.java:122)
    at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:119)
    at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:79)
    at org.sonar.runner.batch.IsolatedLauncher.execute(IsolatedLauncher.java:48)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:87)
    ... 9 more
Caused by: java.lang.NoClassDefFoundError: org/sonar/api/resources/ProjectFileSystem
    at java.lang.Class.getDeclaredMethods0(Native Method)
    at java.lang.Class.privateGetDeclaredMethods(Class.java:2570)
    at java.lang.Class.getDeclaredMethods(Class.java:1855)
    at org.picocontainer.injectors.AdaptingInjection$1.run(AdaptingInjection.java:203)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.picocontainer.injectors.AdaptingInjection.injectionMethodAnnotated(AdaptingInjection.java:200)
    at org.picocontainer.injectors.AdaptingInjection.methodAnnotatedInjectionAdapter(AdaptingInjection.java:171)
    at org.picocontainer.injectors.AdaptingInjection.createComponentAdapter(AdaptingInjection.java:70)
    at org.picocontainer.behaviors.AbstractBehaviorFactory.createComponentAdapter(AbstractBehaviorFactory.java:44)
    at org.picocontainer.behaviors.OptInCaching.createComponentAdapter(OptInCaching.java:45)
    at org.picocontainer.DefaultPicoContainer.addComponent(DefaultPicoContainer.java:536)
    at org.picocontainer.DefaultPicoContainer.access$300(DefaultPicoContainer.java:84)
    at org.picocontainer.DefaultPicoContainer$AsPropertiesPicoContainer.addComponent(DefaultPicoContainer.java:1149)
    at org.sonar.core.platform.ComponentContainer.addExtension(ComponentContainer.java:236)
    ... 33 more
Caused by: java.lang.ClassNotFoundException: org.sonar.api.resources.ProjectFileSystem
    at org.sonar.classloader.ParentFirstStrategy.loadClass(ParentFirstStrategy.java:39)
    at org.sonar.classloader.ClassRealm.loadClass(ClassRealm.java:87)
    at org.sonar.classloader.ClassRealm.loadClass(ClassRealm.java:76)
    ... 47 more

aniaMu avatar Jan 14 '16 10:01 aniaMu

Seeing a similar problem - I get the following when trying to run against 5.3 ERROR: Error during Sonar runner execution ERROR: Unable to execute Sonar ERROR: Caused by: Unable to register extension org.sonar.plugins.objectivec.core.ObjectiveCSourceImporter ERROR: Caused by: org/sonar/api/resources/ProjectFileSystem ERROR: Caused by: org.sonar.api.resources.ProjectFileSystem

russnettle avatar Feb 01 '16 16:02 russnettle

Same problem here. Will be some fix soon?

Thank you very much for this excelent work :).

Sulfkain avatar Feb 05 '16 11:02 Sulfkain

Hi ! I've same problem for sonar-runner execution too. Waiting fix. Thank you !

oliviertavel avatar Feb 06 '16 00:02 oliviertavel

If you check latest commits you can see that ProjectFileSystem was deleted. A solution to this is to use PR#97 which solves most of the deprecated functions. However there is an issue about objective-c coverage (cobertura).

hrskrs avatar Feb 08 '16 08:02 hrskrs

Thank you @hrskrs ! But I don't know Java and can you build and create a jar (plugin) for this PR, pls ?

oliviertavel avatar Feb 10 '16 13:02 oliviertavel

You can download jar file from here

hrskrs avatar Feb 10 '16 13:02 hrskrs

Thank you @hrskrs !!!

oliviertavel avatar Feb 10 '16 15:02 oliviertavel

Hello, @hrskrs can you share your jar one more time please ?

Pierrot42 avatar Feb 25 '16 10:02 Pierrot42

@hrskrs jar file download URL is broken. @Pierrot42 I'll host the snapshot for a brief time on my google drive. Get it while it's hot. https://drive.google.com/file/d/0B8TMhTccVIJ-d1lvN3dxb1M4a3c/view?usp=sharing

smmcdonald avatar Feb 26 '16 15:02 smmcdonald

thank you very much @smmcdonald ;)

Pierrot42 avatar Feb 26 '16 16:02 Pierrot42

How to use this jar file where i need to placed it

nayaknamit avatar Feb 29 '16 03:02 nayaknamit

Can you help me out as this exception is still coming how should i proceed further to setup sonar qube on my mac

nayaknamit avatar Mar 01 '16 11:03 nayaknamit

@nayaknamit you have to place the jar on plugins section of sonar instalation folder

hrskrs avatar Mar 03 '16 08:03 hrskrs

Thank you @smmcdonald

MAJID12 avatar Mar 06 '16 10:03 MAJID12

Hi All, I tried adding this snapshot jar in plugins directory but after that Sonar server is not starting up showing this error

org.sonar.api.utils.MessageException: Found two files for the same plugin [objectivec]: sonar-objective-c-plugin-0.5.0-SNAPSHOT.jar and sonar-objective-c-plugin-0.4.0-3.jar

Please help as I'm configuring this for Objective C project in MAC

niitMobileLab avatar Apr 25 '16 07:04 niitMobileLab

@niitMobileLab Remove sonar-objective-c-plugin-0.4.0-3.jar manually from sonar folder and restart sonar

hrskrs avatar Apr 25 '16 08:04 hrskrs

Thanks @hrskrs ,as you suggested I removed sonar-objective-c-plugin-0.4.0-3.jar and after that had to change the key to objectivec and finally it worked.

Thanks again

niitMobileLab avatar Apr 25 '16 09:04 niitMobileLab

no issues reported by the sonar-objectivec-0.5....but exception from 0.4

CQHO avatar May 04 '16 08:05 CQHO

any fix will come soon?

CQHO avatar May 04 '16 08:05 CQHO

Environment:

  1. Sonarqube-5.5
  2. Xcodebuild -version( Xcode 7.3 Build version 7D175)
  3. Sonar-objective-c -version(0.4.0,master)
  4. Mysql(Ver 14.14 Distrib 5.7.10, for osx10.11 (x86_64))
  5. OCLint installed. Version 0.8.1
  6. xctool -version (0.2.7)

Here is the error info:


2016.05.05 10:36:57 INFO  web[o.s.s.p.DefaultServerFileSystem] SonarQube home: /Users/tinkl/Documents/language/Sonarqube/sonarqube-5.5
2016.05.05 10:36:57 INFO  web[o.e.plugins] [sonar-1462415807267] loaded [], sites []
2016.05.05 10:36:57 ERROR web[o.a.c.c.C.[.[.[/]] Exception sending context initialized event to listener instance of class org.sonar.server.platform.PlatformServletContextListener
org.sonar.api.utils.MessageException: File is not a plugin. Please delete it and restart: /Users/tinkl/Documents/language/Sonarqube/sonarqube-5.5/extensions/plugins/sonar-objective-c-plugin-0.4.0-sources.jar
2016.05.05 10:36:57 ERROR web[o.a.c.c.StandardContext] One or more listeners failed to start. Full details will be found in the appropriate container log file
2016.05.05 10:36:57 ERROR web[o.a.c.c.StandardContext] Context [] startup failed due to previous errors
2016.05.05 10:36:57 WARN  web[o.a.c.l.WebappClassLoaderBase] The web application [ROOT] appears to have started a thread named [Abandoned connection cleanup thread] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
 java.lang.Object.wait(Native Method)
 java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:135)
 com.mysql.jdbc.AbandonedConnectionCleanupThread.run(AbandonedConnectionCleanupThread.java:43)
2016.05.05 10:36:58 INFO  web[o.a.c.h.Http11NioProtocol] Starting ProtocolHandler ["http-nio-0.0.0.0-9000"]
2016.05.05 10:36:58 INFO  web[o.s.s.a.TomcatAccessLog] Web server is started
2016.05.05 10:36:58 INFO  web[o.s.s.a.EmbeddedTomcat] HTTP connector enabled on port 9000
2016.05.05 10:36:58 WARN  web[o.s.p.ProcessEntryPoint] Fail to start web
java.lang.IllegalStateException: Webapp did not start
    at org.sonar.server.app.EmbeddedTomcat.isUp(EmbeddedTomcat.java:84) ~[sonar-server-5.5.jar:na]
    at org.sonar.server.app.WebServer.isUp(WebServer.java:48) [sonar-server-5.5.jar:na]
    at org.sonar.process.ProcessEntryPoint.launch(ProcessEntryPoint.java:105) ~[sonar-process-5.5.jar:na]
    at org.sonar.server.app.WebServer.main(WebServer.java:69) [sonar-server-5.5.jar:na]
2016.05.05 10:36:58 INFO  web[o.a.c.h.Http11NioProtocol] Pausing ProtocolHandler ["http-nio-0.0.0.0-9000"]
2016.05.05 10:36:59 INFO  web[o.a.c.h.Http11NioProtocol] Stopping ProtocolHandler ["http-nio-0.0.0.0-9000"]
2016.05.05 10:36:59 INFO  web[o.a.c.h.Http11NioProtocol] Destroying ProtocolHandler ["http-nio-0.0.0.0-9000"]
2016.05.05 10:36:59 INFO  web[o.s.s.a.TomcatAccessLog] Web server is stopped
2016.05.05 10:36:59 INFO  app[o.s.p.m.Monitor] Process[es] is stopping
2016.05.05 10:37:00 INFO   es[o.s.p.StopWatcher]  Stopping process
2016.05.05 10:37:00 INFO   es[o.elasticsearch.node]  [sonar-1462415807267] stopping ...
2016.05.05 10:37:00 INFO   es[o.elasticsearch.node]  [sonar-1462415807267] stopped
2016.05.05 10:37:00 INFO   es[o.elasticsearch.node]  [sonar-1462415807267] closing ...
2016.05.05 10:37:00 INFO   es[o.elasticsearch.node]  [sonar-1462415807267] closed
2016.05.05 10:37:00 INFO  app[o.s.p.m.Monitor] Process[es] is stopped

when i was delete the file*jar: "sonar-objective-c-plugin-0.4.0-sources.jar", but the Analyics failed.

nicolastinkl avatar May 05 '16 02:05 nicolastinkl

@hrskrs hi, I'm sorry to trouble you. I conn't download this jar on "https://www.dropbox.com/s/w3qfapnb0xqy5s7/sonar-objective-c-plugin-0.5.0-SNAPSHOT.jar?dl=0".Can you send an email to my mailbox.My email is [email protected].

Thank you every much.

cjran avatar Jun 01 '16 02:06 cjran

@cjran http://o6w2l3t00.bkt.clouddn.com/sonar-objective-c-plugin-0.5.0-SNAPSHOT.jar

Lrdcq avatar Jun 01 '16 03:06 Lrdcq

@Lrdcq Thanks.But the sonar has no issues reported by sonar-objective-c-plugin-0.5.0-SNAPSHOT.jar

cjran avatar Jun 01 '16 08:06 cjran

me too

nfalco79 avatar Jun 03 '16 15:06 nfalco79

same here

farion avatar Jun 06 '16 11:06 farion

same here. No issue reported by sonar-objective-c-plugin-0.5.0-SNAPSHOT.jar

Deub27 avatar Jun 07 '16 10:06 Deub27

I'm trying to move to backelite fork.

nfalco79 avatar Jun 08 '16 17:06 nfalco79

just sonar5.3 can use sonar-objective-c-plugin-0.5.0-SNAPSHOT.jar ? I use this jar with sonar 5.5 and it doesn't work.

JasonXZh avatar Jun 24 '16 07:06 JasonXZh

Hello,

I am getting error "You must install a plugin that supports the language 'objc'". while using plugin. Below is the require details and error log. what should i pass in sonar.language? any help would be appreciated.

I downloaded sonar-objective-c-plugin-0.5.0-SNAPSHOT.jar plugin from https://drive.google.com/file/d/0B8TMhTccVIJ-d1lvN3dxb1M4a3c/view as version 0.4.0 is not compatible with SonarQube 5.3.

—————————————

xCode versin: 7.3 SonarQube version: 5.6 Sonar-Scanner version: 2.6.1 Plugin using: sonar-objective-c-plugin-0.5.0-SNAPSHOT.jar

————————————— Configuration

sonar.projectKey=v2solutions.SonarTestObjC sonar.projectName= SonarTestObjC sonar.projectVersion=1.0 sonar.language=objc

————————————— Error:

Running run-sonar.sh... Extracting Xcode project information.. .. Skipping tests as no test scheme has been provided! Running OCLint...1 error generated. 2 errors generated. 2 errors generated. 4 errors generated. 2 errors generated. 4 errors generated. 2 errors generated. 13 errors generated. 2 errors generated. 2 errors generated. 4 errors generated. 2 errors generated. 1 error generated. 3 errors generated. 27 errors generated. 1 error generated. 2 errors generated. 2 errors generated. 4 errors generated. 2 errors generated. 4 errors generated. 2 errors generated. 13 errors generated. 2 errors generated. 2 errors generated. 4 errors generated. 2 errors generated. 1 error generated. 3 errors generated. 27 errors generated. 1 error generated. 2 errors generated. 2 errors generated. 4 errors generated. 2 errors generated. 4 errors generated. 2 errors generated. 13 errors generated. 2 errors generated. 2 errors generated. 4 errors generated. 2 errors generated. 1 error generated. 3 errors generated. 27 errors generated.

Running SonarQube using SonarQube Runner..ERROR: Error during Sonar runner execution ERROR: Unable to execute Sonar ERROR: Caused by: You must install a plugin that supports the language 'objc' ERROR: ERROR: To see the full stack trace of the errors, re-run SonarQube Runner with the -e switch. ERROR: Re-run SonarQube Runner using the -X switch to enable full debug logging. ERROR - Command 'sonar-runner ' failed with error code: 1


Below is the detail error code:

SonarQube Runner 2.4 Java 1.8.0_102 Oracle Corporation (64-bit) Mac OS X 10.11.2 x86_64 INFO: Runner configuration file: /usr/local/Cellar/sonar-runner/2.4/libexec/conf/sonar-runner.properties INFO: Project configuration file: /Users/v2team/Documents/Projects/SonarTestObjC/sonar-project.properties INFO: Default locale: "en_US", source code encoding: "UTF-8" INFO: Work directory: /Users/v2team/Documents/Projects/SonarTestObjC/./.sonar INFO: SonarQube Server 5.6 19:29:43.410 INFO - Load global repositories 19:29:43.569 INFO - Load global repositories (done) | time=174ms 19:29:43.665 INFO - User cache: /Users/v2team/.sonar/cache 19:29:44.025 INFO - Load plugins index 19:29:44.028 INFO - Load plugins index (done) | time=3ms 19:29:45.654 INFO - Process project properties 19:29:45.852 INFO - Load project repositories 19:29:46.039 INFO - Load project repositories (done) | time=187ms 19:29:46.128 INFO - Load quality profiles 19:29:46.195 INFO - Load quality profiles (done) | time=67ms 19:29:46.208 INFO - Load active rules 19:29:46.701 INFO - Load active rules (done) | time=493ms 19:29:46.819 WARN - SCM provider autodetection failed. No SCM provider claims to support this project. Please use sonar.scm.provider to define SCM of your project. 19:29:46.819 INFO - Publish mode 19:29:46.833 INFO - ------------- Scan SonarTestObjC 19:29:47.134 INFO - Language is forced to objc INFO: ------------------------------------------------------------------------ INFO: EXECUTION FAILURE INFO: ------------------------------------------------------------------------ Total time: 5.230s Final Memory: 9M/172M INFO: ------------------------------------------------------------------------ ERROR: Error during Sonar runner execution ERROR: Unable to execute Sonar ERROR: Caused by: You must install a plugin that supports the language 'objc' ERROR: ERROR: To see the full stack trace of the errors, re-run SonarQube Runner with the -e switch. ERROR: Re-run SonarQube Runner using the -X switch to enable full debug logging.

  • returnValue=1
  • set +x ERROR - Command 'sonar-runner ' failed with error code: 1

KunalV2 avatar Aug 04 '16 13:08 KunalV2

@KunalV2 You should change the language from objc to objectivec with the sonar-objective-c-plugin-0.5.0-SNAPSHOT.jar plugin.

The problem I have now is that no issues are reported with the sonar-objective-c-plugin-0.5.0-SNAPSHOT.jar

franckclement avatar Aug 09 '16 07:08 franckclement