Unable to register extension org.sonar.plugins.scala.cobertura.CoberturaSensor - scala

I am using SonarQube 5.1 and its running on localhost. It was working out of box for java, but when i added the plugin for scala - http://docs.codehaus.org/display/SONAR/Scala+Plugin (i checked out the code from github, build the jar and then installed in sonarqube installation), now every time i invoke the gradle command sonarRunner - I am getting this error:
19:52:55.232 [ERROR] [system.err] ERROR: Unable to execute Sonar
19:52:55.233 [ERROR] [system.err] ERROR: Caused by: Unable to register extension org.sonar.plugins.scala.cobertura.CoberturaSensor
19:52:55.233 [ERROR] [system.err] ERROR: Caused by: org/sonar/plugins/cobertura/api/AbstractCoberturaParser
19:52:55.233 [ERROR] [system.err] ERROR: Caused by: org.sonar.plugins.cobertura.api.AbstractCoberturaParser
I tried searching for cause of the issue but could not find anything online. Please help me.

It took me about a million years to find this, so I hope it's helpful to someone. This error is caused by updates to the sonar api that cause incompatibility with versions older than 4.5.
The solution is to use the updated version of the sonar scala plugin which is available here: https://github.com/1and1/sonar-scala
This built straight away for me and started analyzing scala without error.

There are several things you can update in your project and on your Sonar server.
Go to your SonarQube Update Center
Go to Administration -> System -> Update Center
Update the CorberturaSenor plugin
As per this screenshot, find the specific plugin you are using and click update if available(This screenshot is showing a findbugs plugin but it will be the same concept for CorberturaSenor).
Update sonarqube dependency in your project
This example is in Gradle:
dependencies {
classpath "org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.1-rc1"
}
Update sonar version
This example is in Gradle
sonarqube {
version='2.1-rc1'
}
Update your CoberturaSensor plugin dependency in your project.
Get the fully qualified name of your dependency you are using and search for a new version. Then update it in your build tool.
Check here for more info on this error: Unable to register extension org.sonar.plugins.*

Related

Facing issue while creating maven project in eclipse

Not able to create maven project in eclipse, error occurring which is given below screen shots.
and below error logs.
Could not resolve archetype org.apache.maven.archetypes:maven-archetype-quickstart:RELEASE from any of the configured repositories.
Could not resolve artifact org.apache.maven.archetypes:maven-archetype-quickstart:pom:RELEASE
Failed to resolve version for org.apache.maven.archetypes:maven-archetype-quickstart:pom:RELEASE: Could not find metadata org.apache.maven.archetypes:maven-archetype-quickstart/maven-metadata.xml in local (C:\Users[user].m2\repository)
Failed to resolve version for org.apache.maven.archetypes:maven-archetype-quickstart:pom:RELEASE: Could not find metadata org.apache.maven.archetypes:maven-archetype-quickstart/maven-metadata.xml in local (C:\Users[user].m2\repository)

Error occurred during initialization of boot layer java.lang.module.FindException executing Selenium tests using TestNG and Java 12 through Eclipse

ErrorOccuredDuringInitializationofbootlayer I keep getting this error when I run
my test:
Error occurred during initialization of boot layer
java.lang.module.FindException: Unable to derive module descriptor for
C:\Users\Bonfire.eclipse\org.eclipse.platform_4.12.0_867647348_win32_win32_x86_64\plugins\com.beust.jcommander_1.72.0.jar
Caused by: java.lang.IllegalArgumentException:
com.beust.jcommander.1.72.0: Invalid module name: '1' is not a Java
identifier
How can I fix it?
Add TestNG Library to classpath in buildpath ( not to module path). It will work fine.
To avoid this error, do not add TestNG library in the project or src folder. Try adding it into the package. To do so , follow the below mentioned procedure.
Right click on the package, click Build Path->Configure Build Path, go to Libraries tab, select Classpath and click on Add Library to select TestNG.
This error message...
Error occurred during initialization of boot layer java.lang.module.FindException:
Unable to derive module descriptor for C:\Users\Bonfire.eclipse\org.eclipse.platform_4.12.0_867647348_win32_win32_x86_64\plugins\com.beust.jcommander_1.72.0.jar
Caused by: java.lang.IllegalArgumentException: com.beust.jcommander.1.72.0: Invalid module name: '1' is not a Java identifier
...implies that there was an issue with the java classpath.
As per the discussion Launch with java 11 fails: Error: Could not find or load main class with Caused by: java.lang.ClassNotFoundException: with there are some issues with some particular classpaths for java-11 and the launch fails if:
The classpath contains a folder with spaces
The classpath length is larger than 32767 characters.
Where as java-8 works fine.
Reference
Unable to import org.openqa.selenium.WebDriver using Selenium and Java 11
Outro
Eclipse plugin: TestNG testcase does not run with Jdk11
Need to add 1.8 version library
Remove TestNG from build path library and add again
Recheck - the issue should be resolved.
I got same issue and I solved it. When creating the project, don't create module-info.java. When the project was already created with the module-info.java, deleting this file didn't help me.
I just created new project without module-info.java, and all works good now.
Best option to resolve this:
Find all file and folder starting with . e.g. — .metadata / .setting and delete them.
Add all the JARS.
Add testNG Libraries.
Execute it.
Done.

