Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6792609
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T17:59:31+00:00 2026-05-26T17:59:31+00:00

I created a maven project and I have written for weeks an application and

  • 0

I created a maven project and I have written for weeks an application and want to run it in the end… But I can’t.

I get the following stacktrace when executing my .jar:

C:\Users\MyUser\.m2\repository\com\myCompany\MyApp\
0.0.1-SNAPSHOT> java -Dconfigfile=config.xml -jar MyApp-0.0.1-SNAPSHOT.jar
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/configuration/ConfigurationException
        at com.mycompany.connector.DBConnector.reloadDBSettings(DBConnector.java:23)
        at com.mycompany.connector.DBConnector.<clinit>(DBConnector.java:16)
        at com.mycompany.connector.DBConnectorFactory.createDBConnector(DBConnectorFactory.java:17)
        at com.mycompany.service.MyAppService.<clinit>(MyAppService.java:38)
        at com.mycompany.main.MyAppMain.init(MyAppMain.java:13)
        at com.mycompany.main.MyAppMain.main(MyAppMain.java:8)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.configuration.ConfigurationException
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        ... 6 more

org.apache.commons.configuration.ConfigurationException is imported to the class and I set up Maven to use it as dependency. What am I doing wrong?

BTW: this is my reloadDBSettings Method:

import java.io.FileNotFoundException;

import org.apache.commons.configuration.ConfigurationException;
import org.apache.commons.configuration.XMLConfiguration;

public final class ConfigurationHandler {

    private static XMLConfiguration config;
/**
     * to reload Configuration-File if necessary
     */
    public static void reloadConfig() throws FileNotFoundException {
            try {
                config = new XMLConfiguration(System.getProperty("configfile"));
            } catch (ConfigurationException e) {
                throw new FileNotFoundException("Es wurde keine Konfiguration geladen - Überprüfen Sie die Systemvariable 'configfile'(" + e.getMessage() + ")");
            }
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T17:59:31+00:00Added an answer on May 26, 2026 at 5:59 pm

    ClassNotFoundException means JVM cannot find the class in your classpath. This is different from NoClassDefFoundError which means the classes use by that class are not found (not the class itself).

    There are two ways to solve this problem:

    1. add all the dependent jar files to a folder, add that to JVM classpath and run your main class using:

      java -cp .\dependency\*;MyApp-0.0.1-SNAPSHOT.jar.jar com.myCompany.MyApp.Main

      and in order to get all the dependencies into a folder you can use maven dependencies plugin maven-dependency-plugin

    2. use maven assembly plugin maven-assembly-plugin. This plugin will bundle all the dependent jar files in to a signle jar file so you can execute it the same way you do. However, sometime this method does not work especially for a larger application that use a lot of libraries. The jars may conflict each other so you may need to resolve the dependencies yourself or use Tattletale maven plugin to solve it for you.

    Note: Tattletale is also good to solve conflict in the first case.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a Maven project and I want to add all Maven dependencies
Following this question (in short: I have created a web project with maven and
I have created a maven android project using this archetype . I want to
I have a maven project I created with spring roo . When I run
I have created a multi module maven project. Now I have shared the project
I have a maven project created with maven-archetype-webapp. As i use on Windows machine,
I have a problem setting up my maven j2me project that I created in
i have created a multi-module maven project and i am trying to write and
I have a maven project with the following packages (for illustration only): Root: src/main/java
I have a maven project with the following POM snippet: <modelVersion>4.0.0</modelVersion> <artifactId>Foo-Deploy</artifactId> <name>Foo-Deploy</name> <packaging>pom</packaging>

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.