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

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

Open
aniaMu opened this issue Jan 14, 2016 · 35 comments
Open

Comments

@aniaMu
Copy link

aniaMu commented Jan 14, 2016

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
@russnettle
Copy link

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

@Sulfkain
Copy link

Sulfkain commented Feb 5, 2016

Same problem here.
Will be some fix soon?

Thank you very much for this excelent work :).

@oliviertavel
Copy link

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

@hrskrs
Copy link

hrskrs commented Feb 8, 2016

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).

@oliviertavel
Copy link

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

@hrskrs
Copy link

hrskrs commented Feb 10, 2016

You can download jar file from here

@oliviertavel
Copy link

Thank you @hrskrs !!!

@Pierrot42
Copy link

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

@smmcdonald
Copy link

@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

@Pierrot42
Copy link

thank you very much @smmcdonald ;)

@nayaknamit
Copy link

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

@nayaknamit
Copy link

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

@hrskrs
Copy link

hrskrs commented Mar 3, 2016

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

@MAJID12
Copy link

MAJID12 commented Mar 6, 2016

Thank you @smmcdonald

@niitMobileLab
Copy link

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

@hrskrs
Copy link

hrskrs commented Apr 25, 2016

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

@niitMobileLab
Copy link

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

@CQHO
Copy link

CQHO commented May 4, 2016

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

@CQHO
Copy link

CQHO commented May 4, 2016

any fix will come soon?

@nicolastinkl
Copy link

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.

@cjran
Copy link

cjran commented Jun 1, 2016

@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 442012208@qq.com.

Thank you every much.

@Lrdcq
Copy link

Lrdcq commented Jun 1, 2016

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

@cjran
Copy link

cjran commented Jun 1, 2016

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

@nfalco79
Copy link

nfalco79 commented Jun 3, 2016

me too

@farion
Copy link

farion commented Jun 6, 2016

same here

@Deub27
Copy link

Deub27 commented Jun 7, 2016

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

@nfalco79
Copy link

nfalco79 commented Jun 8, 2016

I'm trying to move to backelite fork.

@JasonXZh
Copy link

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.

@KunalV2
Copy link

KunalV2 commented Aug 4, 2016

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

@franckclement
Copy link

@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

@stas6100
Copy link

I have problem running sonar-runner (SonarQube Scanner 2.5) against SonarQube Version 5.6.4.
If I use sonar-objective-c-plugin-0.4.0.jar I get
java.lang.IllegalStateException: Unable to register extension org.sonar.plugins.objectivec.core.ObjectiveCSourceImporter

and if I use: sonar-objective-c-plugin-0.5.0-SNAPSHOT.jar

I get
You must install a plugin that supports the language 'objc'
I see the plugin at update center: http://take.ms/oSK7j

@stas6100
Copy link

stas6100 commented Jan 5, 2017

Just wanted to follow up on the above, any feedback? Thanks

@puneetsoni1
Copy link

Hi I used this plugin for sonarqube 6
sonar-objective-c-plugin-0.5.0-SNAPSHOT.jar
its show error
java.lang.NoSuchMethodError: org.sonar.api.resources.File.fromIOFile(Ljava/io/File;Lorg/sonar/api/resources/Project;)Lorg/sonar/api/resources/File; at org.sojnar.plugins.objectivec.ObjectiveCSquidSensor.saveViolations(ObjectiveCSquidSensor.java:145)
please tell me how to fix it

@ropherpanama
Copy link

I have the same problem with Sonarqube 5.5. I am trying to use an ESQL plugin, the error is
java.lang.IllegalStateException: Unable to register extension com.exxeta.iss.sonar.esql.core.EsqlSourceImporter
....
Caused by: java.lang.NoClassDefFoundError: org/sonar/api/resources/ProjectFileSystem

@TorstenKruse
Copy link

Looks like this plugin is no longer supported. Perhaps this fork will help (didn't try myself): https://github.com/Backelite/sonar-objective-c/releases

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