`
WKsandy
  • 浏览: 147633 次
  • 性别: 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不允许我们导入。具体原因是在IDE的workspace中已经存在了相同名字的项目,所以不能导入。

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

    A class to hook any imported function call made by your app监视输入函数的类

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

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

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

    免费的汽车仿真开发环境 TSMaster V2021.8.3.600

    [10] New: calibration parameters can be imported from hex [11] New: buttons on quick customization bar on main ribbon [12] Bug fix: panel input-output box initial value is always n.a. [13] Bug fix: ...

    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.

    Imported dd.rar

    Imported dd.rar

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

    2008年6月大学英语六级A卷真题

    such as a kidney, the surgeon would contact a commercial organ producer, give him the patient’s immunological profile and would then be sent a kidney with the correct tissue type. These organs ...

Global site tag (gtag.js) - Google Analytics