Kotlin error Caused by: java.lang.ClassNotFoundException: kotlin.ranges.ClosedRange - java

Exception in thread "main" java.lang.NoClassDefFoundError: kotlin/ranges/ClosedRange
at java.base/java.lang.ClassLoader.defineClass1(Native Method)
at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1017)
at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:174)
at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:800)
at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:698)
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:621)
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:579)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
at kotlin.KotlinVersion.versionOf(KotlinVersion.kt:26)
at kotlin.KotlinVersion.(KotlinVersion.kt:23)
at kotlin.KotlinVersionCurrentValue.get(KotlinVersion.kt:82)
at kotlin.KotlinVersion.(KotlinVersion.kt:75)
at kotlin.reflect.jvm.internal.impl.load.java.JavaNullabilityAnnotationsStatus.(JavaNullabilityAnnotationsStatus.kt:10)
at kotlin.reflect.jvm.internal.impl.load.java.JavaNullabilityAnnotationsStatus.(JavaNullabilityAnnotationsStatus.kt:14)
at kotlin.reflect.jvm.internal.impl.load.java.JavaNullabilityAnnotationSettingsKt.(JavaNullabilityAnnotationSettings.kt:17)
at kotlin.reflect.jvm.internal.impl.load.java.JavaTypeEnhancementState.(JavaTypeEnhancementState.kt:17)
at kotlin.reflect.jvm.internal.impl.load.kotlin.DeserializationComponentsForJavaKt.makeLazyJavaPackageFragmentProvider(DeserializationComponentsForJava.kt:168)
at kotlin.reflect.jvm.internal.impl.load.kotlin.DeserializationComponentsForJavaKt.makeLazyJavaPackageFragmentProvider$default(DeserializationComponentsForJava.kt:151)
Caused by: java.lang.ClassNotFoundException: kotlin.ranges.ClosedRange

Related

java.lang.IncompatibleClassChangeError: class com.typesafe.scalalogging.BaseLogger can not implement com.typesafe.scalalogging.Logger

Error: java.lang.IncompatibleClassChangeError: class com.typesafe.scalalogging.BaseLogger can not implement com.typesafe.scalalogging.Logger**
I am configuring sink-influxDB. I was getting the error above.
I'm using kafka-connect-influxdb-1.2.0.jar. The other supported jars are
kcql-2.4.0.jar
influxdb-java-2.15.jar
scala-logging_2.11-3.9.0.jar
scala-logging-slf4j_2.11-2.1.2.jar
scala-logging-api_2.11-2.1.2.jar
com.typesafe.scalalogging.BaseLogger from scala-logging-api_2.11-2.1.2.jar implements com.typesafe.scalalogging.Logger
Here is the exception stack
ERROR Stopping due to error (org.apache.kafka.connect.cli.ConnectStandalone:130)
java.lang.IncompatibleClassChangeError: class com.typesafe.scalalogging.BaseLogger can not implement com.typesafe.scalalogging.Logger, because it is not an interface (com.typesafe.scalalogging.Logger is in unnamed module of loader 'app')
at java.base/java.lang.ClassLoader.defineClass1(Native Method)
at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1016)
at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:174)
at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:802)
at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:700)
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:623)
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
at java.base/java.lang.ClassLoader.defineClass1(Native Method)
at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1016)
at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:174)
at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:802)
at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:700)
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:623)
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
at java.base/java.lang.Class.getDeclaredConstructors0(Native Method)
at java.base/java.lang.Class.privateGetDeclaredConstructors(Class.java:3137)
at java.base/java.lang.Class.getConstructor0(Class.java:3342)
at java.base/java.lang.Class.newInstance(Class.java:556)
at org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader.versionFor(DelegatingClassLoader.java:380)
at org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader.getPluginDesc(DelegatingClassLoader.java:350)
at org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader.scanPluginPath(DelegatingClassLoader.java:330)
at org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader.scanUrlsAndAddPlugins(DelegatingClassLoader.java:263)
at org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader.initPluginLoader(DelegatingClassLoader.java:211)
at org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader.initLoaders(DelegatingClassLoader.java:204)
at org.apache.kafka.connect.runtime.isolation.Plugins.<init>(Plugins.java:60)
at org.apache.kafka.connect.cli.ConnectStandalone.main(ConnectStandalone.java:79)
I have replaced the kafka connect jar with kafka-connect-influxdb-2.0.0-2.4.0-all.jar and modified the worker properties to support a key of type String and value of type AVRO, as below
key.converter=org.apache.kafka.connect.storage.StringConverter
key.converter.schemas.enable=false
value.converter=io.confluent.connect.avro.AvroConverter
value.converter.schema.registry.url=http://localhost:8081
value.converter.schemas.enable=true
While starting the connector, the error below is thrown
INFO [Consumer clientId=connector-consumer-influxdb-sink-0, groupId=connect-influxdb-sink] Resetting offset for partition TEST-0 to offset 11. (org.apache.kafka.clients.consumer.internals.SubscriptionState:385)
[2020-05-06 04:09:11,490] ERROR WorkerSinkTask{id=influxdb-sink-0} Task threw an uncaught and unrecoverable exception. Task is being killed and will not recover until manually restarted. (org.apache.kafka.connect.runtime.WorkerSinkTask:559)
java.lang.IncompatibleClassChangeError: Class com.landoop.json.sql.JacksonJson$$anon$1 does not implement the requested interface com.fasterxml.jackson.module.scala.ScalaObjectMapper
at com.fasterxml.jackson.module.scala.ScalaObjectMapper.$init$(ScalaObjectMapper.scala:338)
at com.landoop.json.sql.JacksonJson$$anon$1.<init>(JacksonJson.scala:25)
at com.landoop.json.sql.JacksonJson$.<init>(JacksonJson.scala:25)
at com.landoop.json.sql.JacksonJson$.<clinit>(JacksonJson.scala)
at com.datamountaineer.streamreactor.connect.influx.converters.SinkRecordParser$.$anonfun$build$2(SinkRecordParser.scala:59)
at scala.util.Try$.apply(Try.scala:213)
at com.datamountaineer.streamreactor.connect.influx.converters.SinkRecordParser$.build(SinkRecordParser.scala:59)
at com.datamountaineer.streamreactor.connect.influx.writers.InfluxBatchPointsBuilder.$anonfun$build$1(InfluxBatchPointsBuilder.scala:90)
Try:
import com.typesafe.scalalogging.LazyLogging
instead of:
import com.typesafe.scalalogging.slf4j.LazyLogging
This should fix your below error:
class com.typesafe.scalalogging.BaseLogger can not implement com.typesafe.scalalogging.Logger, because it is not an interface

