Java EE problem

Reply

Join Date: Jun 2007
Posts: 59
Reputation: Chaster is an unknown quantity at this point 
Solved Threads: 3
Chaster Chaster is offline Offline
Junior Poster in Training

Java EE problem

 
0
  #1
Nov 15th, 2008
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:
  1. <%@page contentType="text/html" pageEncoding="UTF-8"%>
  2. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
  3. "http://www.w3.org/TR/html4/loose.dtd">
  4. <%@page import="javax.naming.*, business.*, entities.*" %>
  5. <%!private UserSessionInterface user = null;
  6. public void jspInit() {
  7. try {
  8. InitialContext ic = new InitialContext();
  9. user = (UserSessionInterface)ic.lookup
  10. (UserSessionInterface.class.getName());
  11. } catch (Exception e) {
  12. System.out.println("Exception error!");
  13. }
  14. }
  15.  
  16. public void jspDestroy() {
  17. user = null;
  18. }
  19. %>
  20.  
  21. <html>
  22. <head>
  23. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  24. <title>JSP Page</title>
  25. </head>
  26. <body>
  27. <h2>Hello World!</h2>
  28.  
  29. </body>
  30. </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
Reply With Quote Quick reply to this message  
Join Date: Nov 2008
Posts: 3
Reputation: shurdsfield is an unknown quantity at this point 
Solved Threads: 1
shurdsfield shurdsfield is offline Offline
Newbie Poster

Re: Java EE problem

 
0
  #2
Nov 17th, 2008
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.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC