Hi, I'v been trying to write a simple Java EE app, which deals with car renting. The entity beans and session beans are ready, so I've created a JSP for representation. It contains a single method, for init:

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">
<%@page import="javax.naming.*, business.*, entities.*" %>
<%!private UserSessionInterface user = null;
   public void jspInit() {
       try {
           InitialContext ic = new InitialContext();
           user = (UserSessionInterface)ic.lookup
                   (UserSessionInterface.class.getName());
       } catch (Exception e) {
           System.out.println("Exception error!");
       }
   }
   
   public void jspDestroy() {
       user = null;
   }
   %>

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <body>
        <h2>Hello World!</h2>

       </body>
</html>

My business package contains the interface UserSessionInterface, UserSessionBean and some other classes. When I'm trying to run the application, the following error apears (instead of hello world message):

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

PWC6197: An error occurred at line: 5 in the jsp file: /login.jsp
PWC6199: Generated servlet error:
string:///login_jsp.java:13: cannot find symbol
symbol : class UserSessionInterface
location: class org.apache.jsp.login_jsp

PWC6197: An error occurred at line: 5 in the jsp file: /login.jsp
PWC6199: Generated servlet error:
string:///login_jsp.java:17: cannot find symbol
symbol : class UserSessionInterface
location: class org.apache.jsp.login_jsp

PWC6197: An error occurred at line: 5 in the jsp file: /login.jsp
PWC6199: Generated servlet error:
string:///login_jsp.java:18: cannot find symbol
symbol : class UserSessionInterface
location: class org.apache.jsp.login_jsp


Please help me solve this.
Thanks in advance

Most likely cause of this is that the UserSessionInterface class is not available at runtime when you load the page.

Ensure that you have compiled the classes and they are somewhere on the app servers class path. Typically this would be in WEB-INF/classes if they are part of your app.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.