title: java.lang.ClassNotFoundException: org.eclipse.jetty.Server
body: <p>I am trying to run a maven project when I run mvn install everything is ok I got build success qnd when I tried to lunch the project I got the following exception:</p>
  
  <pre><code>Exception in thread "main" java.lang.ClassNotFoundException: org.eclipse.jetty.Server
  at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
  at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
  at java.security.AccessController.doPrivileged(Native Method)
  at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
  at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
  at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
  at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
  at org.eclipse.jetty.util.Loader.loadClass(Loader.java:86)
  at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.nodeClass(XmlConfiguration.java:364)
  at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.configure(XmlConfiguration.java:292)
  at org.eclipse.jetty.xml.XmlConfiguration.configure(XmlConfiguration.java:248)
  at net.es.oscars.wbui.http.WebApp.main(WebApp.java:44)
  </code></pre>
  
  <p>and when I run mvn dependency:tree I got the following results:</p>
  
  <pre><code>     maven-dependency-plugin:2.8:tree (default-cli) @ wbui ---
       [INFO] net.es.oscars:wbui:jar:0.0.1-SNAPSHOT
       [INFO] +- net.es.oscars:utils:jar:0.0.1-SNAPSHOT:compile
       [INFO] |  +- net.perfsonar:ps-api:jar:0.5:compile
       [INFO] |  |  +- commons-httpclient:commonhttpclient:jar:3.0.1:compile
       [INFO] |  |  |  +- junit:junit:jar:3.8.1:compile
       [INFO] |  |  |  \- commons-codec:commons-codec:jar:1.2:compile
       [INFO] |  |  +- org.jdom:jdom:jar:1.1:compile
       [INFO] |  |  +- org.jdom:jaxen-jdom:jar:1.0-FCS:compile
       [INFO] |  |  +- org.jdom:jaxen-core:jar:1.0-FCS:compile
       [INFO] |  |  \- org.jdom:saxpath:jar:1.0-FCS:compile
       [INFO] |  +- org.jyaml:jyaml:jar:1.3:compile
       [INFO] |  +- log4j:log4j:jar:1.2.17:compile
       [INFO] |  +- net.es.oscars:common-logging:jar:0.0.1-SNAPSHOT:compile
       [INFO] |  |  \- gov.lbl:netlogger:jar:4.1.2:compile
       [INFO] |  +- net.es.oscars:common-soap:jar:0.0.1-SNAPSHOT:compile
       [INFO] |  +- org.hibernate:hibernate-core:jar:3.3.1.GA:compile
       [INFO] |  |  +- antlr:antlr:jar:2.7.6:compile
        [INFO] |  |  +- commons-collections:commons-collections:jar:3.1:compile
       [INFO] |  |  \- dom4j:dom4j:jar:1.6.1:compile
       [INFO] |  |     \- xml-apis:xml-apis:jar:1.0.b2:compile
       [INFO] |  +- org.mortbay.jetty:jetty:jar:6.1.16:compile
       [INFO] |  |  +- org.mortbay.jetty:jetty-util:jar:6.1.16:compile
       [INFO] |  |  \- org.mortbay.jetty:servlet-api:jar:2.5-20081211:compile
       [INFO] |  +- org.opensymphony.quartz:quartz:jar:1.6.1:compile
       [INFO] |  +- org.apache.ws.security:wss4j:jar:1.5.8:compile
       [INFO] |  |  +- commons-logging:commons-logging:jar:1.1:compile
       [INFO] |  |  |  +- logkit:logkit:jar:1.0.1:compile
       [INFO] |  |  |  +- avalon-framework:avalon-framework:jar:4.1.3:compile
       [INFO] |  |  |  \- javax.servlet:servlet-api:jar:2.3:compile
       [INFO] |  |  +- org.apache.santuario:xmlsec:jar:1.4.3:compile
       [INFO] |  |  \- xalan:xalan:jar:2.7.1:compile
      [INFO] |  |     \- xalan:serializer:jar:2.7.1:compile
      [INFO] |  +- org.apache.cxf:cxf-rt-bindings-soap:jar:2.2.5:compile
      [INFO] |  |  +- org.apache.cxf:cxf-api:jar:2.2.5:compile
       [INFO] |  |  |  +- org.apache.geronimo.specs:geronimo-activation_1.1_spec:jar:1.0.2:compile
      [INFO] |  |  |  +- org.apache.ws.commons.schema:XmlSchema:jar:1.4.5:compile
      [INFO] |  |  |  +- org.apache.geronimo.specs:geronimo-annotation_1.0_spec:jar:1.1.1:compile
      [INFO] |  |  |  +- org.codehaus.woodstox:wstx-asl:jar:3.2.9:compile
      [INFO] |  |  |  +- org.apache.neethi:neethi:jar:2.0.4:compile
      [INFO] |  |  |  \- org.apache.cxf:cxf-common-schemas:jar:2.2.5:compile
      [INFO] |  |  +- org.apache.cxf:cxf-tools-common:jar:2.2.5:compile
      [INFO] |  |  |  +- wsdl4j:wsdl4j:jar:1.6.2:compile
      [INFO] |  |  |  \- com.sun.xml.bind:jaxb-impl:jar:2.1.12:compile
      [INFO] |  |  +- org.apache.cxf:cxf-rt-databinding-jaxb:jar:2.2.5:compile
     [INFO] |  |  |  \- org.apache.geronimo.specs:geronimo-javamail_1.4_spec:jar:1.6:compile
      [INFO] |  |  \- javax.xml.bind:jaxb-api:jar:2.1:compile
      [INFO] |  +- org.apache.cxf:cxf-rt-ws-security:jar:2.2.5:compile
      [INFO] |  |  +- org.apache.cxf:cxf-rt-core:jar:2.2.5:compile
      [INFO] |  |  |  \- org.springframework:spring-core:jar:2.5.5:compile
      [INFO] |  |  +- org.apache.cxf:cxf-common-utilities:jar:2.2.5:compile
      [INFO] |  |  |  +- org.springframework:spring-beans:jar:2.5.5:compile
      [INFO] |  |  |  +- org.springframework:spring-context:jar:2.5.5:compile
      [INFO] |  |  |  |  \- aopalliance:aopalliance:jar:1.0:compile
      [INFO] |  |  |  +- org.apache.geronimo.specs:geronimo-stax-api_1.0_spec:jar:1.0.1:compile
      [INFO] |  |  |  \- commons-lang:commons-lang:jar:2.4:compile
      [INFO] |  |  +- javax.xml.soap:saaj-api:jar:1.3:compile
      [INFO] |  |  \- org.bouncycastle:bcprov-jdk15:jar:1.43:runtime
      [INFO] |  +- org.apache.cxf:cxf-rt-frontend-jaxws:jar:2.2.5:compile
      [INFO] |  |  +- xml-resolver:xml-resolver:jar:1.2:compile
      [INFO] |  |  +- org.apache.geronimo.specs:geronimo-jaxws_2.1_spec:jar:1.0:compile
      [INFO] |  |  +- org.apache.geronimo.specs:geronimo-ws-metadata_2.0_spec:jar:1.1.2:compile
      [INFO] |  |  +- asm:asm:jar:2.2.3:compile
      [INFO] |  |  +- org.apache.cxf:cxf-rt-bindings-xml:jar:2.2.5:compile
      [INFO] |  |  +- org.apache.cxf:cxf-rt-frontend-simple:jar:2.2.5:compile
      [INFO] |  |  +- org.apache.cxf:cxf-rt-ws-addr:jar:2.2.5:compile
      [INFO] |  |  \- com.sun.xml.messaging.saaj:saaj-impl:jar:1.3.2:compile
      [INFO] |  +- org.apache.cxf:cxf-rt-transports-http:jar:2.2.5:compile
      [INFO] |  |  \- org.springframework:spring-web:jar:2.5.5:compile
      [INFO] |  \- org.apache.cxf:cxf-rt-transports-http-jetty:jar:2.2.5:compile
      [INFO] |     \- org.apache.geronimo.specs:geronimo-servlet_2.5_spec:jar:1.2:compile
     [INFO] +- javax.servlet:javax.servlet-api:jar:3.1.0:compile
     [INFO] +- net.es.oscars:oscars-war:war:0.0.1-SNAPSHOT:provided
     [INFO] +- org.slf4j:slf4j-api:jar:1.7.7:compile
     [INFO] +- org.slf4j:slf4j-log4j12:jar:1.7.7:compile
     [INFO] +- org.eclipse.jetty:jetty-server:jar:9.3.0.M0:compile
     [INFO] |  +- org.eclipse.jetty:jetty-http:jar:9.3.0.M0:compile
     [INFO] |  |  \- org.eclipse.jetty:jetty-util:jar:9.3.0.M0:compile
     [INFO] |  \- org.eclipse.jetty:jetty-io:jar:9.3.0.M0:compile
     [INFO] +- org.eclipse.jetty:jetty-webapp:jar:9.3.0.M0:compile
     [INFO] |  \- org.eclipse.jetty:jetty-xml:jar:9.3.0.M0:compile
     [INFO] \- org.eclipse.jetty:jetty-servlet:jar:9.3.0.M0:compile
      [INFO]    \- org.eclipse.jetty:jetty-security:jar:9.3.0.M0:compile
     [INFO]   ------------------------------------------------------------------------
     [INFO] BUILD SUCCESS
  </code></pre>
  
  <p>and this is my pom.xml file :</p>
  
  <pre><code>&lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"&gt;
  &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  &lt;artifactId&gt;wbui&lt;/artifactId&gt;
  &lt;name&gt;OSCARS WBUI&lt;/name&gt;
  
  &lt;parent&gt;
      &lt;groupId&gt;net.es.oscars&lt;/groupId&gt;
      &lt;artifactId&gt;OSCARS&lt;/artifactId&gt;
      &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
  &lt;/parent&gt;
  
  &lt;properties&gt;
      &lt;jetty.version&gt;9.3.0.M0&lt;/jetty.version&gt;
  &lt;/properties&gt;
  
  
  &lt;!-- puts all code &amp; libraries in one jar --&gt;
  &lt;pluginRepositories&gt;
      &lt;pluginRepository&gt;
          &lt;id&gt;onejar-maven-plugin.googlecode.com&lt;/id&gt;
          &lt;url&gt;http://onejar-maven-plugin.googlecode.com/svn/mavenrepo&lt;/url&gt;
      &lt;/pluginRepository&gt;
  &lt;/pluginRepositories&gt;
  
  &lt;dependencies&gt;
      &lt;!-- OSCARS utilities (from local repository) --&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;net.es.oscars&lt;/groupId&gt;
          &lt;artifactId&gt;utils&lt;/artifactId&gt;
          &lt;version&gt;${oscars.version}&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;javax.servlet&lt;/groupId&gt;
          &lt;artifactId&gt;javax.servlet-api&lt;/artifactId&gt;
          &lt;version&gt;3.1.0&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;!-- kludge to get dependency on local module oscars-war without
           including war file --&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;net.es.oscars&lt;/groupId&gt;
          &lt;artifactId&gt;oscars-war&lt;/artifactId&gt;
          &lt;version&gt;${oscars.version}&lt;/version&gt;
          &lt;type&gt;war&lt;/type&gt;
          &lt;scope&gt;provided&lt;/scope&gt;
      &lt;/dependency&gt;
  
  
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.slf4j&lt;/groupId&gt;
          &lt;artifactId&gt;slf4j-api&lt;/artifactId&gt;
          &lt;version&gt;1.7.7&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.slf4j&lt;/groupId&gt;
          &lt;artifactId&gt;slf4j-log4j12&lt;/artifactId&gt;
          &lt;version&gt;1.7.7&lt;/version&gt;
      &lt;/dependency&gt;
  
  
  
      &lt;!--  Jetty --&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.eclipse.jetty&lt;/groupId&gt;
          &lt;artifactId&gt;jetty-server&lt;/artifactId&gt;
          &lt;version&gt;9.3.0.M0&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.eclipse.jetty&lt;/groupId&gt;
          &lt;artifactId&gt;jetty-webapp&lt;/artifactId&gt;
          &lt;version&gt;9.3.0.M0&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.eclipse.jetty&lt;/groupId&gt;
          &lt;artifactId&gt;jetty-servlet&lt;/artifactId&gt;
          &lt;version&gt;9.3.0.M0&lt;/version&gt;
      &lt;/dependency&gt;
  
  &lt;/dependencies&gt;
  &lt;build&gt;
      &lt;plugins&gt;
          &lt;!-- puts all code &amp; libraries in one jar --&gt;
  
          &lt;plugin&gt;
              &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
              &lt;artifactId&gt;maven-shade-plugin&lt;/artifactId&gt;
              &lt;version&gt;2.3&lt;/version&gt;
              &lt;executions&gt;
                  &lt;!-- Run shade goal on package phase --&gt;
                  &lt;execution&gt;
                      &lt;phase&gt;package&lt;/phase&gt;
                      &lt;goals&gt;
                          &lt;goal&gt;shade&lt;/goal&gt;
                      &lt;/goals&gt;
                      &lt;configuration&gt;
                          &lt;shadedClassifierName&gt;one-jar&lt;/shadedClassifierName&gt;
                          &lt;shadedArtifactAttached&gt;true&lt;/shadedArtifactAttached&gt;
                          &lt;filters&gt;
                              &lt;filter&gt;
                                  &lt;artifact&gt;*:*&lt;/artifact&gt;
                                  &lt;excludes&gt;
                                      &lt;exclude&gt;META-INF/*.SF&lt;/exclude&gt;
                                      &lt;exclude&gt;META-INF/*.DSA&lt;/exclude&gt;
                                      &lt;exclude&gt;META-INF/*.RSA&lt;/exclude&gt;
                                  &lt;/excludes&gt;
                              &lt;/filter&gt;
                          &lt;/filters&gt;
                          &lt;artifactSet&gt;
                              &lt;excludes&gt;
                                  &lt;exclude&gt;org.apache.geronimo.specs:geronimo-servlet_2.5_spec&lt;/exclude&gt;
                                  &lt;exclude&gt;org.mortbay.jetty:servlet-api&lt;/exclude&gt;
                                  &lt;exclude&gt;javax.servlet:servlet-api&lt;/exclude&gt;
                              &lt;/excludes&gt;
                          &lt;/artifactSet&gt;
                          &lt;transformers&gt;
                              &lt;!-- add Main-Class to manifest file --&gt;
                              &lt;transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"&gt;
                                  &lt;mainClass&gt;net.es.oscars.wbui.http.WebApp&lt;/mainClass&gt;
                              &lt;/transformer&gt;
                              &lt;transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"&gt;
                                  &lt;resource&gt;META-INF/spring.handlers&lt;/resource&gt;
                              &lt;/transformer&gt;
                              &lt;transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"&gt;
                                  &lt;resource&gt;META-INF/spring.schemas&lt;/resource&gt;
                              &lt;/transformer&gt;
                              &lt;transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"&gt;
                                  &lt;resource&gt;META-INF/services/com.sun.tools.xjc.Plugin&lt;/resource&gt;
                              &lt;/transformer&gt;
                              &lt;transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"&gt;
                                  &lt;resource&gt;META-INF/cxf/cxf.extension&lt;/resource&gt;
                              &lt;/transformer&gt;
                              &lt;transformer implementation="org.apache.maven.plugins.shade.resource.XmlAppendingTransformer"&gt;
                                  &lt;resource&gt;META-INF/extensions.xml&lt;/resource&gt;
                              &lt;/transformer&gt;
                              &lt;transformer implementation="org.apache.maven.plugins.shade.resource.XmlAppendingTransformer"&gt;
                                  &lt;resource&gt;META-INF/cxf/extensions.xml&lt;/resource&gt;
                              &lt;/transformer&gt;
                              &lt;transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"&gt;
                                  &lt;resource&gt;META-INF/cxf/bus-extensions.txt&lt;/resource&gt;
                              &lt;/transformer&gt;
                              &lt;transformer implementation="org.apache.maven.plugins.shade.resource.XmlAppendingTransformer"&gt;
                                  &lt;resource&gt;META-INF/cxf/bus-extensions.xml&lt;/resource&gt;
                              &lt;/transformer&gt;
                              &lt;transformer implementation="org.apache.maven.plugins.shade.resource.XmlAppendingTransformer"&gt;
                                  &lt;resource&gt;META-INF/wsdl.plugin.xml&lt;/resource&gt;
                              &lt;/transformer&gt;
                              &lt;transformer implementation="org.apache.maven.plugins.shade.resource.XmlAppendingTransformer"&gt;
                                  &lt;resource&gt;META-INF/tools.service.validator.xml&lt;/resource&gt;
                              &lt;/transformer&gt;
                              &lt;transformer implementation="org.apache.cxf.maven.PluginTransformer"&gt;
                                  &lt;resource&gt;META-INF/tools-plugin.xml&lt;/resource&gt;
                              &lt;/transformer&gt;
                              &lt;transformer implementation="org.apache.maven.plugins.shade.resource.XmlAppendingTransformer"&gt;
                                  &lt;resource&gt;META-INF/cxf/java2wsbeans.xml&lt;/resource&gt;
                              &lt;/transformer&gt;
                              &lt;transformer implementation="org.apache.cxf.maven.CXFAllTransformer" /&gt;
                          &lt;/transformers&gt;
                      &lt;/configuration&gt;
                  &lt;/execution&gt;
              &lt;/executions&gt;
              &lt;dependencies&gt;
                  &lt;dependency&gt;
                      &lt;groupId&gt;org.apache.cxf&lt;/groupId&gt;
                      &lt;artifactId&gt;cxf-buildtools&lt;/artifactId&gt;
                      &lt;version&gt;2.2.12&lt;/version&gt;
                      &lt;type&gt;jar&lt;/type&gt;
                      &lt;scope&gt;compile&lt;/scope&gt;
                  &lt;/dependency&gt;
              &lt;/dependencies&gt;
          &lt;/plugin&gt;
          &lt;!-- specifically use java 1.5 to compile --&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
              &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
              &lt;configuration&gt;
                  &lt;source&gt;${java.version}&lt;/source&gt;
                  &lt;target&gt;${java.version}&lt;/target&gt;
              &lt;/configuration&gt;
          &lt;/plugin&gt;
      &lt;/plugins&gt;
  &lt;/build&gt;
  </code></pre>
  
  <p>
  
  <pre><code>     package net.es.oscars.wbui.http;
  
     import java.util.Map;
     import java.io.File;
     import java.io.FileInputStream;
  
    import org.eclipse.jetty.server.Server;
    import org.eclipse.jetty.webapp.WebAppContext;
    import org.eclipse.jetty.xml.XmlConfiguration;
  
   import net.es.oscars.utils.config.*;
   import net.es.oscars.utils.svc.ServiceNames;
  
   public class WebApp {
  public static ContextConfig cc = null;
  
  public static void main(String[] args) throws Exception {
  
      cc = ContextConfig.getInstance(ServiceNames.SVC_WBUI);
      cc.setServiceName(ServiceNames.SVC_WBUI);
      String context = "PRODUCTION";
  
      if (args.length &gt; 0) {
          context = args[1];
      }
      String warFile = null;
      String warTempDir = null;
      Server server = new Server();
  
      cc.setContext(context);
      System.setProperty("context",context);
      System.out.println("starting WBUI with context "+ context);
      try {
          cc.loadManifest(ServiceNames.SVC_WBUI,  ConfigDefaults.MANIFEST); // manifest.yaml
          cc.setLog4j();
  
          String configFile = cc.getFilePath(ConfigDefaults.CONFIG);
          Map config = ConfigHelper.getConfiguration(configFile);
          Map http = (Map) config.get("http");
          warFile = (String) http.get("warFile");
          warTempDir = (String) http.get("warTempDir");
          String jettyConf = cc.getFilePath("jetty.xml");
          XmlConfiguration configuration = new XmlConfiguration(new FileInputStream(jettyConf));
          configuration.configure(server);
      } catch (ConfigException ex) {
          System.out.println("caught ConfigurationException " + ex.getMessage());
          System.exit(-1);
      }
      WebAppContext webapp = new WebAppContext();
      webapp.setContextPath("/OSCARS");
      webapp.setWar(warFile);
      if(warTempDir != null &amp;&amp; !warTempDir.equals("")){
          webapp.setTempDirectory(new File(warTempDir));
      }
      server.setHandler(webapp);
      server.start();
      server.join();
  }
   }
  </code></pre>
  
  <p>so any idea how to fix this problem !!!!</p>