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,
- How to Get List of All Country Codes in Java Using Locale Class
- Unsupported major.minor version 52.0 in java
- Java - How to set custom thread name?
- Get the current timestamp in Java
- Java Spring Boot 3 Web Hello World with Gradle in IntelliJ
- [fix] NullPointerException Cannot Invoke findById because Repository is null - Java Spring
- java: unclosed string literal [Error]
- Convert Java Byte Array to String with code examples
- Error: Can not find the tag library descriptor for
- Java 8 - Convert List to Map Examples
- Java - Calculate time taken for the code to execute in milliseconds or nanoseconds
- Fix java.net.ProtocolException: Invalid HTTP method
- Java: Convert Stream to List
- Java equals method - Tutorial
- List of Java JDBC Database Driver Jars, Classes and URLs Details
- Read YAML file Java Jackson Library
- How to display Java Date Time timezone GMT/UTC offset using SimpleDateFormat
- List of Java Keywords
- Enable JSON Pretty Print in Java Jackson
- How to Word-Warp Console logs in IntelliJ
- Convert Map to List in Java 8 using Stream API
- Create a Directory using Java Code
- Ways to Convert Integer or int to Long in Java
- [Program] How to read three different values using Scanner in Java
- Java JDBC Example with Oracle Database Driver Connection
More Posts:
- Git Rename master branch make to main using Command - Git
- Hide Navigation Bar from Android Screen Activity - Android
- say command macOS terminal examples - MacOS
- 10 FTP SFTP Clients and Alternatives - FTP
- SharePoint PowerShell PnP - How to get list item by Item ID using GetItemById, Get-PnPListItem - SharePoint
- Search text in Eclipse Console logs - Eclipse
- list of jars required for hibernate 4.x.x - Java
- How to upgrade PowerShell on Mac - Powershell