Stack Exchange
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/ws/commons/serialize/DOMSerializer
I want to use xmlRpc in the simple project I have downloaded org-apache-xmlrpc.jar
This is part of my code
import java.util.*;

import org.apache.xmlrpc.webserver.WebServer;
import org.apache.xmlrpc.server.*;
public class Serveur {
    
    private static Vector<String> user = new Vector<String>();
    String msg_courant = null;
    
    public static void main (String [] args) {
        try { 
            System.out.println("Attempting to start XML-RPC Server...");
            
            WebServer server = new WebServer(9980);
            PropertyHandlerMapping handlerMapping = new PropertyHandlerMapping();
            handlerMapping.addHandler("sample", Serveur.class);
            XmlRpcServer xmlRpcServer = server.getXmlRpcServer();
            xmlRpcServer.setHandlerMapping(handlerMapping);

            XmlRpcServerConfigImpl serverConfig = (XmlRpcServerConfigImpl) xmlRpcServer.getConfig();
            serverConfig.setEnabledForExtensions(true);
            serverConfig.setContentLengthOptional(false);

            server.start();
        } catch (Exception exception) { System.err.println("JavaServer: " + exception); 
        }
    }

    public boolean subscribe(String pseudo) {
    ...
    }
    
    public String postMessage(String pseudo, String message) {
       ...
    }
    
    public String getMessage() {
        ...
    }
    
    public boolean unsubscribe(String pseudo) {
        ...
    }
}

This is how I run my program and it works without any problem

but when I try to execute the program

I have this error


Have you added the jar to your classpath?

yes sir i did that

help me to resolve this issue

That is the content of the lib folder of the package I downloaded (apache-xmlrpc-3.1.2-bin) from here:

DOMSerializer is part of the second JAR file that is probably missing on your classpath.
Note: javac is not for running the program, it just compiles the source code.

do you have the link so i can download the jar file

included in answer (click on: distribution directory and our archive or similar) - better include all the JARs from LIB folder

You've been missing ws-commons-util.jar. You can download it from the web. Try here.
