gpt4 book ai didi

java - ClassNotFoundException : javax. servlet.AsyncContext in Jetty hello world in eclipse

转载 作者:塔克拉玛干 更新时间:2023-11-03 04:04:13 24 4
gpt4 key购买 nike

我点击了链接 http://wiki.eclipse.org/Jetty/Tutorial/Jetty_HelloWorld教程(使用 Eclipse)。并查看了现有的 stackoverflow here

我正在使用聚合 jetty 8.0.0.jar 和 8.1.3.jar 以及 servlet-api-2.5.jar。我已将这 2 个 jar 添加到类路径中,还包括 slf4j-simple-1.6.4.jar。

我还在努力

`
2012-05-23 15:23:06.813:WARN:oeji.nio: java.lang.NoClassDefFoundError:javax/servlet/AsyncContext

at org.eclipse.jetty.server.HttpConnection.<init>(HttpConnection.java:155)
at org.eclipse.jetty.server.AsyncHttpConnection.<init>(AsyncHttpConnection.java:19)
at org.eclipse.jetty.server.nio.SelectChannelConnector$SelectChannelHttpConnection.<init>(SelectChannelConnector.java:309)
at org.eclipse.jetty.server.nio.SelectChannelConnector$SelectChannelHttpConnection.<init>(SelectChannelConnector.java:303)
at org.eclipse.jetty.server.nio.SelectChannelConnector.newConnection(SelectChannelConnector.java:286)
at org.eclipse.jetty.server.nio.SelectChannelConnector$ConnectorSelectorManager.newConnection(SelectChannelConnector.java:364)
at org.eclipse.jetty.io.nio.SelectChannelEndPoint.<init>(SelectChannelEndPoint.java:71)
at org.eclipse.jetty.server.nio.SelectChannelConnector.newEndPoint(SelectChannelConnector.java:274)
at org.eclipse.jetty.server.nio.SelectChannelConnector$ConnectorSelectorManager.newEndPoint(SelectChannelConnector.java:370)
at org.eclipse.jetty.io.nio.SelectorManager$SelectSet.createEndPoint(SelectorManager.java:938)
at org.eclipse.jetty.io.nio.SelectorManager$SelectSet.doSelect(SelectorManager.java:497)
at org.eclipse.jetty.io.nio.SelectorManager$1.run(SelectorManager.java:283)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:598)
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:533)
at java.lang.Thread.run(Thread.java:679)

Caused by:
java.lang.ClassNotFoundException: javax.servlet.AsyncContext
at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
at org.eclipse.jetty.server.HttpConnection.<init>(HttpConnection.java:155)
at org.eclipse.jetty.server.AsyncHttpConnection.<init>(AsyncHttpConnection.java:19)
at org.eclipse.jetty.server.nio.SelectChannelConnector$SelectChannelHttpConnection.<init>(SelectChannelConnector.java:309)
at org.eclipse.jetty.server.nio.SelectChannelConnector$SelectChannelHttpConnection.<init>(SelectChannelConnector.java:303)
at org.eclipse.jetty.server.nio.SelectChannelConnector.newConnection(SelectChannelConnector.java:286)
at org.eclipse.jetty.server.nio.SelectChannelConnector$ConnectorSelectorManager.newConnection(SelectChannelConnector.java:364)
at org.eclipse.jetty.io.nio.SelectChannelEndPoint.<init>(SelectChannelEndPoint.java:71)
at org.eclipse.jetty.server.nio.SelectChannelConnector.newEndPoint(SelectChannelConnector.java:274)
at org.eclipse.jetty.server.nio.SelectChannelConnector$ConnectorSelectorManager.newEndPoint(SelectChannelConnector.java:370)
at org.eclipse.jetty.io.nio.SelectorManager$SelectSet.createEndPoint(SelectorManager.java:938)
at org.eclipse.jetty.io.nio.SelectorManager$SelectSet.doSelect(SelectorManager.java:497)
at org.eclipse.jetty.io.nio.SelectorManager$1.run(SelectorManager.java:283)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:598)
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:533)
at java.lang.Thread.run(Thread.java:679)

`

有什么想法吗?

最佳答案

我认为您需要 servlet api 3,而不是 2.5。 AsyncContext在 Servlet 3.0 中引入,在 2.5 中不存在。

关于java - ClassNotFoundException : javax. servlet.AsyncContext in Jetty hello world in eclipse,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10715363/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com