0

I am having problems running a JSP with a java class file on a Tomcat server.
My files are located at:
tomcat/webapps/ROOT/temp.jsp
tomcat/webapps/ROOT/WEB-INF/classes/tempbeans/TempBean.class

The contents of my JSP file:

<%@ page import="tempbeans.*" %> 

<% TempBean bean = new TempBean(); %>

The contents of my class file.
package tempbeans;

package tempbeans;
public class TempBean
{

    public TempBean()
    {
    }
}

When I attempt to go to temp.jsp I get the following Exception:

exception

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

An error occurred at line: 3 in the jsp file: /temp.jsp
TempBean cannot be resolved to a type
1: <%@ page import="tempbeans.*" %>
2:
3: <% TempBean bean = new TempBean(); %>


An error occurred at line: 3 in the jsp file: /temp.jsp
TempBean cannot be resolved to a type
1: <%@ page import="tempbeans.*" %>
2:
3: <% TempBean bean = new TempBean(); %>


Stacktrace:
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:97)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330)
org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:457)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:374)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:352)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:339)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:601)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:344)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:389)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:333)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)

The code runs on my local Eclipse set-up? Is there something wrong with my remote set-up?
Any help is greatly appreciated!!

2
Contributors
1
Reply
2
Views
6 Years
Discussion Span
Last Post by javaAddict
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.