943,777 Members | Top Members by Rank

Ad:
  • JSP Discussion Thread
  • Unsolved
  • Views: 1500
  • JSP RSS
Nov 15th, 2008
0

Java EE problem

Expand Post »
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:
JSP Syntax (Toggle Plain Text)
  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
Similar Threads
Reputation Points: 12
Solved Threads: 3
Junior Poster in Training
Chaster is offline Offline
68 posts
since Jun 2007
Nov 17th, 2008
0

Re: Java EE problem

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.
Reputation Points: 10
Solved Threads: 1
Newbie Poster
shurdsfield is offline Offline
3 posts
since Nov 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in JSP Forum Timeline: Java web proxy server development
Next Thread in JSP Forum Timeline: how to get the id in an input element?





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC