嵌入式jetty“new Server(port)”抛出NoClassDefFoundError

时间:2013-05-15 16:06:22

标签: android jetty noclassdeffounderror

我尝试在Android上使用嵌入式jetty开发一个app来运行一些servlet。

我做了什么: -imported jetty-all-server-8.1.10.v20130312.jar并配置构建路径

在我的mainActivity中,我使用以下代码:

Server server = new Server(8080);
WebAppContext context = new WebAppContext();
context.setDescriptor(context+"/WEB-INF/web.xml");
context.setResourceBase(".");
context.setContextPath("/");
context.setParentLoaderPriority(true);

但是我的应用程序在第一行挂起了以下堆栈:

Thread [<1> main] (Suspended (exception NoClassDefFoundError))  
    <VM does not provide monitor information>   
    MainActivity.onCreate(Bundle) line: 175 
    MainActivity(Activity).performCreate(Bundle) line: 4465 
    Instrumentation.callActivityOnCreate(Activity, Bundle) line: 1049   
    ActivityThread.performLaunchActivity(ActivityThread$ActivityClientRecord, Intent) line: 2033    
    ActivityThread.handleLaunchActivity(ActivityThread$ActivityClientRecord, Intent) line: 2104 
    ActivityThread.access$600(ActivityThread, ActivityThread$ActivityClientRecord, Intent) line: 132    
    ActivityThread$H.handleMessage(Message) line: 1157  
    ActivityThread$H(Handler).dispatchMessage(Message) line: 99 
    Looper.loop() line: 137 
    ActivityThread.main(String[]) line: 4575    
    Method.invokeNative(Object, Object[], Class, Class[], Class, int, boolean) line: not available [native method]  
    Method.invoke(Object, Object...) line: 511  
    ZygoteInit$MethodAndArgsCaller.run() line: 789  
    ZygoteInit.main(String[]) line: 556 
    NativeStart.main(String[]) line: not available [native method]  

有谁能告诉我我做错了什么?

0 个答案:

没有答案