2010-11-23 69 views
0

我有以下項目結構:java tomcat:只能導入一個類型。 com.aB解析爲一個包

./WEB-INF/web.xml 
./WEB-INF/lib 
./WEB-INF/classes/com/a/B.class 
./index.jsp 

當我試圖把這個項目的Tomcat Web應用程序,並試圖執行的index.jsp我得到的錯誤:

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

An error occurred at line: 6 in the generated java file 
Only a type can be imported. com.a.B resolves to a package 

如果我嘗試導入任何不存在的其他類名,我會得到完全相同的錯誤。

這是我的web.xml:

<?xml version="1.0" encoding="UTF-8"?> 
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"> 
<session-config> 
    <session-timeout> 
     30 
    </session-timeout> 
</session-config> 
<welcome-file-list> 
    <welcome-file>index_canvas.jsp</welcome-file> 
</welcome-file-list> 
<servlet> 
    <servlet-name>B</servlet-name> 
    <servlet-class>com.a.B</servlet-class> 
    </servlet> 
</web-app> 

任何想法?

謝謝!

+0

你還有一個名爲`com.a.b`的包嗎? – 2010-11-23 14:53:32

回答

0

我使用動態鏈接文件,我通過將類複製到適當的位置解決了問題。它可能與我不知道的權限問題有關。至少現在我確定這個錯誤與沒有找到該類相關。

感謝您的協助。

相關問題