Upgrading to JUnit 5.8.0 in combation with Maven Surefire plugin 3.0.0-M5 gives NoSuchMethodError - junit5

After upgrading JUnit from 5.7.2 to 5.8.0, it seems not to work anymore in combination with the Maven Surefire plugin.
Initially, the following error pops up:
[ERROR] Please refer to /some/directory/app/target/surefire-reports for the individual test results.
[ERROR] Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream.
[ERROR] There was an error in the forked process
[ERROR] TestEngine with ID 'junit-jupiter' failed to discover tests
[ERROR] org.apache.maven.surefire.booter.SurefireBooterForkException: There was an error in the forked process
[ERROR] TestEngine with ID 'junit-jupiter' failed to discover tests
[ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:733)
[ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:305)
[ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:265)
[ERROR] at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeProvider(AbstractSurefireMojo.java:1314)
[ERROR] at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAfterPreconditionsChecked(AbstractSurefireMojo.java:1159)
[ERROR] at org.apache.maven.plugin.surefire.AbstractSurefireMojo.execute(AbstractSurefireMojo.java:932)
[ERROR] at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:137)
[ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:210)
[ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:156)
[ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:148)
[ERROR] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)
[ERROR] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)
[ERROR] at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:56)
[ERROR] at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
[ERROR] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:305)
[ERROR] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:192)
[ERROR] at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:105)
[ERROR] at org.apache.maven.cli.MavenCli.execute(MavenCli.java:957)
[ERROR] at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:289)
[ERROR] at org.apache.maven.cli.MavenCli.main(MavenCli.java:193)
[ERROR] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[ERROR] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[ERROR] at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[ERROR] at java.base/java.lang.reflect.Method.invoke(Method.java:566)
[ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:282)
[ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:225)
[ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:406)
[ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:347)
After looking at the dump, the following errors are given:
org.junit.platform.commons.JUnitException: TestEngine with ID 'junit-jupiter' failed to discover tests
at org.junit.platform.launcher.core.EngineDiscoveryOrchestrator.discoverEngineRoot(EngineDiscoveryOrchestrator.java:111)
at org.junit.platform.launcher.core.EngineDiscoveryOrchestrator.discover(EngineDiscoveryOrchestrator.java:85)
at org.junit.platform.launcher.core.DefaultLauncher.discover(DefaultLauncher.java:92)
at org.junit.platform.launcher.core.DefaultLauncher.discover(DefaultLauncher.java:67)
at org.apache.maven.surefire.junitplatform.TestPlanScannerFilter.accept(TestPlanScannerFilter.java:56)
at org.apache.maven.surefire.api.util.DefaultScanResult.applyFilter(DefaultScanResult.java:102)
at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.scanClasspath(JUnitPlatformProvider.java:147)
at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invoke(JUnitPlatformProvider.java:128)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:428)
at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:162)
at org.apache.maven.surefire.booter.ForkedBooter.run(ForkedBooter.java:562)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:548)
Caused by: org.junit.platform.commons.JUnitException: ClassSelector [className = 'some.test.class'] resolution failed
at org.junit.platform.launcher.listeners.discovery.AbortOnFailureLauncherDiscoveryListener.selectorProcessed(AbortOnFailureLauncherDiscoveryListener.java:39)
at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.resolveCompletely(EngineDiscoveryRequestResolution.java:102)
at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.run(EngineDiscoveryRequestResolution.java:82)
at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolver.resolve(EngineDiscoveryRequestResolver.java:113)
at org.junit.jupiter.engine.discovery.DiscoverySelectorResolver.resolveSelectors(DiscoverySelectorResolver.java:46)
at org.junit.jupiter.engine.JupiterTestEngine.discover(JupiterTestEngine.java:69)
at org.junit.platform.launcher.core.EngineDiscoveryOrchestrator.discoverEngineRoot(EngineDiscoveryOrchestrator.java:103)
... 11 more
Caused by: java.lang.NoSuchMethodError: 'java.util.Optional org.junit.platform.commons.util.AnnotationUtils.findAnnotation(java.lang.Class, java.lang.Class, boolean)'
at org.junit.jupiter.engine.descriptor.DisplayNameUtils.getDisplayNameGenerator(DisplayNameUtils.java:110)
at org.junit.jupiter.engine.descriptor.DisplayNameUtils.lambda$createDisplayNameSupplierForClass$2(DisplayNameUtils.java:98)
at org.junit.jupiter.engine.descriptor.DisplayNameUtils.determineDisplayName(DisplayNameUtils.java:88)
at org.junit.jupiter.engine.descriptor.JupiterTestDescriptor.<init>(JupiterTestDescriptor.java:69)
at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.<init>(ClassBasedTestDescriptor.java:96)
at org.junit.jupiter.engine.descriptor.ClassTestDescriptor.<init>(ClassTestDescriptor.java:51)
at org.junit.jupiter.engine.discovery.ClassSelectorResolver.newClassTestDescriptor(ClassSelectorResolver.java:119)
at org.junit.jupiter.engine.discovery.ClassSelectorResolver.lambda$resolve$0(ClassSelectorResolver.java:71)
at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution$DefaultContext.createAndAdd(EngineDiscoveryRequestResolution.java:246)
at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution$DefaultContext.addToParent(EngineDiscoveryRequestResolution.java:209)
at org.junit.jupiter.engine.discovery.ClassSelectorResolver.resolve(ClassSelectorResolver.java:71)
at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.lambda$resolve$2(EngineDiscoveryRequestResolution.java:134)
at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
at java.base/java.util.ArrayList$ArrayListSpliterator.tryAdvance(ArrayList.java:1632)
at java.base/java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:127)
at java.base/java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:502)
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:488)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
at java.base/java.util.stream.FindOps$FindOp.evaluateSequential(FindOps.java:150)
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.base/java.util.stream.ReferencePipeline.findFirst(ReferencePipeline.java:543)
at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.resolve(EngineDiscoveryRequestResolution.java:185)
at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.resolve(EngineDiscoveryRequestResolution.java:125)
at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.resolveCompletely(EngineDiscoveryRequestResolution.java:91)
... 16 more
Does anyone have the same problem while updating? I'm kind of stuck :(
Updating the Maven Surefire Plugin was the first thing that came to my mind, but it seems we already use the latest version (3.0.0-M5).
Edit 1: As requested, the POM:
<properties>
<maven.compiler.parameters>true</maven.compiler.parameters>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<compiler-plugin.version>3.8.1</compiler-plugin.version>
<surefire-plugin.version>3.0.0-M5</surefire-plugin.version>
<sonarqube-plugin.version>3.2.0</sonarqube-plugin.version>
<compas.core.version>0.4.0</compas.core.version>
<jakarta-bind-api.version>2.3.3</jakarta-bind-api.version>
<jaxb-impl.version>2.3.5</jaxb-impl.version>
<jakarta-cdi-api.version>2.0.2</jakarta-cdi-api.version>
<microprofile-config-api.version>2.0</microprofile-config-api.version>
<slf4j.version>1.7.32</slf4j.version>
<!-- Test -->
<basex.version>9.2.4</basex.version>
<junit-jupiter.version>5.8.0</junit-jupiter.version>
<mockito-junit-jupiter.version>3.12.4</mockito-junit-jupiter.version>
<openpojo.version>0.9.1</openpojo.version>
</properties>

