kapt: An exception occurred: java.lang.NoSuchMethodError: android.databinding.tool.store.ResourceBundle.<init>(Ljava/lang/String;Z)V - gradle

Complete log:
e: [kapt] An exception occurred: java.lang.NoSuchMethodError: android.databinding.tool.store.ResourceBundle.<init>(Ljava/lang/String;Z)V
at android.databinding.annotationprocessor.ProcessExpressions.onHandleStep(ProcessExpressions.java:75)
at android.databinding.annotationprocessor.ProcessDataBinding$ProcessingStep.runStep(ProcessDataBinding.java:246)
at android.databinding.annotationprocessor.ProcessDataBinding$ProcessingStep.access$000(ProcessDataBinding.java:231)
at android.databinding.annotationprocessor.ProcessDataBinding.doProcess(ProcessDataBinding.java:112)
at android.databinding.annotationprocessor.ProcessDataBinding.process(ProcessDataBinding.java:87)
at org.jetbrains.kotlin.kapt3.base.incremental.IncrementalProcessor.process(incrementalProcessors.kt)
at org.jetbrains.kotlin.kapt3.base.ProcessorWrapper.process(annotationProcessing.kt:147)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.callProcessor(JavacProcessingEnvironment.java:794)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs(JavacProcessingEnvironment.java:705)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.access$1800(JavacProcessingEnvironment.java:91)
at com.sun.tools.javac.processing.JavacProcessingEnvironment$Round.run(JavacProcessingEnvironment.java:1035)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(JavacProcessingEnvironment.java:1176)
at com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:1170)
at com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:1068)
at org.jetbrains.kotlin.kapt3.base.AnnotationProcessingKt.doAnnotationProcessing(annotationProcessing.kt:79)
at org.jetbrains.kotlin.kapt3.base.AnnotationProcessingKt.doAnnotationProcessing$default(annotationProcessing.kt:35)
at org.jetbrains.kotlin.kapt3.AbstractKapt3Extension.runAnnotationProcessing(Kapt3Extension.kt:224)
at org.jetbrains.kotlin.kapt3.AbstractKapt3Extension.analysisCompleted(Kapt3Extension.kt:187)
at org.jetbrains.kotlin.kapt3.ClasspathBasedKapt3Extension.analysisCompleted(Kapt3Extension.kt:98)
at org.jetbrains.kotlin.cli.jvm.compiler.TopDownAnalyzerFacadeForJVM$analyzeFilesWithJavaIntegration$2.invoke(TopDownAnalyzerFacadeForJVM.kt:97)
at org.jetbrains.kotlin.cli.jvm.compiler.TopDownAnalyzerFacadeForJVM.analyzeFilesWithJavaIntegration(TopDownAnalyzerFacadeForJVM.kt:107)
at org.jetbrains.kotlin.cli.jvm.compiler.TopDownAnalyzerFacadeForJVM.analyzeFilesWithJavaIntegration$default(TopDownAnalyzerFacadeForJVM.kt:82)
at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler$analyze$1.invoke(KotlinToJVMBytecodeCompiler.kt:557)
at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler$analyze$1.invoke(KotlinToJVMBytecodeCompiler.kt:82)
at org.jetbrains.kotlin.cli.common.messages.AnalyzerWithCompilerReport.analyzeAndReport(AnalyzerWithCompilerReport.kt:107)
at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.analyze(KotlinToJVMBytecodeCompiler.kt:548)
at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.compileModules$cli(KotlinToJVMBytecodeCompiler.kt:177)
at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:165)
at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:55)
at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:84)
at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:42)
at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:104)
at org.jetbrains.kotlin.daemon.CompileServiceImpl.compile(CompileServiceImpl.kt:1558)
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:498)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:357)
at sun.rmi.transport.Transport$1.run(Transport.java:200)
at sun.rmi.transport.Transport$1.run(Transport.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:196)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:573)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:834)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:688)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:687)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
e: [kapt] An exception occurred: java.lang.NoSuchMethodError: android.databinding.tool.store.ResourceBundle.<init>(Ljava/lang/String;Z)V
I got this problem with:
gradle plugin: com.android.tools.build:gradle:4.0.0-alpha08 (Android Studio 4.0 canary 8, gradle wrapper gradle-6.1-rc-2-all);
kotlin: org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.61;
data binding: androidx.databinding:compiler:3.2.0-alpha11;
kapt enabled.
And with these previous versions, it worked well:
gradle plugin: com.android.tools.build:gradle:4.0.0-alpha07 (Android Studio 4.0 canary 7, gradle wrapper gradle-6.1-milestone-2-all);
kotlin: org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.60-eap-25;
data binding: androidx.databinding:compiler:3.2.0-alpha11;
kapt enabled.
Could anyone help me to solve it without any downgrading the library versions?

