gradle error java.lang.NoClassDefFoundError: org/gradle/api/specs/Spec when trying to run unit-tests - gradle

I have a gradle based spring boot project. When I would like to run the tests an error message like this appears:
gradle-resources-test:my-project.my-module.test: java.lang.NoClassDefFoundError: org/gradle/api/specs/Spec
What can I do to find out more about the problem?

Related

Exception in thread "main" java.lang.NoClassDefFoundError: org/springframework/boot/SpringApplication, gradle error while building on Heroku

enter image description here
I am getting this error while building my spring boot application in Heroku, but when I run it locally in my eclipse, then it works fine.

Looking into what's wrong with the Quarkus 1.2.Final and Kogito 0.7.1 project

I am forced not to use Kogito parent bom for reasons I can't explain.
So I got a Maven project which is based on Quarkus 1.2.Final and Kogito 0.7.1, and was able to resolve all the version mismatch issues. The code compiles but fails to run tests. It throws the following error and I do have kogito-ruleunits in my dependencies.
9:18:53,268 ERROR [io.qua.dev.DevModeMain] Failed to start Quarkus: java.lang.RuntimeException: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
[error]: Build step io.quarkus.kogito.deployment.KogitoAssetsProcessor#generateModel threw an exception: java.lang.NoClassDefFoundError: org/kie/kogito/rules/impl/AbstractRuleUnits
I have publish the project on github : https://github.com/mravi786/junk/tree/master/dingo-dmn
You have this issue because you use a version incompatible with Quarkus 1.2.1.
I don't know exactly why you can't use the Kogito BOM but there's definitely some artifact that is not the right version.
Update: Quarkus 1.2.x supports Kogito 0.6.x. Due to the tight integration between the two, you cannot upgrade Kogito like this. If you absolutely need Kogito 0.7.1, you can start playing with Quarkus 1.3.0.Alpha2. We will release CR1 soon and the Final a week after that.

Why my spring-boot application is giving "ClassNotFoundException: javax.servlet.Filter" in Intellij but not in STS 3?

While running my spring-boot application I'm getting this exception:
ClassNotFoundException: javax.servlet.Filter
I am getting this in case of IntelliJ only while it is running successfully in STS 3.
Is there any generic reason?

getting error when run the JUNIT via gradle

I am getting the error beloe when using gradle to run Junit.
Could not resolve all dependencies for configuration ':apilink:testCompile'.
> Could not find powermock-module-junit4:version:1.6.0.
You have an invalid dependency declared that cannot be found. The incorrect part is 'powermock-module-junit4:version:1.6.0'. This should instead be 'org.powermock:powermock-module-junit4:1.6.0'.

Junit failures related to cobertura with multi-module maven project in jenkins

I am getting below test failures when building the multi-module maven project in jenkins.
JDK version - 1.8.51
junit - 4.12
org.codehaus.mojo/cobertura-maven-plugin - 2.7
powermock-easymock-release-full - 1.6.2
net.sourceforge.cobertura / cobertura - 2.1.1
All the above are latest plugins.
Test failures
Error 1
Error Message
net.sourceforge.cobertura.coveragedata.TouchCollector.registerClass(Ljava/lang/String;)V
Stacktrace
java.lang.NoSuchMethodError: net.sourceforge.cobertura.coveragedata.TouchCollector.registerClass(Ljava/lang/String;)V
Error 2
Error Message
Could not initialize class com.test.it.logging.EventLogHandler
Stacktrace
java.lang.NoClassDefFoundError: Could not initialize class com.test.it.logging.EventLogHandler
Error 3
Error Message
Failed to transform class with name com.test.it.ra.ReportArchiveConfProvider. Reason: cannot find net.sourceforge.cobertura.coveragedata.LightClassmapListener
Stacktrace
java.lang.IllegalStateException: Failed to transform class with name com.test.it.ra.ReportArchiveConfProvider. Reason: cannot find net.sourceforge.cobertura.coveragedata.LightClassmapListener
at
org.powermock.core.classloader.MockClassLoader.loadMockClass(MockClassLoader.java:266)
JFYI that it was working fine with JDK 7 and old version plugins. Have anyone faced this issue ? Please help.
I'm not on the same configurations as you, but ran into the same error around LightClassmapListener. I got past the issue by clearing my workspace.
In the jenkins job; click the workspace and select 'Wipe out Current Workspace'

Resources