I just had a similar problem and it appears that it was an issue of the version of junit-platform-commons. Setting this to 1.8.0 solved it.
Or just add a single junit dependency to junit-bom -- this will ensure that the versions of all junit components are consistent, and fix the issue.

Related

Maven build failed for Carbon Api Management in WS02

Hi I am trying to customize wso2 and the latest source code giving me duplicate class error. The code generated is generating extra classes which is leading to compilation error. I want to build API Manager, in which the prerequisite is to build carbon api management which is what failing now. Please help.
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.
8.1:compile (default-compile) on project org.wso2.carbon.apimgt.rest.api.store.v
1: Compilation failure: Compilation failure:
[ERROR] /D:/projects/wso2/carbon-apimgt-master/components/apimgt/org.wso2.carbon
.apimgt.rest.api.store.v1/src/main/java/org/wso2/carbon/apimgt/rest/api/store/v1
/impl/ApisApiServiceImpl.java:[63,8] duplicate class: org.wso2.carbon.apimgt.res
t.api.store.v1.impl.ApisApiServiceImpl
[ERROR] /D:/projects/wso2/carbon-apimgt-master/components/apimgt/org.wso2.carbon
.apimgt.rest.api.store.v1/src/gen/java/org/wso2/carbon/apimgt/rest/api/store/imp
l/v1/TagsApiServiceImpl.java:[20,8] duplicate class: org.wso2.carbon.apimgt.rest
.api.store.v1.impl.TagsApiServiceImpl
[ERROR] /D:/projects/wso2/carbon-apimgt-master/components/apimgt/org.wso2.carbon
.apimgt.rest.api.store.v1/src/gen/java/org/wso2/carbon/apimgt/rest/api/store/imp
l/v1/ApiProductsApiServiceImpl.java:[28,8] duplicate class: org.wso2.carbon.apim
gt.rest.api.store.v1.impl.ApiProductsApiServiceImpl
[ERROR] /D:/projects/wso2/carbon-apimgt-master/components/apimgt/org.wso2.carbon
.apimgt.rest.api.store.v1/src/main/java/org/wso2/carbon/apimgt/rest/api/store/v1
/impl/SearchApiServiceImpl.java:[46,8] duplicate class: org.wso2.carbon.apimgt.r
est.api.store.v1.impl.SearchApiServiceImpl
[ERROR] /D:/projects/wso2/carbon-apimgt-master/components/apimgt/org.wso2.carbon
.apimgt.rest.api.store.v1/src/gen/java/org/wso2/carbon/apimgt/rest/api/store/imp
l/v1/SubscriptionsApiServiceImpl.java:[23,8] duplicate class: org.wso2.carbon.ap
imgt.rest.api.store.v1.impl.SubscriptionsApiServiceImpl
[ERROR] /D:/projects/wso2/carbon-apimgt-master/components/apimgt/org.wso2.carbon
.apimgt.rest.api.store.v1/src/gen/java/org/wso2/carbon/apimgt/rest/api/store/imp
l/v1/SettingsApiServiceImpl.java:[21,8] duplicate class: org.wso2.carbon.apimgt.
rest.api.store.v1.impl.SettingsApiServiceImpl
[ERROR] /D:/projects/wso2/carbon-apimgt-master/components/apimgt/org.wso2.carbon
.apimgt.rest.api.store.v1/src/gen/java/org/wso2/carbon/apimgt/rest/api/store/imp
l/v1/ApplicationsApiServiceImpl.java:[30,8] duplicate class: org.wso2.carbon.api
mgt.rest.api.store.v1.impl.ApplicationsApiServiceImpl
[ERROR] /D:/projects/wso2/carbon-apimgt-master/components/apimgt/org.wso2.carbon
.apimgt.rest.api.store.v1/src/gen/java/org/wso2/carbon/apimgt/rest/api/store/imp
l/v1/ImportApiServiceImpl.java:[21,8] duplicate class: org.wso2.carbon.apimgt.re
st.api.store.v1.impl.ImportApiServiceImpl
[ERROR] /D:/projects/wso2/carbon-apimgt-master/components/apimgt/org.wso2.carbon
.apimgt.rest.api.store.v1/src/gen/java/org/wso2/carbon/apimgt/rest/api/store/imp
l/v1/ExportApiServiceImpl.java:[20,8] duplicate class: org.wso2.carbon.apimgt.re
st.api.store.v1.impl.ExportApiServiceImpl
[ERROR] /D:/projects/wso2/carbon-apimgt-master/components/apimgt/org.wso2.carbon
.apimgt.rest.api.store.v1/src/main/java/org/wso2/carbon/apimgt/rest/api/store/v1
/impl/ThrottlingPoliciesApiServiceImpl.java:[30,8] duplicate class: org.wso2.car
bon.apimgt.rest.api.store.v1.impl.ThrottlingPoliciesApiServiceImpl
[ERROR] /D:/projects/wso2/carbon-apimgt-master/components/apimgt/org.wso2.carbon
.apimgt.rest.api.store.v1/src/gen/java/org/wso2/carbon/apimgt/rest/api/store/imp
l/v1/SelfSignupApiServiceImpl.java:[21,8] duplicate class: org.wso2.carbon.apimg
t.rest.api.store.v1.impl.SelfSignupApiServiceImpl
[ERROR] /D:/projects/wso2/carbon-apimgt-master/components/apimgt/org.wso2.carbon
.apimgt.rest.api.store.v1/src/gen/java/org/wso2/carbon/apimgt/rest/api/store/imp
l/v1/TenantsApiServiceImpl.java:[19,8] duplicate class: org.wso2.carbon.apimgt.r
est.api.store.v1.impl.TenantsApiServiceImpl
[ERROR] /D:/projects/wso2/carbon-apimgt-master/components/apimgt/org.wso2.carbon
.apimgt.rest.api.store.v1/src/main/java/org/wso2/carbon/apimgt/rest/api/store/v1
/impl/SdkGenApiServiceImpl.java:[34,8] duplicate class: org.wso2.carbon.apimgt.r
est.api.store.v1.impl.SdkGenApiServiceImpl