I had to update classpath of
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.30"
to 1.4.30

It seems like that the duplicated implementation of databinding library causes this problem. Every thing works well after I removed androidx.databinding:compiler:3.2.0-alpha11.

Related

How to add external jar to nifi cluster?

I am trying to add an external JAR to my nifi cluster.
I am following the codes of this post: Nifi multipart form
The script body is exactly the same as the one in the post except that it is without Grab phrase.
I have downloaded the jars: httpcore-4.3.2 and httpmime-4.5.9.jar from maven repo and I have put them into local file system of the cluster.
Then I gave the location of these jars to the additional classpath of ExecuteGroovyScript.
However i have an error of "unable to resolve class ContentType".
It seems it never found the jar.
Someone helps please.
FYI: I am working on a cluster which I cannot add the external jars directly to /lib so i cannot use grab.
and here is the error from nifi-app.log of my local nifi:
2021-05-17 17:38:44,825 ERROR [Timer-Driven Process Thread-10] o.a.n.p.groovyx.ExecuteGroovyScript ExecuteGroovyScript[id=7a78065f-0179-1000-2e4b-daefbdcf006a] java.lang.NoClassDefFoundError: org/apache/http/HttpEntity: java.lang.NoClassDefFoundError: org/apache/http/HttpEntity
java.lang.NoClassDefFoundError: org/apache/http/HttpEntity
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at org.codehaus.groovy.runtime.callsite.CallSiteArray$1.run(CallSiteArray.java:68)
at org.codehaus.groovy.runtime.callsite.CallSiteArray$1.run(CallSiteArray.java:65)
at java.security.AccessController.doPrivileged(Native Method)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.createCallStaticSite(CallSiteArray.java:65)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.createCallSite(CallSiteArray.java:162)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:117)
at Scriptffffffffea61d3da$_run_closure1.doCall(Scriptffffffffea61d3da.groovy:10)
at sun.reflect.GeneratedMethodAccessor327.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:294)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1022)
at groovy.lang.Closure.call(Closure.java:414)
at org.apache.nifi.processors.groovyx.flow.GroovySessionFile$5.process(GroovySessionFile.java:176)
at org.apache.nifi.controller.repository.StandardProcessSession.write(StandardProcessSession.java:2923)
at org.apache.nifi.processors.groovyx.flow.ProcessSessionWrap.write(ProcessSessionWrap.java:823)
at org.apache.nifi.processors.groovyx.flow.SessionFile.write(SessionFile.java:93)
at org.apache.nifi.processors.groovyx.flow.GroovySessionFile.write(GroovySessionFile.java:174)
at org.apache.nifi.processors.groovyx.flow.GroovySessionFile$write.call(Unknown Source)
at Scriptffffffffea61d3da.run(Scriptffffffffea61d3da.groovy:9)
at org.apache.nifi.processors.groovyx.ExecuteGroovyScript.onTrigger(ExecuteGroovyScript.java:449)
at org.apache.nifi.processor.AbstractProcessor.onTrigger(AbstractProcessor.java:27)
at org.apache.nifi.controller.StandardProcessorNode.onTrigger(StandardProcessorNode.java:1162)
at org.apache.nifi.controller.tasks.ConnectableTask.invoke(ConnectableTask.java:205)
at org.apache.nifi.controller.scheduling.TimerDrivenSchedulingAgent$1.run(TimerDrivenSchedulingAgent.java:117)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.ClassNotFoundException: org.apache.http.HttpEntity
at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:355)
at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
... 38 common frames omitted
as i can see you have to include more libraries to use httpmime-4.5.9
org.apache.httpcomponents/httpmime/jars/httpmime-4.5.9.jar
org.apache.httpcomponents/httpclient/jars/httpclient-4.5.9.jar
org.apache.httpcomponents/httpcore/jars/httpcore-4.4.11.jar
commons-logging/commons-logging/jars/commons-logging-1.2.jar
commons-codec/commons-codec/jars/commons-codec-1.11.jar
you can run the following code in groovy console to determine all libraries required for one dependency:
#Grab(group='org.apache.httpcomponents', module='httpmime', version='4.5.9')
import groovy.grape.Grape
def grape = Grape.getInstance()
def r = grape.listDependencies(this.getClass().getClassLoader())
println grape.resolve(r[0]).join('\n')

