You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2002/09/09 16:46:58 UTC
DO NOT REPLY [Bug 12439] New: -
HttpConnector problem under jdk1.4.1-rc and catalina 4.04
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=12439>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND
INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=12439
HttpConnector problem under jdk1.4.1-rc and catalina 4.04
Summary: HttpConnector problem under jdk1.4.1-rc and catalina
4.04
Product: Tomcat 4
Version: 4.0.4 Final
Platform: Other
OS/Version: Windows NT/2K
Status: NEW
Severity: Normal
Priority: Other
Component: Catalina
AssignedTo: tomcat-dev@jakarta.apache.org
ReportedBy: nasser.matoorian@tvu.ac.uk
Hi Nasser Matoorian,
Thank you for using our bug submit page.
It looks like the error is being generated in third party software. See
the below link from the apache website:
http://jakarta.apache.org/tomcat/tomcat-4.0-doc/catalina/docs/api/org/apache/catalina/connector/http10/HttpConnector.html
Please redirect this request to the apache team at
http://jakarta.apache.org/site/bugs.html
Regards,
Nathanael
----------------- Original Bug Report-------------------
category : java
release : hopper-rc
subcategory : classes_net
type : bug
synopsis : HttpConnector[8080] No processor available, rejecting this connection
description : FULL PRODUCT VERSION :
J2SE :j2sdk1.4.1-rc
FULL OPERATING SYSTEM VERSION :
Window 2000 professional sp2
A DESCRIPTION OF THE PROBLEM :
HTTP comunication between applet and servlet, occurs
occasionally.
REGRESSION. Last worked in version 1.4
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1.we use the following java class for comunicating between
applet and servlet:
package jsystems.servlet;
import java.net.*;
import java.util.*;
import java.io.*;
public class HttpMessage {
URL servlet = null;
String args = null;
public HttpMessage(URL servlet) {
this.servlet = servlet;
}
public HttpMessage() {
}
//------------------------------------------------------------------------------
//Performs a GET request to the previously given servlet
//with no query string.
public InputStream sendGetMessage() throws IOException{
return sendGetMessage(null);
}
//------------------------------------------------------------------------------
//Performs a GET request to the previously given servlet.
//Builds a query string from the supplied Prperties list.
public InputStream sendGetMessage(Properties args) throws
IOException{
String argString = "";//default
if( args!= null){
argString = "?" + toEncodedString(args);
}
URL url = new URL(servlet.toExternalForm() + argString);
//trun off caching
URLConnection con = url.openConnection();
con.setUseCaches(false);
return con.getInputStream();
}
//------------------------------------------------------------------------------
//Performs a POST request to the previously given servlet
//with no query string.
public InputStream sendPostMessage() throws IOException{
return sendPostMessage(null);
}
//------------------------------------------------------------------------------
//Performs a POST request to the previously given servlet.
//Builds a query string from the supplied Prperties list.
public InputStream sendPostMessage(Properties args) throws
IOException{
String argString = "";//default
if( args!= null){
argString = toEncodedString(args); // notice no "?"
}
URL url = new URL(servlet.toExternalForm() + argString);
URLConnection con = url.openConnection();
//Prepare for both input and output
con.setDoInput(true);
con.setDoOutput(true);
//trun off caching
con.setUseCaches(false);
//Work round a netscape bug
con.setRequestProperty("Content-Type",
"application/x-www-form-urlencoded");
//Write the arguments as post data
DataOutputStream out = new
DataOutputStream(con.getOutputStream());
out.flush();
out.close();
return con.getInputStream();
}
//------------------------------------------------------------------------------
//Uploads a serialized object with a POST request.
//Sets the content type to java-internal/classname.
public InputStream sendPostMessage(Serializable obj)
throws IOException{
URLConnection con = servlet.openConnection();
//Prepare for both input and output
con.setDoInput(true);
con.setDoOutput(true);
//trun off caching
con.setUseCaches(false);
//Set the content type to be java-internal/classname
con.setRequestProperty("Content-Type", "java-internal/"
+ obj.getClass().getName());
//Write the serialized object as post data
ObjectOutputStream out = new
ObjectOutputStream(con.getOutputStream());
out.writeObject(obj);
out.flush();
out.close();
return con.getInputStream();
}
//------------------------------------------------------------------------------
//Converts a Properties list to a URL-encoded query string
private String toEncodedString(Properties args){
StringBuffer buff = new StringBuffer();
Enumeration names = args.propertyNames();
while (names.hasMoreElements()){
String name = (String) names.nextElement();
String value = args.getProperty(name);
buff.append(URLEncoder.encode(name) + "=" +
URLEncoder.encode(value));
if(names.hasMoreElements()) buff.append("&");
}
return buff.toString();
}
//------------------------------------------------------------------------------
}
2. The receiving servlet gets the serialized objects using
the following get / post :
public void doPost(HttpServletRequest request,
HttpServletResponse response)
throws ServletException,
IOException {
//doGet(request, response);
//response to indicate the result of the transaction
if(handler==null)handler=new AppointmentHandler();
ObjectOutputStream out = new
ObjectOutputStream(response.getOutputStream());
try{
//get data
ObjectInputStream in = new
ObjectInputStream(request.getInputStream());
HashMap hm = (HashMap)in.readObject();
//...
out.writeObject(new Integer(app_id));
}
}catch(Exception e){
out.writeObject(new Boolean(false));
e.printStackTrace();
}
}
3. the servlet end occasionaly refuses connection in
j2sdk1.4.1-rc:
HttpConnector[8080] No processor available, rejecting this
connection
EXPECTED VERSUS ACTUAL BEHAVIOR :
connection refused with a message:
HttpConnector[8080] No processor available, rejecting this
connection
ERROR MESSAGES/STACK TRACES THAT OCCUR :
HttpConnector[8080] No processor available, rejecting this connection
REPRODUCIBILITY :
This bug can be reproduced occasionally.
---------- BEGIN SOURCE ----------
Applet to Servlet communication.
Applet side:
package jsystems.servlet;
import java.net.*;
import java.util.*;
import java.io.*;
public class HttpMessage {
URL servlet = null;
String args = null;
public HttpMessage(URL servlet) {
this.servlet = servlet;
}
public HttpMessage() {
}
//------------------------------------------------------------------------------
//Performs a GET request to the previously given servlet
//with no query string.
public InputStream sendGetMessage() throws IOException{
return sendGetMessage(null);
}
//------------------------------------------------------------------------------
//Performs a GET request to the previously given servlet.
//Builds a query string from the supplied Prperties list.
public InputStream sendGetMessage(Properties args) throws IOException{
String argString = "";//default
if( args!= null){
argString = "?" + toEncodedString(args);
}
URL url = new URL(servlet.toExternalForm() + argString);
//trun off caching
URLConnection con = url.openConnection();
con.setUseCaches(false);
return con.getInputStream();
}
//------------------------------------------------------------------------------
//Performs a POST request to the previously given servlet
//with no query string.
public InputStream sendPostMessage() throws IOException{
return sendPostMessage(null);
}
//------------------------------------------------------------------------------
//Performs a POST request to the previously given servlet.
//Builds a query string from the supplied Prperties list.
public InputStream sendPostMessage(Properties args) throws IOException{
String argString = "";//default
if( args!= null){
argString = toEncodedString(args); // notice no "?"
}
URL url = new URL(servlet.toExternalForm() + argString);
URLConnection con = url.openConnection();
//Prepare for both input and output
con.setDoInput(true);
con.setDoOutput(true);
//trun off caching
con.setUseCaches(false);
//Work round a netscape bug
con.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
//Write the arguments as post data
DataOutputStream out = new DataOutputStream(con.getOutputStream());
out.flush();
out.close();
return con.getInputStream();
}
//------------------------------------------------------------------------------
//Uploads a serialized object with a POST request.
//Sets the content type to java-internal/classname.
public InputStream sendPostMessage(Serializable obj) throws IOException{
URLConnection con = servlet.openConnection();
//Prepare for both input and output
con.setDoInput(true);
con.setDoOutput(true);
//trun off caching
con.setUseCaches(false);
//Set the content type to be java-internal/classname
con.setRequestProperty("Content-Type", "java-internal/" +
obj.getClass().getName());
//Write the serialized object as post data
ObjectOutputStream out = new ObjectOutputStream(con.getOutputStream());
out.writeObject(obj);
out.flush();
out.close();
return con.getInputStream();
}
//------------------------------------------------------------------------------
//Converts a Properties list to a URL-encoded query string
private String toEncodedString(Properties args){
StringBuffer buff = new StringBuffer();
Enumeration names = args.propertyNames();
while (names.hasMoreElements()){
String name = (String) names.nextElement();
String value = args.getProperty(name);
buff.append(URLEncoder.encode(name) + "=" + URLEncoder.encode(value));
if(names.hasMoreElements()) buff.append("&");
}
return buff.toString();
}
//------------------------------------------------------------------------------
}
Servlet side method:
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
//doGet(request, response);
//response to indicate the result of the transaction
if(handler==null)handler=new AppointmentHandler();
ObjectOutputStream out = new ObjectOutputStream(response.getOutputStream());
try{
//get data
ObjectInputStream in = new
ObjectInputStream(request.getInputStream());
HashMap hm = (HashMap)in.readObject();
//...
out.writeObject(new Integer(app_id));
}
}catch(Exception e){
out.writeObject(new Boolean(false));
e.printStackTrace();
}
}
---------- END SOURCE ----------
CUSTOMER WORKAROUND :
use j2sdk1.4.0 instead of j2sdk1.4.1-rc
workaround :
suggested_val :
cust_name : Nasser Matoorian
cust_email : nasser.matoorian@tvu.ac.uk
jdcid :
keyword : webbug
company : Thames Valley University
hardware : x86
OSversion : windows_2000
bugtraqID : 0
dateCreated : 2002-09-02 03:48:32.7
dateEvaluated : 2002-09-03 16:17:51.58
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>