Hi, I had a maven project ,while trying to maven clean i am getting the following error,anyone help me

this is the error what i am getting ,war is generating but throwing error while trying to maven clean
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:2.4.1:clean (default-clean) on project ins-model: Failed to clean project: Failed to delete D:\VEMASVNINSURANCEWS\AIG\ins-parent\ins-model\target\surefire-reports -> [Help 1]
Failed to execute goal-clean-plugin:2.4.1:clean (default-clean) on project ins-model: Failed to clean project: Failed to delete ins-parent\ins-model\target\surefire-reports
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:319)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
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.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.apache.maven.plugin.MojoExecutionException: Failed to clean project: Failed to delete D:\VEMASVNINSURANCEWS\AIG\ins-parent\ins-model\target\surefire-reports
at org.apache.maven.plugin.clean.CleanMojo.execute(CleanMojo.java:188)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
... 19 more
Caused by: java.io.IOException: Failed to delete
[ERROR]
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] <goals> :ins-model
this is the error what i am getting ,war is generating but throwing error while trying to maven clean
You are on Windows and you cannot delete the target folder (that's basically what mvn cleandoes) if any program is currently having a lock on something inside target.
According to your logs, that's the folder surefeire-report which is locked so: either your previous build is not finished and you have a Java thread still locking that folder or your have it opened in a console/browser.
Some other process is using (parts of) the directory affected by clean (target). Some of the possible offenders:
An application launched from the IDE earlier and still running.
A directory nested within the parent directory (target) is opened in a file manager, it may lock parts of the content to be cleaned.

Maven build fails to instrument classes

I am getting the following error when running a maven build. Seems to not be able to instrument classes. Anyone has an idea what should be the cause?
Thanks.
Here is build output:
[ERROR] Failed to execute goal org.javalite:activejdbc-instrumentation:1.4.11:instrument (default) on project xtm2rest: Failed to add output directory to classpath: org.javalite.instrumentation.InstrumentationException: javassist.NotFoundException: modelClass(..) is not found in org.javalite.activejdbc.Model -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.javalite:activejdbc-instrumentation:1.4.11:instrument (default) on project xtm2rest: Failed to add output directory to classpath
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:216)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:120)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:347)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:154)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:213)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:157)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoExecutionException: Failed to add output directory to classpath
at org.javalite.instrumentation.ActiveJdbcInstrumentationPlugin.execute(ActiveJdbcInstrumentationPlugin.java:88)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:132)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
... 19 more
Caused by: java.lang.RuntimeException: org.javalite.instrumentation.InstrumentationException: javassist.NotFoundException: modelClass(..) is not found in org.javalite.activejdbc.Model
at org.javalite.instrumentation.Instrumentation.instrument(Instrumentation.java:70)
at org.javalite.instrumentation.ActiveJdbcInstrumentationPlugin.instrument(ActiveJdbcInstrumentationPlugin.java:124)
at org.javalite.instrumentation.ActiveJdbcInstrumentationPlugin.execute(ActiveJdbcInstrumentationPlugin.java:82)
... 21 more
Caused by: org.javalite.instrumentation.InstrumentationException: javassist.NotFoundException: modelClass(..) is not found in org.javalite.activejdbc.Model
at org.javalite.instrumentation.ModelInstrumentation.instrument(ModelInstrumentation.java:43)
at org.javalite.instrumentation.Instrumentation.instrument(Instrumentation.java:57)
... 23 more
Caused by: javassist.NotFoundException: modelClass(..) is not found in org.javalite.activejdbc.Model
at javassist.CtClassType.getDeclaredMethod(CtClassType.java:1210)
at org.javalite.instrumentation.ModelInstrumentation.doInstrument(ModelInstrumentation.java:51)
at org.javalite.instrumentation.ModelInstrumentation.instrument(ModelInstrumentation.java:40)
... 24 more
Since you are not adding any more information, I can only speculate that your version of activejdbc-instrumentation plugin and activejdbc are different. Check that both are on the same version.

