I’m trying to deploy a Tomcat application by copying it to the webapps directory. My webapps directory looks like:
webapps/test
|_ index.jsp
|_ WEB-INF
|_ lib
|_ test.jar
The contents of index.jsp are:
<html>
Test App<br>
<%= com.stevekuo.Test.test() %>
</htm>
test.jar has the Test class with the static test() method that just returns a string.
When I access my app via http://tomcatserver:8080/test/, all I get is:
HTTP Status 500 -
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: Unable to compile class for JSP:
An error occurred at line: 3 in the jsp file: /index.jsp
com.stevekuo.Test cannot be resolved to a type
1: <html>
2: Test<br>
3: <%= com.stevekuo.Test.test() %>
4: </html>
I’ve also tried packaging the above directory structure into a WAR file and copying to webapps, but it still gives the same error.
I’m running standard out-of-the-box Tomcat 6 on Ubuntu 10.04. Tomcat came installed by Ubuntu. All files have -rw-r--r-- permissions, and directories are drwxr-xr-x. Why can’t Tomcat resolve the Test class located in WEB-INF/lib/test.jar?
Resolved. I added an empty
web.xmland it works.