Deploy with JRebel from IntellijIDEA

I am following a tutorial from the "Spring in Action" book (by Manning Pubblications).
I have a problem when I try to deploy a webApp (with springMVC) with JRebel.
[2016-04-04 11:00:28,040] Artifact WebAppSpring: Artifact is being deployed, please wait...
Connected to server
2016-04-04 11:00:28 JRebel: ERROR Class 'org.apache.catalina.startup.ContextConfig' could not be processed by org.zeroturnaround.javarebel.integration.catalina.ContextConfigCBP#java.net.URLClassLoader#1134affc: org.zeroturnaround.bundled.javassist.CannotCompileException: [source error] processAnnotationsUrl(java.net.URL,org.apache.tomcat.util.descriptor.web.WebXml,boolean) not found in org.apache.catalina.startup.ContextConfig
at org.zeroturnaround.bundled.javassist.CtNewMethod.make(JRebel:79)
at org.zeroturnaround.bundled.javassist.CtNewMethod.make(JRebel:45)
at org.zeroturnaround.bundled.javassist.CtMethod.make(JRebel:132)
at org.zeroturnaround.javarebel.integration.catalina.ContextConfigCBP.implementReloadingOnTomcat8(ContextConfigCBP.java:122)
at org.zeroturnaround.javarebel.integration.catalina.ContextConfigCBP.process(ContextConfigCBP.java:25)
at org.zeroturnaround.javarebel.integration.support.JavassistClassBytecodeProcessor.process(JRebel:117)
at com.zeroturnaround.javarebel.kh.a(JRebel:359)
at com.zeroturnaround.javarebel.kh.a(JRebel:348)
at com.zeroturnaround.javarebel.kh.a(JRebel:316)
at com.zeroturnaround.javarebel.SDKIntegrationImpl.runBytecodeProcessors(JRebel:132)
at com.zeroturnaround.javarebel.jP.transform(JRebel:57)
at java.lang.ClassLoader.defineClass(ClassLoader.java)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:462)
at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:431)
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.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:300)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)
at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1471)
at javax.management.remote.rmi.RMIConnectionImpl.access$300(RMIConnectionImpl.java:76)
at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1312)
at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1404)
at javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:832)
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 sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:323)
at sun.rmi.transport.Transport$1.run(Transport.java:200)
at sun.rmi.transport.Transport$1.run(Transport.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:196)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:568)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:826)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$256(TCPTransport.java:683)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:682)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: compile error: processAnnotationsUrl(java.net.URL,org.apache.tomcat.util.descriptor.web.WebXml,boolean) not found in org.apache.catalina.startup.ContextConfig
at org.zeroturnaround.bundled.javassist.compiler.TypeChecker.atMethodCallCore(JRebel:749)
at org.zeroturnaround.bundled.javassist.compiler.TypeChecker.atCallExpr(JRebel:695)
at org.zeroturnaround.bundled.javassist.compiler.JvstTypeChecker.atCallExpr(JRebel:157)
at org.zeroturnaround.bundled.javassist.compiler.ast.CallExpr.accept(JRebel:46)
at org.zeroturnaround.bundled.javassist.compiler.CodeGen.doTypeCheck(JRebel:242)
at org.zeroturnaround.bundled.javassist.compiler.CodeGen.atStmnt(JRebel:330)
at org.zeroturnaround.bundled.javassist.compiler.ast.Stmnt.accept(JRebel:50)
at org.zeroturnaround.bundled.javassist.compiler.CodeGen.atStmnt(JRebel:351)
at org.zeroturnaround.bundled.javassist.compiler.ast.Stmnt.accept(JRebel:50)
at org.zeroturnaround.bundled.javassist.compiler.CodeGen.atIfStmnt(JRebel:398)
at org.zeroturnaround.bundled.javassist.compiler.CodeGen.atStmnt(JRebel:355)
at org.zeroturnaround.bundled.javassist.compiler.ast.Stmnt.accept(JRebel:50)
at org.zeroturnaround.bundled.javassist.compiler.CodeGen.atStmnt(JRebel:351)
at org.zeroturnaround.bundled.javassist.compiler.ast.Stmnt.accept(JRebel:50)
at org.zeroturnaround.bundled.javassist.compiler.CodeGen.atIfStmnt(JRebel:398)
at org.zeroturnaround.bundled.javassist.compiler.CodeGen.atStmnt(JRebel:355)
at org.zeroturnaround.bundled.javassist.compiler.ast.Stmnt.accept(JRebel:50)
at org.zeroturnaround.bundled.javassist.compiler.CodeGen.atStmnt(JRebel:351)
at org.zeroturnaround.bundled.javassist.compiler.ast.Stmnt.accept(JRebel:50)
at org.zeroturnaround.bundled.javassist.compiler.CodeGen.atMethodBody(JRebel:292)
at org.zeroturnaround.bundled.javassist.compiler.CodeGen.atMethodDecl(JRebel:274)
at org.zeroturnaround.bundled.javassist.compiler.ast.MethodDecl.accept(JRebel:44)
at org.zeroturnaround.bundled.javassist.compiler.Javac.compileMethod(JRebel:169)
at org.zeroturnaround.bundled.javassist.compiler.Javac.compile(JRebel:95)
at org.zeroturnaround.bundled.javassist.CtNewMethod.make(JRebel:74)
... 51 more
2016-04-04 11:00:32 JRebel: Directory 'C:\Users\NINO\IdeaProjects\SpringInAction\out\production\SpringInAction' will be monitored for changes.
2016-04-04 11:00:32 JRebel: Directory 'C:\Users\NINO\IdeaProjects\SpringInAction\web' will be monitored for changes.
...
...
...
After this error, the deploy go fine.
But if I modify a static file (jsp for example) jrebel works fine...if I modify a java class, jrebel not works.
I don't know if is a problem relative to the error shown in console at deploy time.
In the past I userd Jrebel with eclipse with servlet (not spring) and it worked fine.
I use:
- IntellijIDEA 2016.1.1
- Java 1.8
- Spring 4.2.5
Can you help me???
Thanks
What version of tomcat are you using? 9.0.0 milestone? Grab JRebel 6.4.2 release from here and install the zip using the same instructions as for installing the nightly build at here, should fix the error.

