Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
at org.springframework.context.support.AbstractApplicationContext.<init>(AbstractApplicationContext.java:119)
at org.springframework.context.support.AbstractXmlApplicationContext.<init>(AbstractXmlApplicationContext.java:55)
....
at com.client.StoryReader.main(StoryReader.java:15)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.logging.LogFactory
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
....
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
... 6 more
If you receive the above NoClassDefFoundError -> ClassNotFoundException stack trace when you run your Java application that is using Apache commons-logging framework, for example commons-logging-1.1.2.jar then maybe you have missed adding this dependency in your pom.xml file,
Add the following dependency in your Maven pom.xml file,
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.2.0</version>
</dependency>
You can download the latest Apache common logging jar from their website: http://commons.apache.org/proper/commons-logging/download_logging.cgi
Adding this dependency will solve your problem!
ClassNotFoundException org.apache.commons.logging.LogFactory Java Exception
More Posts related to Java,
- [Fix] java.time.zone.ZoneRulesException: Unknown time-zone ID
- Parse XML file in Java using DOM Parser
- Java equals method - Tutorial
- [Program] How to read three different values using Scanner in Java
- Java: The value of the local variable string is not used
- Display Output in Java Console as a Table
- How to detect Operating System using Java code
- Java 8 Streams map() with examples
- [Fix] java: incompatible types: incompatible parameter types in lambda expression error
- Add newline character Java code example (\r \n \r\n)
- List of Java Major Minor Version Numbers
- IntelliJ Keyboard Shortcut to remove unused imports [Java]
- Java - Check if array contains the value
- [Fix] Java Exception with Lambda - Cannot invoke because object is null
- How to declare and initialize Array in Java Programming
- [Solved] com.sun.xml.ws.transport.http.servlet.WSServletContextListener ClassNotFoundException
- XmlRpcException ConnectException connection refused error
- Create a Zip file using Java Code programmatically
- List of jar files for Jax-ws (SOAP) based Java Web Services
- How to fix Java HTTP java.net.UnknownHostException
- List of jars required for Struts2 project
- [fix] java: incompatible types: double cannot be converted to java.lang.Integer Generics
- Maven BUILD FAILURE: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin
- Get the current timestamp in Java
- java: unclosed string literal [Error]
More Posts:
- Display Output in Java Console as a Table - Java
- Spotlight Search file path location on Mac OS X Mavericks or Yosemite - Mac-OS-X
- JDK Location in Android Studio - Android-Studio
- How to do calculations in Mac Terminal - MacOS
- How to make a dummy phone call from Android Emulator device - Android
- How to install Zsh shell - HowTos
- SharePoint Online REST API not returning all list items and limit to only 100 rows - SharePoint
- Add X days from today in Command Line - HowTos