Question

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!

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top