尝试访问servlet时获取NoClassDefFoundError

|| 当我尝试使用GET将一些数据发送到servlet时,出现此错误。我使用需要的netbeans(包括javax.servlet.jar)编译了servlet类,这可能与之有关。 错误:500 位置:/ myapp / firstCookieDemo 内部Servlet错误:
java.lang.NoClassDefFoundError: CookieServlet (wrong name: server/CookieServlet)
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:616)
    at org.apache.tomcat.util.depend.DependClassLoader12Impl.defineClassCompat(DependClassLoader12.java:141)
    at org.apache.tomcat.util.depend.DependClassLoader12Impl.loadClassInternal1(DependClassLoader12.java:233)
    at org.apache.tomcat.util.depend.DependClassLoader12Impl$1.run(DependClassLoader12.java:78)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.apache.tomcat.util.depend.DependClassLoader12Impl.loadClass(DependClassLoader12.java:76)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
    at org.apache.tomcat.facade.ServletHandler.getServlet(ServletHandler.java:307)
    at org.apache.tomcat.facade.ServletHandler.preInit(ServletHandler.java:378)
    at org.apache.tomcat.facade.ServletHandler.init(ServletHandler.java:192)
    at org.apache.tomcat.facade.ServletHandler.service(ServletHandler.java:423)
    at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:874)
    at org.apache.tomcat.core.ContextManager.service(ContextManager.java:790)
    at org.apache.coyote.tomcat3.Tomcat3Adapter.service(Tomcat3Adapter.java:64)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:793)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:702)
    at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:571)
    at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:644)
    at java.lang.Thread.run(Thread.java:662)
    
已邀请:

要回复问题请先登录注册