javaFX sceneBuilder with IntelliJ

JavaFX Scene Builder is not integrating properly into IntelliJ IDE for me. I got it to work on my windows 7 computer but on my mac it is giving me problems. First when i specify the path of JavaFX scene builder to the /applications/scenbuilder/ it does not display the scene in the IDE. Second when scene builder stand alone launches and i make modifications to the .xml file in my intelliJ project, all the .xml generated is errored in red in IntelliJ with the "Cannot resolve symbol" error text displayed.
Is there a step I'm missing to implement scene builder in IntelliJ on mac. I am not sure why this isn't working. I have followed setup correctly. Has anyone else had this problem? The error displayed in intelliJ is "java.lang.reflect.InvocationTargetException"
Java.lang.reflect.InvocationTargetException
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.jetbrains.plugins.javaFX.sceneBuilder.SceneBuilderCreatorImpl.create(SceneBuilderCreatorImpl.java:35)
at org.jetbrains.plugins.javaFX.sceneBuilder.SceneBuilderEditor.addSceneBuilder(SceneBuilderEditor.java:204)
at org.jetbrains.plugins.javaFX.sceneBuilder.SceneBuilderEditor.updateState(SceneBuilderEditor.java:191)
at org.jetbrains.plugins.javaFX.sceneBuilder.SceneBuilderEditor.initSceneBuilder(SceneBuilderEditor.java:174)
at org.jetbrains.plugins.javaFX.sceneBuilder.SceneBuilderEditor.selectNotify(SceneBuilderEditor.java:252)
at com.intellij.openapi.fileEditor.impl.EditorComposite$1$1.run(EditorComposite.java:148)
at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:124)
at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:99)
at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:85)
at com.intellij.openapi.fileEditor.impl.EditorComposite$1.selectionChanged(EditorComposite.java:154)
at sun.reflect.GeneratedMethodAccessor34.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at com.intellij.util.messages.impl.MessageBusConnectionImpl.deliverMessage(MessageBusConnectionImpl.java:116)
at com.intellij.util.messages.impl.MessageBusImpl.doPumpMessages(MessageBusImpl.java:368)
at com.intellij.util.messages.impl.MessageBusImpl.pumpMessages(MessageBusImpl.java:355)
at com.intellij.util.messages.impl.MessageBusImpl.pumpMessages(MessageBusImpl.java:341)
at com.intellij.util.messages.impl.MessageBusImpl.sendMessage(MessageBusImpl.java:334)
at com.intellij.util.messages.impl.MessageBusImpl.access$200(MessageBusImpl.java:42)
at com.intellij.util.messages.impl.MessageBusImpl$2.invoke(MessageBusImpl.java:223)
at com.sun.proxy.$Proxy81.selectionChanged(Unknown Source)
at com.intellij.openapi.fileEditor.impl.EditorComposite$3.run(EditorComposite.java:229)
at com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl$15$1.run(FileEditorManagerImpl.java:1055)
at com.intellij.openapi.wm.impl.FocusManagerImpl.a(FocusManagerImpl.java:672)
at com.intellij.openapi.wm.impl.FocusManagerImpl.d(FocusManagerImpl.java:656)
at com.intellij.openapi.wm.impl.FocusManagerImpl.f(FocusManagerImpl.java:626)
at com.intellij.openapi.wm.impl.FocusManagerImpl.access$200(FocusManagerImpl.java:60)
at com.intellij.openapi.wm.impl.FocusManagerImpl$11.run(FocusManagerImpl.java:522)
at com.intellij.util.ui.UIUtil.invokeLaterIfNeeded(UIUtil.java:2361)
at com.intellij.openapi.wm.impl.FocusManagerImpl.doWhenFocusSettlesDown(FocusManagerImpl.java:500)
at com.intellij.openapi.wm.impl.FocusManagerImpl.doWhenFocusSettlesDown(FocusManagerImpl.java:495)
at com.intellij.openapi.wm.impl.IdeFocusManagerImpl.doWhenFocusSettlesDown(IdeFocusManagerImpl.java:64)
at com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl$15.run(FileEditorManagerImpl.java:1052)
at com.intellij.openapi.util.BusyObject$Impl$Simple.execute(BusyObject.java:123)
at com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl.notifyPublisher(FileEditorManagerImpl.java:1048)
at com.intellij.openapi.fileEditor.impl.EditorComposite.a(EditorComposite.java:224)
at com.intellij.openapi.fileEditor.impl.EditorComposite.access$600(EditorComposite.java:67)
at com.intellij.openapi.fileEditor.impl.EditorComposite$MyChangeListener.stateChanged(EditorComposite.java:410)
at com.intellij.ui.JBTabsPaneImpl.a(JBTabsPaneImpl.java:81)
at com.intellij.ui.JBTabsPaneImpl.access$100(JBTabsPaneImpl.java:36)
at com.intellij.ui.JBTabsPaneImpl$2.selectionChanged(JBTabsPaneImpl.java:67)
at com.intellij.ui.tabs.impl.JBTabsImpl.fireSelectionChanged(JBTabsImpl.java:965)
at com.intellij.ui.tabs.impl.JBTabsImpl.executeSelectionChange(JBTabsImpl.java:918)
at com.intellij.ui.tabs.impl.JBTabsImpl._setSelected(JBTabsImpl.java:882)
at com.intellij.ui.tabs.impl.JBTabsImpl.select(JBTabsImpl.java:864)
at com.intellij.ui.tabs.impl.TabLabel$1.mousePressed(TabLabel.java:89)
at java.awt.Component.processMouseEvent(Component.java:6532)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
at java.awt.Component.processEvent(Component.java:6300)
at java.awt.Container.processEvent(Container.java:2236)
at java.awt.Component.dispatchEventImpl(Component.java:4891)
at java.awt.Container.dispatchEventImpl(Container.java:2294)
at java.awt.Component.dispatchEvent(Component.java:4713)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4888)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4522)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4466)
at java.awt.Container.dispatchEventImpl(Container.java:2280)
at java.awt.Window.dispatchEventImpl(Window.java:2750)
at java.awt.Component.dispatchEvent(Component.java:4713)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
at java.awt.EventQueue.access$500(EventQueue.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.awt.EventQueue$3.run(EventQueue.java:703)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
at java.awt.EventQueue$4.run(EventQueue.java:731)
at java.awt.EventQueue$4.run(EventQueue.java:729)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
at com.intellij.ide.IdeEventQueue.c(IdeEventQueue.java:866)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:650)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:381)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
Caused by: java.lang.NoClassDefFoundError: javafx/fxml/FXMLLoader
at org.jetbrains.plugins.javaFX.sceneBuilder.SceneBuilderKitWrapper.create(SceneBuilderKitWrapper.java:19)
... 84 more
I had the same problem (still do, because I didn't have time to try to fix it yet), but this is what the support answered me:
Please see https://youtrack.jetbrains.com/issue/IDEA-145806 . When
running on the bundled Java, it will not work since our bundle doesn't
include JavaFX classes, it will be fixed in the future updates. You
can try running under stock Oracle JDK as a workaround, see
https://intellij-support.jetbrains.com/hc/articles/206544879 for
details.

Gradle Plugin Spock Testing

I'm writing a plugin for Gradle 2.3 which includes Groovy 2.3.9, and I am attempting to test it using Spock 1.0-groovy-2.3. I'm getting the following error because Spock is trying to use Groovy 2.3.10.
The important bit.
groovy.lang.GroovyRuntimeException: Conflicting module versions. Module [groovy-all is loaded in version 2.3.9 and you are trying to load version 2.3.10
The "complete" stack trace.
Failed to instantiate spec 'PluginTest'
org.spockframework.util.InternalSpockError: Failed to instantiate spec 'PluginTest'
at org.spockframework.runtime.BaseSpecRunner.createSpecInstance(BaseSpecRunner.java:113)
at org.spockframework.runtime.BaseSpecRunner.run(BaseSpecRunner.java:65)
at org.spockframework.runtime.Sputnik.run(Sputnik.java:63)
at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecuter.runTestClass(JUnitTestClassExecuter.java:86)
at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecuter.execute(JUnitTestClassExecuter.java:49)
at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassProcessor.processTestClass(JUnitTestClassProcessor.java:64)
at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.processTestClass(SuiteTestClassProcessor.java:50)
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.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
at org.gradle.messaging.dispatch.ContextClassLoaderDispatch.dispatch(ContextClassLoaderDispatch.java:32)
at org.gradle.messaging.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93)
at com.sun.proxy.$Proxy2.processTestClass(Unknown Source)
at org.gradle.api.internal.tasks.testing.worker.TestWorker.processTestClass(TestWorker.java:106)
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.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
at org.gradle.messaging.remote.internal.hub.MessageHub$Handler.run(MessageHub.java:360)
at org.gradle.internal.concurrent.DefaultExecutorFactory$StoppableExecutorImpl$1.run(DefaultExecutorFactory.java:64)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ExceptionInInitializerError
at org.codehaus.groovy.reflection.ClassInfo.isValidWeakMetaClass(ClassInfo.java:221)
at org.codehaus.groovy.reflection.ClassInfo.getMetaClassForClass(ClassInfo.java:191)
at org.codehaus.groovy.reflection.ClassInfo.getMetaClass(ClassInfo.java:236)
at com.trxi.oracle.PluginTest.$getStaticMetaClass(PluginTest.groovy)
at com.trxi.oracle.PluginTest.<init>(PluginTest.groovy)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
at java.lang.Class.newInstance(Class.java:442)
at org.spockframework.runtime.BaseSpecRunner.createSpecInstance(BaseSpecRunner.java:107)
... 27 more
Caused by: groovy.lang.GroovyRuntimeException: Conflicting module versions. Module [groovy-all is loaded in version 2.3.9 and you are trying to load version 2.3.10
at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl$DefaultModuleListener.onModule(MetaClassRegistryImpl.java:509)
at org.codehaus.groovy.runtime.m12n.ExtensionModuleScanner.scanExtensionModuleFromProperties(ExtensionModuleScanner.java:77)
at org.codehaus.groovy.runtime.m12n.ExtensionModuleScanner.scanExtensionModuleFromMetaInf(ExtensionModuleScanner.java:71)
at org.codehaus.groovy.runtime.m12n.ExtensionModuleScanner.scanClasspathModules(ExtensionModuleScanner.java:53)
at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.<init>(MetaClassRegistryImpl.java:110)
at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.<init>(MetaClassRegistryImpl.java:71)
at groovy.lang.GroovySystem.<clinit>(GroovySystem.java:33)
... 38 more
The dependencies section of my build.gradle file.
dependencies {
compile gradleApi()
compile localGroovy()
testCompile "org.spockframework:spock-core:1.0-groovy-2.3"
}
Is there a way to configure gradleApi() to use Groovy 2.3.10 (or 2.4.3 for Spock 1.0-groovy-2.4) OR to configure Spock 1.0-groovy-2.3 to use Groovy 2.3.9?
you can exclude transitive dependencies brought in by spock to solve this version conflict. try:
dependencies {
compile gradleApi()
compile localGroovy()
testCompile ("org.spockframework:spock-core:1.0-groovy-2.3") {
exclude module: "groovy-all"
}
}

Maven dependency conflicts during test (surefire) but not production

I have an application which requires a couple different versions of the same libraries. When running through intellij this isn't a problem because it exports the classpath in a way that avoid the conflicts. I then use the maven shade plugin to create an uber-jar when compiling for production.
However when using the surefire plugin to run my unit tests the conflicts appear again. Does anyone know a way that I can ensure that the sure-fire plugin creates the class path in a way to avoid these conflicts?
Thanks!
UPDATE: Below is the error I am getting (Although it is fairly specific to my application). Basically there are two versions of Saxon HE and PE which are both being loaded. When running the surefire tests it causes this exception:
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.jorsek.appserver.bootstrap.Main.invokeMain(Main.java:130)
at com.jorsek.appserver.bootstrap.Main.run(Main.java:449)
at framework.TestUtils.startupDatabase(TestUtils.java:41)
at framework.AbstractTestInstance.startDatabase(AbstractTestInstance.java:41)
at framework.AbstractTestInstance.startDatabase(AbstractTestInstance.java:55)
at org.jorsek.exist.versioning.AllSetslTest.setUpBeforeClass(AllSetslTest.java:80)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:59)
at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:120)
at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:103)
at org.apache.maven.surefire.Surefire.run(Surefire.java:169)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:350)
at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1021)
Caused by: java.util.ServiceConfigurationError: javax.xml.transform.TransformerFactory: Provider com.saxonica.config.ProfessionalTransformerFactory could not be instantiated: java.lang.VerifyError: (class: com/saxonica/config/ProfessionalConfiguration, method: newExpressionParser signature: (Ljava/lang/String;ZLnet/sf/saxon/value/DecimalValue;)Lnet/sf/saxon/expr/ExpressionParser;) Wrong return type in function
at java.util.ServiceLoader.fail(ServiceLoader.java:207)
at java.util.ServiceLoader.access$100(ServiceLoader.java:164)
at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:360)
at java.util.ServiceLoader$1.next(ServiceLoader.java:428)
at org.exist.validation.XmlLibraryChecker.check(XmlLibraryChecker.java:162)
at com.jorsek.appserver.jetty.JettyStart.<init>(JettyStart.java:95)
at com.jorsek.appserver.jetty.JettyStart.main(JettyStart.java:77)
... 30 more
Caused by: java.lang.VerifyError: (class: com/saxonica/config/ProfessionalConfiguration, method: newExpressionParser signature: (Ljava/lang/String;ZLnet/sf/saxon/value/DecimalValue;)Lnet/sf/saxon/expr/ExpressionParser;) Wrong return type in function
at com.saxonica.config.ProfessionalTransformerFactory.<init>(ProfessionalTransformerFactory.java:24)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at java.lang.Class.newInstance0(Class.java:357)
at java.lang.Class.newInstance(Class.java:310)
at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:356)
... 34 more
Perhaps you can override the other dependency on test scope as well? Or if need be, just override them both on default scope. Or is there some reason why you cannot do either of the above?
Or an alternative of course is to start dabbling with the classloader during your test runs, like shown here.

Resources