ava.lang.ClassNotFoundException: org.apache.juli.logging.LogFactory - java

I dont know what to provide to solve this problem but here's the log.
Im running this on apache tomcat 10.0.6
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/juli/logging/LogFactory
at org.apache.catalina.util.LifecycleBase.(LifecycleBase.java:39)
Caused by: java.lang.ClassNotFoundException: org.apache.juli.logging.LogFactory
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:636)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:182)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:519)
... 1 more

Related

Disable org/springframework/core/KotlinDetector

I have a very simple spring boot project to consume from a kafak topic , but when i run i keep getting this error
Exception in thread "main" java.lang.IllegalArgumentException: Cannot instantiate interface org.springframework.context.ApplicationContextInitializer : org.springframework.boot.context.ConfigurationWarningsApplicationContextInitializer
at org.springframework.boot.SpringApplication.createSpringFactoriesInstances(SpringApplication.java:423)
at org.springframework.boot.SpringApplication.getSpringFactoriesInstances(SpringApplication.java:402)
at org.springframework.boot.SpringApplication.getSpringFactoriesInstances(SpringApplication.java:393)
at org.springframework.boot.SpringApplication.initialize(SpringApplication.java:260)
at org.springframework.boot.SpringApplication.<init>(SpringApplication.java:236)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1162)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1151)
at com.stellapps.test.ota.Test.main(Test.java:11)
Caused by: java.lang.NoClassDefFoundError: org/springframework/core/KotlinDetector
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:188)
at org.springframework.boot.SpringApplication.createSpringFactoriesInstances(SpringApplication.java:419)
... 7 more
Caused by: java.lang.ClassNotFoundException: org.springframework.core.KotlinDetector
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 9 more
Process finished with exit code 1
why is it even trying to dectect kotlin related file or classes when everything i have is in java , i want to disable this, how can i disable this??

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

java.lang.ClassNotFoundException: org.apache.hadoop.hive.service.HiveServerException

i have refer below link to connect hive through spring application.
http://noushinb.blogspot.in/2014/04/spring-hive.html
But got below exception.
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/hadoop/hive/service/HiveServerException
at org.springframework.data.hadoop.hive.HiveTemplate$1.doInHive(HiveTemplate.java:267)
at org.springframework.data.hadoop.hive.HiveTemplate$1.doInHive(HiveTemplate.java:264)
at org.springframework.data.hadoop.hive.HiveTemplate.execute(HiveTemplate.java:83)
at org.springframework.data.hadoop.hive.HiveTemplate.executeScript(HiveTemplate.java:264)
at org.springframework.data.hadoop.hive.HiveTemplate.executeScript(HiveTemplate.java:252)
at org.springframework.data.hadoop.hive.HiveTemplate.query(HiveTemplate.java:142)
at org.springframework.data.hadoop.hive.HiveTemplate.query(HiveTemplate.java:115)
at com.test.hive.repository.TestRepository.showTables(TestRepository.java:17)
at com.test.hive.service.CustomService.showTables(CustomService.java:19)
at com.test.hive.App.main(App.java:30)
Caused by: java.lang.ClassNotFoundException: org.apache.hadoop.hive.service.HiveServerException
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 10 more
How to solve this exception.Thanks for giving yours valuable time.

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/cli2/Option

Mr-Protocol:bin blossommendes$ `hadoop jar /Users/blossommendes/Desktop/Project/mahout-mrlegacy-1.0-SNAPSHOT.jar org.apache.mahout.cf.taste.hadoop.similarity.item.ItemSimilarityJob -Dmapred.input.dir=/xd/hdfsImport -Dmapred.output.dir=/xd/hdfsImport/postsResults --s SIMILARITY_LOGLIKELIHOOD --booleanData`
after executing above command i am getting following exception .. i dont why .. please help me to solve this issue
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/cli2/Option
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at org.apache.hadoop.util.RunJar.run(RunJar.java:214)
at org.apache.hadoop.util.RunJar.main(RunJar.java:136)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.cli2.Option
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 4 more
You are missing the org.apache.commons.cli2 Jar in your Classpath.