Binary incompatibility in plugins detected in Play 2.1.3 project after upgrading to IDEA 13.1?

After updating IntelliJ IDEA to 13.1 last night I can't use Run/Debug config anymore. It happens in a project I've been working on in IDEA 13.0.x for the past couple of months -- now it shows me the message and I have no idea how I can solve this.
[info] Loading project definition from /www/play20apps/cnproject/project
[error] sbt.IncompatiblePluginsException: Binary incompatibility in plugins detected.
[error] Note that conflicts were resolved for some dependencies:
[error] asm:asm
[error] asm:asm-tree
[error] asm:asm-util
[error] org.avaje.ebeanorm:avaje-ebeanorm-agent
[error] jline:jline
[error] junit:junit
[error] com.jcraft:jsch
[error] commons-logging:commons-logging
[error] commons-codec:commons-codec
[error] Use 'last' for the full log.
[error] java.lang.ExceptionInInitializerError
[error] Use 'last' for the full log.
[error] Not a valid command: run
[error] run
[error] ^
Process finished with exit code 1
I didn't change Play version since yesterday of course and running application with common command line works as expected.
Also tried to create new run config after plugins' update with no luck.
Please advise.
Adding -Djline.terminal= to JVM Options should fix it.
last log reports this.
The relevant part:
Caused by: java.lang.IllegalArgumentException: java.lang.ClassNotFoundException: none
at jline.Terminal.setupTerminal(Terminal.java:65)
at jline.Terminal.getTerminal(Terminal.java:26)
at sbt.JLine$.sbt$JLine$$terminal(LineReader.scala:65)
where none is probably passed via -Djline.terminal=none.