Failed to execute goal org.apache.uima:ruta-maven-plugin:2.6.1 generate

Can no longer build my application due to an issue with a dependent class of ruta-maven-plugin:2.6.1. I've tried to use multiple version of ASM including 5.0.2 and 6.2. These version are dependencies of Apache Tika 1.17/18/19.
Here is the full build failure message:
Failed to execute goal org.apache.uima:ruta-maven-plugin:2.6.1:generate (default) on project DAnE-Pipeline: Execution default of goal org.apache.uima:ruta-maven-plugin:2.6.1:generate failed: Failed to read candidate component class: URL [jar:file:/home/fm/.m2/repository/org/apache/uima/ruta-core/2.6.1/ruta-core-2.6.1.jar!/org/apache/uima/ruta/resource/TrieXMLEventHandler.class]; nested exception is org.springframework.core.NestedIOException: ASM ClassReader failed to parse class file - probably due to a new Java class file version that isn't supported yet: class path resource [org/xml/sax/helpers/DefaultHandler.class]; nested exception is java.lang.IllegalArgumentException -> [Help 1]
I feel like I've tried everything. Any help will be appreciated!
I re-read Peter's suggestion above. I was adding a newer Spring dependency in my project, but not in the "scope of the plugin". Once I created the Spring dependencies there, it worked! Thanks, Peter.

Build Failure of Apache Beam 2.6.0-SNAPSHOT

I am Facing Issue While Building master Node of Apache beam 2.6.0-SNAPSHOT and Getting Error :
Failed to execute goal com.igormaznitsa:mvn-golang-wrapper:2.1.7:build (go-build-linux-amd64)
Can't find generated target file : C:\Users\KishanK\Desktop\2.5.0\Updated\beam\sdks\go\target\linux_amd64\beamctl -> [Help 1]
I am Facing problem from Last Few Weeks Build Always get Failed on Go SDK.
Thanks for reporting the issue. I also see the problem on my machine and opened a bug: https://issues.apache.org/jira/browse/BEAM-4724
Note that Beam has migrated its build system from Maven to Gradle and Maven support is in the process of being removed. The error happens with Maven only and why it seems to have gone unnoticed. The simplest path forward is to build with Gradle instead, i.e., "./gradlew build".
Henning

How to change Eclipse-Groovy plugin Groovy libraries?

I am using the newest version (2.8.0) of the Eclipse-Groovy plugin that ships with groovy-all-2.1.5.jar. I added Guice to my Groovy project, and when I go to run them from inside Eclipse I get the following error in the console output:
Caught: java.lang.NoClassDefFoundError: org/codehaus/groovy/runtime/typehandling/ShortTypeHandling
java.lang.NoClassDefFoundError: org/codehaus/groovy/runtime/typehandling/ShortTypeHandling
at net.me.myapp.utils.restclient.RestClient.<init>(RestClient.groovy:57)
at net.me.myapp.inject.UserServiceClientModule.configure(UserServiceClientModule.groovy:34)
at com.google.inject.AbstractModule.configure(AbstractModule.java:59)
at com.google.inject.spi.Elements$RecordingBinder.install(Elements.java:223)
at com.google.inject.spi.Elements.getElements(Elements.java:101)
at com.google.inject.internal.InjectorShell$Builder.build(InjectorShell.java:133)
at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:103)
at com.google.inject.Guice.createInjector(Guice.java:95)
at com.google.inject.Guice.createInjector(Guice.java:72)
at com.google.inject.Guice.createInjector(Guice.java:62)
at net.me.myapp.UserServiceClient.<init>(UserServiceClient.groovy:37)
at net.me.myapp.UserServiceClient.main(UserServiceClient.groovy:45)
Caused by: java.lang.ClassNotFoundException: org.codehaus.groovy.runtime.typehandling.ShortTypeHandling
... 12 more
According to this answer it's because ShortTypeHandling wasn't added until 2.3.x. So I would now like to attach groovy-all-2.3.3.jar to my Eclipse project's classpath.
The problem is that I don't seem to have edit permissions to change what library the Groovy Libraries library uses under the hood. And when I manually add the 2.3.3 JAR to my build path, I get the following error:
Caught: java.lang.ExceptionInInitializerError
java.lang.ExceptionInInitializerError
Caused by: groovy.lang.GroovyRuntimeException: Conflicting module versions. Module [groovy-all is loaded in version 2.1.5 and you are trying to load version 2.3.3
What are my options?
Groovy-eclipse versions have its own compilers and are "locked" to them. You may change the versions to whatever is listed under Window > Preferences > Groovy > Compilers, but, AFAIK, you can't change to an arbitrary version of the compiler by simply changing the groovy-all jar in the guts of the plugin dir.
You can install new compiler versions using the update site or eclipse marketplace
Update: install additional compiler versions through Help > Install new Software, select Groovy update site and expand the Extra Groovy Compilers session:
Note i'm using snapshot update site, because i like to live dangerously.