`
WKsandy
  • 浏览: 149411 次
  • 性别: Icon_minigender_1
  • 来自: 常州
社区版块
存档分类
最新评论

Only a type can be imported

    博客分类:
  • java
阅读更多

TomExam_v2.1_UTF8访问jsp时报错:

org.apache.jasper.JasperException: Unable to compile class for JSP:

An error occurred at line: 8 in the generated java file
Only a type can be imported. com.tom.cache.ConfigCache resolves to a package

 

 

发现WEB-INF\classes下并没有类而是打tomexam.jar包放在了WEB-INF\lib下

 

解决办法:

在%CATALINA_HOME%\conf\server.xml的虚拟主机中通过Context子元素指定其Root Context所在位置:

 

<Host name="localhost"  appBase="webapps"
            unpackWARs="true" autoDeploy="true"
            xmlValidation="false" xmlNamespaceAware="false">
<Context path="/TomExam_v2.1_UTF8" docBase="D:\dev_tools\apache-tomcat-6.0.32\webapps\TomExam_v2.1_UTF8\WebRoot" reloadable="true" />
</Host>
 

只要加多个context就可以了,其中path为访问路径,docBase为项目文件根目录所在。这样应用的文件路径通过docBase来指定,这样就能在WEB-INF的lib载到包找到类了。

分享到:
评论

相关推荐

    javamail的jar包

    不导入mail.jar会发生 An error occurred at line: 6 in the generated java file Only a type can be imported. javax.mail.Session resolves to a package

    Some projects cannot be imported because they already exist in the workspace

    在使用Eclipse或MyEclipse等集成开发环境(IDE)时,可能会遇到“Some projects cannot be imported because they already exist in the workspace”的问题。这个错误提示表明,你试图导入的项目与当前工作空间...

    Code Warehouse Personal Edition v1.0

    A complete application or a class can be easily imported into Code Warehouse. Code stored in Code Warehouse can be searched by keywords, authors, dates, names of code units (application, class, or ...

    课程设计最终版matlab在单摆中的应用.doc

    Firstly, the data collected from the pendulum experiment, such as the angle of oscillation and corresponding time intervals, can be imported into MATLAB using built-in functions. Once the data is ...

    JSP Simple Examples

    and one of the feature of OOP in java is that, we can assign a subclass object or variable to the variable of the superclass type. Log files Log files keeps a records of internet protocol addresses...

    ExactAudioCopy_1.0_Beta1_XiaZaiBa.exe

    + New database engine for storing CD information (old databases can be imported) + Metadata plugin support, for now there is a freedb plugin included. This will be released as open source freeware ...

    DjVu的阅读软件!!!!!!!!!!

    Source images can be imported into DjVuer directly from a TWAIN scanner, or loaded from common file formats such as JPEG files and Windows bitmap files. These images can then be converted and saved as...

    语音识别系统C#实例

    A large number of Hypothesis events will be generated while only one Recognition and EndStream events will be associated with a particular recognition attempt. The sample provides a standard file ...

    StraceNT v0.8(strace on Windows)

    It can trace all the calls made by a process to the imported functions from a DLL. StraceNT can be very useful in debugging and analyzing the internal working of a program. StraceNT uses IAT patching...

    Strace for Windows

    It can trace all the calls made by a process to the imported functions from a DLL. StraceNT can be very useful in debugging and analyzing the internal working of a program. StraceNT uses IAT patching...

    A class to hook any imported function call made by your app

    在IT行业中,函数钩子(Hook)是一种技术,允许开发者拦截和处理系统或应用程序中的特定事件,例如函数调用。标题“一个类来挂钩你的应用所调用的任何导入函数”指的是创建了一个类,该类能够监控并控制应用程序中...

    Crystal Impact Match!2.1.3 试用延长

    In addition to this qualitative analysis, a quantitative analysis (using Rietveld refinement) can be performed as well. You can easily setup and run Rietveld refinements from within Match!, with the ...

    UnityShader使用Shader将图片进行水平/竖直镜像翻转

    Resource type: Unitypackage, can be imported and used immediately Content: Including shaders, materials, and sample scenes It is possible to autonomously mirror and flip graphics horizontally or ...

    DE2官方文件-DE2_synthesizer

    can be re-used. To perform a clean compilation from source files for all partitions, both the db and incremental_db folder should be removed. The imported_partitions sub-folder contains the last ...

    Android代码-DNSQuery

    This is a free tool provided for the Android mobile platform by Comwired.com to ...Everything should be included to be easily imported into the Eclipse IDE and has been developed to build on

    在excel中打印日历的vba宏。

    This is a piece of VBA Macro code can be imported into MS Excel, successfully running on Excel 2010.

    03Vuforia图片识别超详细案例(小岛动画交互)素材

    Vuforia Engine can be easily imported into Unity by downloading and double-clicking the .unitypackage below.Vuforia Engine is the most widely used platform for AR development, with support for the ...

    TX SDK 3.08.1.0

    Linestyles can be imported from Bentley® MicroStation® .dgn files into .dwg files. For more details, see Working with DGN Linestyles. Strikethrough text Multi-line text now supports strikethrough ...

    ST FOC电机控制开发包X-CUBE-MCSDK-FULL 6.1.0

    A new tool called Board Manager is provided to add ability to configure easily a Board description that can be then imported by the Workbench. The ST Motor Profiler tool is removed from the X-CUBE-...

    3DVIA Composer V6R2014

    Developed interactive documents can be stored in a compact executable EXE-files (for example, the volume of the original CAD model 50 MB, * .exe file 3DVia Composer - the result of converting this ...

Global site tag (gtag.js) - Google Analytics