Java.lang.ClassNotFoundException: org.eclipse.jetty.ServerJAVA

Программисты JAVA общаются здесь
Ответить
Anonymous
 Java.lang.ClassNotFoundException: org.eclipse.jetty.Server

Сообщение Anonymous »

Я пытаюсь запустить проект maven, когда я запускаю mvn install, все в порядке. Я добился успеха. Когда я попытался запустить проект, я получил следующее исключение:

Код: Выделить всё

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)
и когда я запустил mvn dependency:tree, я получил следующие результаты:

Код: Выделить всё

     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
а это мой файл pom.xml:

Код: Выделить всё

4.0.0
wbui
OSCARS WBUI


net.es.oscars
OSCARS
0.0.1-SNAPSHOT



9.3.0.M0





onejar-maven-plugin.googlecode.com
http://onejar-maven-plugin.googlecode.com/svn/mavenrepo






net.es.oscars
utils
${oscars.version}



javax.servlet
javax.servlet-api
3.1.0




net.es.oscars
oscars-war
${oscars.version}
war
provided



org.slf4j
slf4j-api
1.7.7


org.slf4j
slf4j-log4j12
1.7.7




org.eclipse.jetty
jetty-server
9.3.0.M0


org.eclipse.jetty
jetty-webapp
9.3.0.M0


org.eclipse.jetty
jetty-servlet
9.3.0.M0








org.apache.maven.plugins
maven-shade-plugin
2.3



package

shade


one-jar
true


*:*

META-INF/*.SF
META-INF/*.DSA
META-INF/*.RSA





org.apache.geronimo.specs:geronimo-servlet_2.5_spec
org.mortbay.jetty:servlet-api
javax.servlet:servlet-api





net.es.oscars.wbui.http.WebApp


META-INF/spring.handlers


META-INF/spring.schemas


META-INF/services/com.sun.tools.xjc.Plugin


META-INF/cxf/cxf.extension


META-INF/extensions.xml


META-INF/cxf/extensions.xml


META-INF/cxf/bus-extensions.txt


META-INF/cxf/bus-extensions.xml


META-INF/wsdl.plugin.xml


META-INF/tools.service.validator.xml


META-INF/tools-plugin.xml


META-INF/cxf/java2wsbeans.xml








org.apache.cxf
cxf-buildtools
2.2.12
jar
compile





org.apache.maven.plugins
maven-compiler-plugin

${java.version}
${java.version}




Код: Выделить всё

     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 > 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 && !warTempDir.equals("")){
webapp.setTempDirectory(new File(warTempDir));
}
server.setHandler(webapp);
server.start();
server.join();
}
}
Итак, есть идеи, как решить эту проблему !!!!


Подробнее здесь: https://stackoverflow.com/questions/371 ... tty-server
Ответить

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

Вернуться в «JAVA»