我尝试在 android 上开发一个带有嵌入式码头的应用程序来运行一些 servlet。
我做了什么: - 导入 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]
谁能告诉我我做错了什么?