0

i have the following project structure:

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

when i try to put this project in tomcat webapp and try to execute index.jsp i get the error:

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

if I try to import any other class names that do not exist I get the exact same error.

this is my 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>

Any ideas ?

thanks!

ufk
  • 30,912
  • 70
  • 235
  • 386
  • Do you also have a package named `com.a.b`? – matt b Nov 23 '10 at 14:53
  • no i don't. that's the entire application. if i type to import foo.bar or any other name it provides this error. – ufk Nov 23 '10 at 15:02
  • it seems that the problem do not occur again. i'm trying to figure out what was changed. maybe tomcat do not work well with dynamic linked files. – ufk Nov 23 '10 at 15:21

1 Answers1

0

i used dynamic linked files, i resolved the issue by copying the classes to their appropriate place. it may relate to permissions issues i do not know. at least now i'm sure that this error related to no finding the class.

thanks for your assistance.

ufk
  • 30,912
  • 70
  • 235
  • 386