`
dickyzhu
  • 浏览: 111865 次
  • 性别: Icon_minigender_1
  • 来自: 武汉
文章分类
社区版块
存档分类
最新评论

tomcat:Error allocating a servlet instance --root cause: java.lang.NoClassDefFoundError

 
阅读更多

下午花了3小时来解决一个stupid问题:

tomcat自带的例子运行良好,我自己写的一个servlet无论如何就是报下面的错误:

Error allocating a servlet instance ...

--root cause: java.lang.NoClassDefFoundError...

网上找了很多帖子,说各种问题的都有,什么path ,classpath路径配置有错了,类名写错了,jdk版本不

对,web.xml没有配置,etc,看得头都大了,按他们说的一个个试,就是没效果,火大!

就是不怀疑自己的web.xml没有配置对!觉得自己就是没错,太想当然了!

我的目录结构如下:

webapps

|

beer-v1

| |

WEB-INF index.html

| |

classes web.xml

|

com

|

controller

|

SelectBeer.class (注意此处的类中要加入包名:package com.controller,如果不加,命令行编译 也通过,但就是在运行的时候也会出现上面的错误信息)

那么我在web.xml中<servlet-class>是com.controller.SelectBeer,而不是

com/controller/SelectBeer,就是这斜杠让我整整好了3小时,就是想不到这。

分享到:
评论

相关推荐

    Linux System Administrator Guide Version0.9

    - **Root Filesystem** (`/`): This is the top-level directory and contains everything else. - **Etc Directory** (`/etc`): Contains configuration files for various services and applications. - **Dev ...

    MS-DOS 5.0

    file from Disk 6 to your root directory. 2. Name the files DMDRVR.BIN and XBIOS.OVL. 3. Run Setup with the /u switch, as follows: setup /u 2.5 SpeedStor and Volume Expansion --------------------...

    hls.min.js

    var i={NETWORK_ERROR:"networkError",MEDIA_ERROR:"mediaError",MUX_ERROR:"muxError",OTHER_ERROR:"otherError"},a={MANIFEST_LOAD_ERROR:"manifestLoadError",MANIFEST_LOAD_TIMEOUT:"manifestLoadTimeOut",...

    Springer.The.Developer’s.Guide.to.Debugging.2008.pdf

    2.3.4 Read the Right Error Message . . . . . . 9 2.3.5 Check the Plug . . . . . . . . . 9 2.3.6 Separate Facts from Interpretation . . . . . 10 2.3.7 Divide and Conquer . . . . . . . . 10 2.3.8 Match ...

    gridengine-6.2u5-10.el6.4.x86_64

    Scheduler, queues and slots SGE includes both a scheduler for allocating resources (CPUs) to computational jobs and a queuing mechanism. Each queue is associated with a number of slots: one ...

    Keil+C编译器常见警告与错误信息的解决方法[归类].pdf

    * C51 FATAL-ERROR –ACTION &lt;current action&gt; LINE : &lt;line in which the error is detected&gt; ERROR : &lt;corresponding error message&gt; * C51 FATAL-ERROR –ACTION &lt;current action&gt; FILE : &lt;file in which the ...

    深入理解计算机系统(英文版)

    1.4.1 HardwareOrganization of aSystem . . . . . . . . . . . . . . . . . . . . . . . . . . 5 1.4.2 Running the helloProgram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 1.5 CachesMatter ...

    glibc-2.28.tar.gz

    This library provides the basic routines for allocating memory, searching directories, opening and closing files, reading and writing files, string handling, pattern matching, arithmetic, and so on.

    TMS320C6000 Assembly Language Tools User Guider

    - **Assembler**: Manages sections by allocating space for uninitialized data and storing initialized data. It also supports directives for defining named sections and subsections. - **Linker**: ...

    Draft P802.11ax_D6.0

    - **Improved Latency**: By allocating smaller chunks of bandwidth (subcarriers) to devices, OFDMA helps reduce latency, which is particularly beneficial for applications requiring real-time ...

    The Art of Assembly Language Programming

    Memory Layout and Access 4.0 - Chapter Overview 4.1 - The 80x86 CPUs:A Programmer's View 4.1.1 - 8086 General Purpose Registers 4.1.2 - 8086 Segment Registers 4.1.3 - 8086 Special ...

    Administering VMware Site Recovery Manager 4.0.pdf

    Adding ESX hosts & Allocating Volumes to Them .................................................... 78 Configuring the ESX Software iSCSI .................................................................

    vxbus_device_driver_developers_guide_6.9

    PART I: VXBUS FUNDAMENTALS 1 Getting Started with Device Driver Development .................................... 3 1.1 About Device Drivers ...............................................................

    DB2pureScale_Practical_Design_Guide_2016-Feb-5.pptx

    3-2 Allocating a portion of the LBP size to LOCKLIST 3-3 Avoid lock escalation with GLM Size 3-4 PAGE_AGE_TRGT_GCR – Improve Performance but also Increases Recovery time 3-5 Setting the correct ...

    electric-fence 源码

    electric fence是Linux下的C语言内存越界访问检测工具,可检测如下两种情况:1、内存访问越界 2、使用释放后续的内存 ...1、make编译得到libefence.a静态库 2、在gcc编译时增加 -L . -lefence的选项

    IOS5 Programming Cookbook

    Based on the provided information from "iOS 5 Programming Cookbook" by Vandad Nahavandipoor, we can derive a comprehensive set of knowledge points related to iOS development using Objective-C....

    iOS 4 Programming Cookbook

    4. **1.2 Allocating and Initializing Objects(分配和初始化对象)** - **知识点**: - 内存管理基础; - 使用`alloc`和`init`方法; - 初始化过程中的注意事项。 - **重要性**:正确的内存管理能够提高应用...

    iOS 6 Programming Cookbook.pdf

    - **1.1 创建一个简单的iOS应用 (Creating a Simple iOS App in Xcode)** - **内容概述**:本节介绍如何使用Xcode创建一个新的iOS项目,并构建一个基本的应用程序界面。 - **关键技术点**: - 使用Xcode新建项目...

    c++数据结构与算法实现

    Fig01_11.cpp: Dynamically allocating an IntCell object (lame) BuggyIntCell.cpp: Buggy IntCell class implementation (Figs 1.16 and 1.17) Fig01_18.cpp: IntCell class with pointers and Big Five ...

Global site tag (gtag.js) - Google Analytics