`
dickyzhu
  • 浏览: 106655 次
  • 性别: 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小时,就是想不到这。

分享到:
评论

相关推荐

    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",...

    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 --------------------...

    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 ...

    Use Case Driven Object Modeling with UML_ Theory and Practice.pdf

    A Couple of Thoughts on Use Case Templates. . . . . . . . . . . . . . . . . . 74 Use Case or Algorithm?. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76 Use Case Modeling in...

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

    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.

    Administering VMware Site Recovery Manager 4.0.pdf

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

    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 ...

    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 ...

    Linux System Administrator Guide Version0.9

    The root filesystem.........................................................................................................................14 3.3. The/etc directory..................................

    Cocoa Fundamentals Guide

    Creating a Singleton Instance 104 Chapter 3 Adding Behavior to a Cocoa Program Starting Up 107 What Happens in the main Function 107 Using a Cocoa Framework 109 Kinds of Framework Classes 109 Cocoa ...

    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 ...

    微软内部资料-SQL性能优化2

    If you attempt to access a reserved address that has not yet been committed (backed by memory or disk) you will cause an access violation. Committed Memory Committed pages are those pages that when ...

    RadControls.for.ASP.NET2.Q1.2007.SP2.RadUpload.Net2.v2.3.2.0

    a highly efficient proprietary HttpModule, which enables uploading of files with size up to 2GB, while allocating a minimum amount of server memory. UI control for single- and multi-file uploads, ...

    IOS5 Programming Cookbook

    1.19 Determining Whether Instance or Class Methods are Available 71 1.20 Determining Whether a Class is Available at Run Time 74 1.21 Allocating and Making Use of Strings 75 1.22 Allocating and Making...

    Automatic Self-Allocating Threads on an SGI Challenge (10.1.1.37.3403)-计算机科学

    AUTOMATIC SELF-ALLOCATING THREADS (ASAT) ON ANSGI CHALLENGECharles Severance and Richard Enbody�Department of Computer ScienceMichigan State UniversityEast Lansing, MI 48824-1027crs@msu.edu, enbody@...

    Professional_Linux_Programming.pdf

    Allocating Memory 259 Locking considerations 267 Deferring work 275 Further Reading 283 Distributing Linux Kernel Modules 284 Going Upstream 284 Shipping Sources 284 Shipping Prebuilt Modules 284 ...

    glibc-2.23.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.

Global site tag (gtag.js) - Google Analytics