This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JSP and the fly likes URGENT handler thread problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "URGENT handler thread problem" Watch "URGENT handler thread problem" New topic
Author

URGENT handler thread problem

vasudha prabhala
Greenhorn

Joined: Jan 07, 2003
Posts: 5
file name GetName.html
<html>
<body>
<FORM METHOD = POST ACTION = "SaveName.jsp">
what is your name?
<INPUT TYPE = TEXT NAME=username SIZE= 20>
<p><INPUT TYPE= SUBMIT>
</FORM>
</BODY>
</HTML>
file name SaveName.jsp
<%
String name = request.getParameter( "username" );
session.setAttribute( "theName", name );
%>
<HTML>
<BODY>
<A HREF="NextPage.jsp">Continue</A>
</BODY>
</HTML>
file name NextPage.jsp
<html>
<body>
Hello, <%=session.getAttribute("theName") %>
</body>
</html>
when I try to execute , SaveName.jsp is generating the following error message. what is the problem? I am using jswdk. please help. I have included tools.jar in classpath. what could be the problem?

Unhandled error! You might want to consider having an error page to report such
errors more gracefully
com.sun.jsp.JspException: Compilation failed:Note: sun.tools.javac.Main has been
deprecated.
work\%3A8080%2Fexamples\SaveName_jsp_1.java:71: Method setAttribute(java.lang.St
ring, java.lang.String) not found in interface javax.servlet.http.HttpSession.
session.setAttribute( "theName", name );
^
1 error, 1 warning
at com.sun.jsp.compiler.Main.compile(Main.java:347)
at com.sun.jsp.runtime.JspLoader.loadJSP(JspLoader.java:135)
at com.sun.jsp.runtime.JspServlet$JspServletWrapper.loadIfNecessary(JspS
ervlet.java:77)
at com.sun.jsp.runtime.JspServlet$JspServletWrapper.service(JspServlet.j
ava:87)
at com.sun.jsp.runtime.JspServlet.serviceJspFile(JspServlet.java:218)
at com.sun.jsp.runtime.JspServlet.service(JspServlet.java:294)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:840)
at com.sun.web.core.ServletWrapper.handleRequest(ServletWrapper.java:155
)
at com.sun.web.core.Context.handleRequest(Context.java:414)
at com.sun.web.server.ConnectionHandler.run(ConnectionHandler.java:139)
HANDLER THREAD PROBLEM: java.net.SocketException: Socket is closed
java.net.SocketException: Socket is closed
at java.net.Socket.getInputStream(Socket.java:643)
at com.sun.web.server.ConnectionHandler.run(ConnectionHandler.java:161)
Rahul Mahindrakar
Ranch Hand

Joined: Jul 28, 2000
Posts: 1844
Hi Vasudha,
Does the tools.jar file contain the HttpSession class. See which jar file contains this and put this in the classpath.
Varun Khanna
Ranch Hand

Joined: May 30, 2002
Posts: 1400
Originally posted by vasudha prabhala:
Unhandled error! You might want to consider having an error page to report such
errors more gracefully
com.sun.jsp.JspException: Compilation failed:Note: sun.tools.javac.Main has been
deprecated.

This warning is coming as you might be using Jdk 1.4 version.When executing the JSP for the first time, the engine will first convert the JSP into source code for a servlet and then, (if the engine is written for JDK 1.3), will use sun.tools.javac.Main in order to compile the generated servlet,but code.sun.tools.javac.Main has been deprecated in jdk1.4 so you will have to use appropriate servlet engine (for jdk1.4) or bring back the jdk1.3 version.
The error, again, seems to be due to some version mis-match as logic seems to be perfect.Try to checkout the javax.servlet.http.HttpSession.class from ur jar, though that is bit tedious, to see if it contains the method set/getAttribute.
-Varun
[ January 08, 2003: Message edited by: varun Khanna ]

- Varun
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: URGENT handler thread problem
 
Similar Threads
a session problem
problem with bean in tomcat
session.setAttribute() not working
HANDLER THREAD PROBLEM and unhandled error
use of value object ( javabeans )