play framework 2.1.x test conflict with slf4j-api

i've got a Play Framework 2.1.0 application, and even the simplest unit test will not run due to a system problem i'm struggling to track down. given this route:
POST /foo/bar controllers.FooBar.test()
...i've got a simple test to verify that the route exists:
#Test
public void fooBarRouteExists() {
running(fakeApplication(fakeGlobal()), new Runnable() {
#Override
public void run() {
final Result result = route(fakeRequest(POST, "/foo/bar"));
assertThat(result).isNotNull();
}
});
}
...which when run, produces the following Exception:
hsl [323]> play test
[info] Loading project definition from /Users/hsl/Documents/workspace/test_project/project
[info] Set current project to test_project (in build file:/Users/hsl/Documents/workspace/test_project/)
[info] Compiling 1 Java source to /Users/hsl/Documents/workspace/test_project/target/scala-2.10/test-classes...
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [file:/Users/hsl/Documents/workspace/test_project/target/scala-2.10/classes/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/usr/local/play-2.1.0/repository/local/ch.qos.logback/logback-classic/1.0.7/jars/logback-classic.> jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/usr/local/play-2.1.0/repository/cache/org.apache.activemq/activemq-all/jars/activemq-all-5.9.0.> jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
[error] Test controllers.FooBar.test failed: null
[error] at org.slf4j.LoggerFactory.bind(slf4j:LoggerFactory.java):128)
[error] at org.slf4j.LoggerFactory.performInitialization(slf4j:LoggerFactory.java):107)
[error] at org.slf4j.LoggerFactory.getILoggerFactory(slf4j:LoggerFactory.java):295)
[error] at org.slf4j.LoggerFactory.getLogger(slf4j:LoggerFactory.java):269)
[error] at play.api.Logger$.<init>(Logger.scala:179)
[error] at play.api.Logger$.<clinit>(Logger.scala)
[error] at play.api.Application$class.$init$(Application.scala:266)
[error] at play.api.test.FakeApplication.<init>(Fakes.scala:187)
[error] at play.test.FakeApplication.<init>(FakeApplication.java:28)
[error] at play.test.Helpers.fakeApplication(Helpers.java:97)
[error] at controllers.FooBar.test(FooBar.java:20)
[error] ...
[error] Caused by: java.lang.UnsupportedOperationException: This code should have never made it into slf4j-api.jar
[error] at org.slf4j.impl.StaticLoggerBinder.<init>(impl:StaticLoggerBinder.java):63)
[error] at org.slf4j.impl.StaticLoggerBinder.<clinit>(impl:StaticLoggerBinder.java):44)
[error] ... 42 more
[error] Failed: : Total 1, Failed 1, Errors 0, Passed 0, Skipped 0
[error] Failed tests:
[error] controllers.FooBar
java.lang.RuntimeException: Tests unsuccessful
at scala.sys.package$.error(package.scala:27)
at scala.Predef$.error(Predef.scala:123)
at sbt.Tests$.showResults(Tests.scala:192)
at sbt.Defaults$$anonfun$testTasks$6.apply(Defaults.scala:296)
at sbt.Defaults$$anonfun$testTasks$6.apply(Defaults.scala:294)
at sbt.Scoped$$anonfun$hf4$1.apply(Structure.scala:580)
at sbt.Scoped$$anonfun$hf4$1.apply(Structure.scala:580)
at scala.Function1$$anonfun$compose$1.apply(Function1.scala:49)
at sbt.coped$Reduced$$anonfun$combine$1$$anonfun$apply$12.apply(Structure.scala:311)
at sbt.Scoped$Reduced$$anonfun$combine$1$$anonfun$apply$12.apply(Structure.scala:311)
at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:41)
at sbt.std.Transform$$anon$5.work(System.scala:71)
at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:232)
at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:232)
at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:18)
at sbt.Execute.work(Execute.scala:238)
at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:232)
at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:232)
at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:160)
at sbt.CompletionService$$anon$2.call(CompletionService.scala:30)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
at java.lang.Thread.run(Thread.java:695)
[error] (test:test) Tests unsuccessful>
can someone help me figure out what the problem is?
The key error message is at the top:
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [file:/Users/hsl/Documents/workspace/test_project/target/scala-2.10/classes/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/usr/local/play-2.1.0/repository/local/ch.qos.logback/logback-classic/1.0.7/jars/logback-classic.> jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/usr/local/play-2.1.0/repository/cache/org.apache.activemq/activemq-all/jars/activemq-all-5.9.0.> jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
That's interesting, it looks like you have put (some of) the source code for sl4j in your test project, so that Play is compiling it. This causes the problem you are experiencing.
Remove the source code for slf4j from your test project, and it should work.
By the way, you can still have the source accessible for reference - e.g. if you are using Eclipse you can attach corresponding source to a jar in your project. play "eclipse with-sources" will do that automatically, for dependencies that have correctly published their source jars to their Maven or Ivy repository.