tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Henrique Faria" <hfa...@singularitysystems.com>
Subject Getting only Response 400 when implementing a new connector for Tomcat 5
Date Mon, 02 Aug 2004 20:30:05 GMT
I´ve been trying to write a Dummy Conector to Tomcat just to learn how I
must call an Adapter. It´s the first step to write a ISO-8583 connector.

For that, I instancialize an Request and Response (org.apache.coyote),
and set all attributes that I think to be necessary :

    request = new Request();
    response = new Response();
    ByteChunk inputChunk = new ByteChunk();
    InputBuffer inputBuffer = new ByteChunkInputBuffer(new ByteChunk());
    OutputBuffer outputBuffer = new ByteChunkOutputBuffer(new
ByteChunk());
    request.setInputBuffer(inputBuffer);
    response.setOutputBuffer(outputBuffer);

    // construct a fake request
    request.setResponse(response);
    request.setInputBuffer(inputBuffer);
    request.protocol().setString("HTTP/1.1");
    request.query().setString("");
    request.method().setString("GET");
    request.scheme().setString("http");
    request.serverName().setString("jlima-dsk1");
    request.requestURI().setString("/WebModule/servlet1");
    request.unparsedURI().setString("/WebModule/servlet1");
    request.queryString().setString("");
    request.setStartTime(System.currentTimeMillis());

After that, I try to invoke the container via an Adapter (
org.apache.coyote ), and finally I print the response.

adapter.service(request,response);

But what I got from the response is quit strange. I always get an 400
error, even when the host exist.

org.apache.coyote.Response.getMessage() = No Host matches server name
jlima-dsk1
org.apache.coyote.Response.getStatus() = 400

Do anybody know what I´m doing wrong ?

PS: I´m using J2SDK 1.4.2 and Tomcat 5.
 	 	

Henrique Faria	         Senior Consultant
Java Software Team	
tel: 	55.11.3285 4699	
cel: 	55.11.9811 8281	
fax:	55.11.3266 5121	
hfaria@singularitysystems.com	

Júlio Melhado Lima	   Senior Consultant
Java Software Team	
tel: 	55.11.3285 4699	
cel: 	55.11.9811 8281	
fax:	55.11.3266 5121	
jlima@singularitysystems.com	





---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Mime
View raw message