Exception during createing exe file

Im trying to convert my runnable jar into .exe file but i get this Exception in Launch4j program:
Executing: C:\Users\szymo\Desktop\SwordAndOgrs.exe
Exception in thread "main" java.lang.NoClassDefFoundError: javafx/application/Application
at java.base/java.lang.ClassLoader.defineClass1(Native Method)
at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1016)
at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:151)
at java.base/java.net.URLClassLoader.defineClass(URLClassLoader.java:515)
at java.base/java.net.URLClassLoader$1.run(URLClassLoader.java:423)
at java.base/java.net.URLClassLoader$1.run(URLClassLoader.java:417)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:691)
at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:416)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:588)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:416)
at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:59)
Caused by: java.lang.ClassNotFoundException: javafx.application.Application
at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:436)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:588)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
... 13 more
While im running code from Eclipse it works perfect. I already add javaFx SDK to buildPath.

Java exception when running wsimport.bat under openjdk-11

I downloaded wsimport and wanted to run it. However, when I run wsimport.bat I get an error message stating that classes could not be found. I use OpenJDK 11 on Windows 10.
Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/xml/bind/api/ErrorListener
at java.base/java.lang.ClassLoader.defineClass1(Native Method)
at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1016)
at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:174)
at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:802)
at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:700)
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:623)
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
at java.base/java.lang.ClassLoader.defineClass1(Native Method)
at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1016)
at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:174)
at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:802)
at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:700)
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:623)
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
at java.base/java.lang.Class.getDeclaredConstructors0(Native Method)
at java.base/java.lang.Class.privateGetDeclaredConstructors(Class.java:3138)
at java.base/java.lang.Class.getConstructor0(Class.java:3343)
at java.base/java.lang.Class.getConstructor(Class.java:2152)
at com.sun.tools.ws.Invoker.invoke(Invoker.java:150)
at com.sun.tools.ws.WsImport.main(WsImport.java:56)
Caused by: java.lang.ClassNotFoundException: com.sun.xml.bind.api.ErrorListener
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
... 24 more
What can I do to run wsimport.bat without errors?

Android Sdkmanager: Exception in thread "main" java.lang.NoClassDefFoundError:

Trying to use Android SDK 29 (javac 12.0.2) from command line I got this error:
Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema
at com.android.repository.api.SchemaModule$SchemaModuleVersion.<init>(SchemaModule.java:156)
at com.android.repository.api.SchemaModule.<init>(SchemaModule.java:75)
at com.android.sdklib.repository.AndroidSdkHandler.<clinit>(AndroidSdkHandler.java:81)
at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:73)
at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:48)
Caused by: java.lang.ClassNotFoundException: javax.xml.bind.annotation.XmlSchema
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
... 5 more

javafx JFoenix errors

I have meet errors when I run the demo. I use JDK 9.0.4 and jfornix-9.0.4. The Error occurs when instantiating an object,
for example:
JFXToggleButton toggleButton = new JFXToggleButton();.
The output as follows:
Exception in Application start method
java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:473)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:372)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at java.base/sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:945)
Caused by: java.lang.RuntimeException: Exception in Application start method
at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:973)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(LauncherImpl.java:198)
at java.base/java.lang.Thread.run(Thread.java:844)
Caused by: java.lang.NoClassDefFoundError: com/sun/javafx/css/StyleConverterImpl
at java.base/java.lang.ClassLoader.defineClass1(Native Method)
at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1007)
at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:174)
at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:801)
at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:699)
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:622)
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:580)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:185)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:496)
at com.jfoenix.controls.JFXToggleButton$StyleableProperties.<clinit>(JFXToggleButton.java:271)
at com.jfoenix.controls.JFXToggleButton.<init>(JFXToggleButton.java:123)
at demos.components.ToggleButtonDemo.start(ToggleButtonDemo.java:28)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(LauncherImpl.java:919)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runAndWait$11(PlatformImpl.java:449)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$9(PlatformImpl.java:418)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:417)
at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96)
at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:175)
... 1 more
Caused by: java.lang.ClassNotFoundException: com.sun.javafx.css.StyleConverterImpl
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:582)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:185)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:496)
... 21 more
Exception running application demos.components.ToggleButtonDemo
Process finished with exit code 1

Categories

Resources