ActiveMQ: No suitable Log constructor

I'm trying to run ActiveMQ on Mac OSX 10.5.7. I have Java version 1.5.0_19 and ActiveMQ 5.2.0. Below is the exception I get when running bin/activemq. It seems to be unable to find Log4j which is odd considering it comes with ActiveMQ and is definitely in the lib/optional directory. The only thing I can think of is that I have a conflict somewhere, but I can't imagine how this is possible. If anyone has any tips whatsoever I'm all ears. Googling produced almost no results with the same error, and the one person who has the exact error doesn't have a solution.
brad-robertsons-macbook-pro:apache-activemq-5.2.0
bradrobertson$ ./bin/activemq
ACTIVEMQ_HOME: /Users/bradrobertson/Java/apache-activemq-5.2.0
ACTIVEMQ_BASE: /Users/bradrobertson/Java/apache-activemq-5.2.0
Loading message broker from: xbean:activemq.xml
ERROR: java.lang.RuntimeException: Failed to execute start task. Reason: java.io.IOException: Could not load xbean factory:java.lang.ExceptionInInitializerError java.lang.RuntimeException: Failed to execute start task. Reason: java.io.IOException: Could not load xbean factory:java.lang.ExceptionInInitializerError
at org.apache.activemq.console.command.StartCommand.runTask(StartCommand.java:98)
at org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:57)
at org.apache.activemq.console.command.ShellCommand.runTask(ShellCommand.java:129)
at org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:57)
at org.apache.activemq.console.command.ShellCommand.main(ShellCommand.java:79)
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:585)
at org.apache.activemq.console.Main.runTaskClass(Main.java:225)
at org.apache.activemq.console.Main.main(Main.java:106)
Caused by: java.io.IOException: Could not load xbean factory:java.lang.ExceptionInInitializerError
at org.apache.activemq.util.IOExceptionSupport.create(IOExceptionSupport.java:27)
at org.apache.activemq.broker.BrokerFactory.createBrokerFactoryHandler(BrokerFactory.java:43)
at org.apache.activemq.broker.BrokerFactory.createBroker(BrokerFactory.java:70)
at org.apache.activemq.broker.BrokerFactory.createBroker(BrokerFactory.java:54)
at org.apache.activemq.console.command.StartCommand.startBroker(StartCommand.java:115)
at org.apache.activemq.console.command.StartCommand.runTask(StartCommand.java:74)
... 10 more
Caused by: java.lang.ExceptionInInitializerError
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:494)
at java.lang.Class.newInstance0(Class.java:350)
at java.lang.Class.newInstance(Class.java:303)
at org.apache.activemq.util.FactoryFinder.newInstance(FactoryFinder.java:55)
at org.apache.activemq.util.FactoryFinder.newInstance(FactoryFinder.java:42)
at org.apache.activemq.broker.BrokerFactory.createBrokerFactoryHandler(BrokerFactory.java:41)
... 14 more
Caused by: org.apache.commons.logging.LogConfigurationException: org.apache.commons.logging.LogConfigurationException: No suitable Log constructor [Ljava.lang.Class;#abcc03 for org.apache.commons.logging.impl.Log4JLogger (Caused by java.lang.NoClassDefFoundError:org/apache/log4j/Category) (Caused by org.apache.commons.logging.LogConfigurationException: No suitable Log constructor [Ljava.lang.Class;#abcc03 for org.apache.commons.logging.impl.Log4JLogger (Caused by java.lang.NoClassDefFoundError: org/apache/log4j/Category))
at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:543)
at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:235)
at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:209)
at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:351)
at org.apache.activemq.xbean.XBeanBrokerFactory.<clinit(XBeanBrokerFactory.java:43)
... 23 more
Caused by: org.apache.commons.logging.LogConfigurationException: No suitable Log constructor [Ljava.lang.Class;#abcc03 for org.apache.commons.logging.impl.Log4JLogger (Caused by java.lang.NoClassDefFoundError: org/apache/log4j/Category)
at org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogFactoryImpl.java:413)
at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:529)
... 27 more
Caused by: java.lang.NoClassDefFoundError: org/apache/log4j/Category
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2357)
at java.lang.Class.getConstructor0(Class.java:2671)
at java.lang.Class.getConstructor(Class.java:1629)
at org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogFactoryImpl.java:410)
... 28 more
ERROR: java.lang.Exception: java.io.IOException: Could not load xbean factory:java.lang.ExceptionInInitializerError java.lang.Exception: java.io.IOException: Could not load xbean factory:java.lang.ExceptionInInitializerError
at org.apache.activemq.console.command.StartCommand.runTask(StartCommand.java:99)
at org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:57)
at org.apache.activemq.console.command.ShellCommand.runTask(ShellCommand.java:129)
at org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:57)
at org.apache.activemq.console.command.ShellCommand.main(ShellCommand.java:79)
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:585)
at org.apache.activemq.console.Main.runTaskClass(Main.java:225)
at org.apache.activemq.console.Main.main(Main.java:106)
Caused by: java.io.IOException: Could not load xbean factory:java.lang.ExceptionInInitializerError
at org.apache.activemq.util.IOExceptionSupport.create(IOExceptionSupport.java:27)
at org.apache.activemq.broker.BrokerFactory.createBrokerFactoryHandler(BrokerFactory.java:43)
at org.apache.activemq.broker.BrokerFactory.createBroker(BrokerFactory.java:70)
at org.apache.activemq.broker.BrokerFactory.createBroker(BrokerFactory.java:54)
at org.apache.activemq.console.command.StartCommand.startBroker(StartCommand.java:115)
at org.apache.activemq.console.command.StartCommand.runTask(StartCommand.java:74)
... 10 more
Caused by: java.lang.ExceptionInInitializerError
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:494)
at java.lang.Class.newInstance0(Class.java:350)
at java.lang.Class.newInstance(Class.java:303)
at org.apache.activemq.util.FactoryFinder.newInstance(FactoryFinder.java:55)
at org.apache.activemq.util.FactoryFinder.newInstance(FactoryFinder.java:42)
at org.apache.activemq.broker.BrokerFactory.createBrokerFactoryHandler(BrokerFactory.java:41)
... 14 more
Caused by: org.apache.commons.logging.LogConfigurationException: org.apache.commons.logging.LogConfigurationException: No suitable Log constructor [Ljava.lang.Class;#abcc03 for org.apache.commons.logging.impl.Log4JLogger (Caused by java.lang.NoClassDefFoundError: org/apache/log4j/Category) (Caused by org.apache.commons.logging.LogConfigurationException: No suitable Log constructor [Ljava.lang.Class;#abcc03 for org.apache.commons.logging.impl.Log4JLogger (Caused by java.lang.NoClassDefFoundError: org/apache/log4j/Category))
at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:543)
at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:235)
at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:209)
at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:351)
at org.apache.activemq.xbean.XBeanBrokerFactory.<clinit(XBeanBrokerFactory.java:43)
... 23 more
Caused by: org.apache.commons.logging.LogConfigurationException: No suitable Log constructor [Ljava.lang.Class;#abcc03 for org.apache.commons.logging.impl.Log4JLogger (Caused by java.lang.NoClassDefFoundError: org/apache/log4j/Category)
at org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogFactoryImpl.java:413)
at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:529)
... 27 more
Caused by: java.lang.NoClassDefFoundError: org/apache/log4j/Category
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2357)
at java.lang.Class.getConstructor0(Class.java:2671)
at java.lang.Class.getConstructor(Class.java:1629)
at org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogFactoryImpl.java:410)
... 28 more
So, it was definitely a conflict with another log4j jar file. I think it's probably my eclipse plugin log4j that was conflicting. When i delete the log4j from activemq lib/optional it works.
This looks like the exception is being caused by a NoClassDefFoundError for org.apache.log4j.Category. You should make sure that the log4j jar is on the classpath.
Edit: Is there any way that you can inspect the value of the ACTIVEMQ_CLASSPATH variable? If you're invoking this through a script that is setting the variable, you might need to dig into the script to make sure it's adding all the directories you think it is to the classpath.

Categories

Resources