You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Venkatesh Sangam <ve...@hotmail.com> on 2002/03/12 20:06:58 UTC

Connection refuse

Hi,

I am generating 5 requests per second on the tomcat server using the following program.

How will I know if the connection is refused by tomcat. If the server is overloaded with requests it starts refusing them. I have to capture this using my program below. can anybody please tell me how do I do it.

I am also not sure if the Threads that are refused connection are getting any response back ..
Please help
Thanks,
Venkatesh.


public class TestTomcat extends Thread{
 
 private static int request=0;

 public void run() {
  try{
  String inputLine;
  URL url = new URL("http://localhost:8080/examples/servlet/TestTomcat?request=" + ++request);
  URLConnection connection = url.openConnection();
  connection.setDoOutput(true);
  BufferedReader inp = new BufferedReader(
    new InputStreamReader(
    connection.getInputStream()));
  while ((inputLine = inp.readLine()) != null)
      System.out.println(inputLine);
     
   inp.close();
  }
  catch(Exception e){}
  }
 

    public static void main(String[] args) {

  int m=0;
 try{
  for (int p=0;p<100;p++){
   for(m=0;m<5;m++){
    TestTomcat rg= new TestTomcat();
    rg.start();
   }
   Thread.sleep(1000);
  }
 }
 catch(Exception e){}

 }

}



Multiple instancess of Tomcat on the same machine.

Posted by Venkatesh Sangam <ve...@hotmail.com>.
hi,

I am running an experimental setup for Load balaning on the webservers.
I am using Tomcat as the webserver.
For this experimental setup,I will be running multiple instances of Tomcat on the same machine(listening on differnt ports). I have multiple copies of Tomcat stored on the same machine. The default port is 8080. I will make the other instances of tomcat run on differnt ports.

Is this the only change required or do I have to make any other changes. As I was going thorugh the Server.xml file, I see different other ports specified like Port 8443, 8009(Ajp13Connector). I am using Non SSL Http.

Please advise.

Thanks,
Venkatesh.


Venkatesh Sangam,                                                                           
Research Assistant,                                                                            
Dept. of Computer Science,                                                               
Arizona State University
Home  Phone:(480)7369392
Work  Phone:(480)9651807
Lab   Phone:(480)9651207



RE: XML output, I need help.

Posted by Jim Urban <ji...@netsteps.net>.
Are you displaying raw XML, or does your XML reference a XSL stylesheet?  IE
is not current on XSL support and has problems processing XSL commands.

Jim

> -----Original Message-----
> From: David Smith [mailto:dns4@cornell.edu]
> Sent: Wednesday, March 13, 2002 8:22 AM
> To: Tomcat Users List
> Subject: Re: XML output, I need help.
>
>
> This sounds like IE's old ignore the mime type issue.  Does the
> requested URL
> end in .xml?  If not, IE may not recognize it as an xml file even with
> correct mime typing.
>
> Just a thought.
>
> --David
>
> On Tuesday 12 March 2002 09:35 pm, you wrote:
> > Hi, guys,
> >
> > I tried to write a XML format output using JSP, while I remember to set
> > contentType="text/xml" and write <?xml version="1.0" ?> in the head of
> > output. Then browsing my JSP in IE 5. What I saw is just text while is
> > outside of the tag, and the source is correct XML. How can I make IE
> > defaultly render XML?
> >
> > By the way, <mime-mapping> has been set for XML.
> >
> > Thanks in advance.
> >
> > Juguang.
>
> --
> To unsubscribe:   <ma...@jakarta.apache.org>
> For additional commands: <ma...@jakarta.apache.org>
> Troubles with the list: <ma...@jakarta.apache.org>
>
>


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: XML output, I need help.

Posted by David Smith <dn...@cornell.edu>.
This sounds like IE's old ignore the mime type issue.  Does the requested URL 
end in .xml?  If not, IE may not recognize it as an xml file even with 
correct mime typing.

Just a thought.

--David

On Tuesday 12 March 2002 09:35 pm, you wrote:
> Hi, guys,
>
> I tried to write a XML format output using JSP, while I remember to set
> contentType="text/xml" and write <?xml version="1.0" ?> in the head of
> output. Then browsing my JSP in IE 5. What I saw is just text while is
> outside of the tag, and the source is correct XML. How can I make IE
> defaultly render XML?
>
> By the way, <mime-mapping> has been set for XML.
>
> Thanks in advance.
>
> Juguang.

--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: XML output, I need help.

Posted by Neo Gigs <gi...@yahoo.com>.
Any error messages?

----- Original Message -----
From: "Xiao Juguang" <ju...@fugu-sg.org>
To: "Tomcat Users List" <to...@jakarta.apache.org>
Sent: Wednesday, March 13, 2002 7:00 PM
Subject: Re: XML output, I need help.


> yes, my code is correct.
>
> Richard's comment works. :)
>
> Just remind someone that clearing your cache or restarting Tomcat still
does
> great.
>
>
> ----- Original Message -----
> From: "Neo Gigs" <gi...@yahoo.com>
> To: "Tomcat Users List" <to...@jakarta.apache.org>
> Sent: Wednesday, March 13, 2002 11:38 AM
> Subject: Re: XML output, I need help.
>
>
> > Did ur JSP codes correct? Try to post the codes for debugging purposes?
> >
> > ----- Original Message -----
> > From: "Xiao Juguang" <ju...@fugu-sg.org>
> > To: "Tomcat Users List" <to...@jakarta.apache.org>
> > Sent: Wednesday, March 13, 2002 11:18 AM
> > Subject: Re: XML output, I need help.
> >
> >
> > > Let me clarify that I generate a XML, not HTML,  format output by JSP.
> > >
> > > IE should know the input is XML format, especially I specify the
> > > contentType.
> > >
> > > What is the problem? Is the problem on Tomcat side or IE side?
> > >
> > > ----- Original Message -----
> > > From: "Neo Gigs" <gi...@yahoo.com>
> > > To: "Tomcat Users List" <to...@jakarta.apache.org>
> > > Sent: Wednesday, March 13, 2002 10:50 AM
> > > Subject: Re: XML output, I need help.
> > >
> > >
> > > > You should only display a XMl file by not running the XMl file, you
> need
> > > > either a parser of some form of stylesheet like XSLT to embed the
> output
> > > >
> > > > ----- Original Message -----
> > > > From: "Xiao Juguang" <ju...@fugu-sg.org>
> > > > To: "Tomcat Users List" <to...@jakarta.apache.org>
> > > > Sent: Wednesday, March 13, 2002 10:35 AM
> > > > Subject: XML output, I need help.
> > > >
> > > >
> > > > > Hi, guys,
> > > > >
> > > > > I tried to write a XML format output using JSP, while I remember
to
> > set
> > > > > contentType="text/xml" and write <?xml version="1.0" ?> in the
head
> of
> > > > > output. Then browsing my JSP in IE 5. What I saw is just text
while
> is
> > > > > outside of the tag, and the source is correct XML. How can I make
IE
> > > > > defaultly render XML?
> > > > >
> > > > > By the way, <mime-mapping> has been set for XML.
> > > > >
> > > > > Thanks in advance.
> > > > >
> > > > > Juguang.
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > --
> > > > > To unsubscribe:
> <ma...@jakarta.apache.org>
> > > > > For additional commands:
> <ma...@jakarta.apache.org>
> > > > > Troubles with the list:
> <ma...@jakarta.apache.org>
> > > >
> > > >
> > > > _________________________________________________________
> > > > Do You Yahoo!?
> > > > Get your free @yahoo.com address at http://mail.yahoo.com
> > > >
> > > >
> > > > --
> > > > To unsubscribe:
<ma...@jakarta.apache.org>
> > > > For additional commands:
<ma...@jakarta.apache.org>
> > > > Troubles with the list:
<ma...@jakarta.apache.org>
> > > >
> > >
> > >
> > > --
> > > To unsubscribe:   <ma...@jakarta.apache.org>
> > > For additional commands: <ma...@jakarta.apache.org>
> > > Troubles with the list: <ma...@jakarta.apache.org>
> >
> >
> > _________________________________________________________
> > Do You Yahoo!?
> > Get your free @yahoo.com address at http://mail.yahoo.com
> >
> >
> > --
> > To unsubscribe:   <ma...@jakarta.apache.org>
> > For additional commands: <ma...@jakarta.apache.org>
> > Troubles with the list: <ma...@jakarta.apache.org>
> >
>
>
> --
> To unsubscribe:   <ma...@jakarta.apache.org>
> For additional commands: <ma...@jakarta.apache.org>
> Troubles with the list: <ma...@jakarta.apache.org>


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: XML output, I need help.

Posted by Xiao Juguang <ju...@fugu-sg.org>.
yes, my code is correct.

Richard's comment works. :)

Just remind someone that clearing your cache or restarting Tomcat still does
great.


----- Original Message -----
From: "Neo Gigs" <gi...@yahoo.com>
To: "Tomcat Users List" <to...@jakarta.apache.org>
Sent: Wednesday, March 13, 2002 11:38 AM
Subject: Re: XML output, I need help.


> Did ur JSP codes correct? Try to post the codes for debugging purposes?
>
> ----- Original Message -----
> From: "Xiao Juguang" <ju...@fugu-sg.org>
> To: "Tomcat Users List" <to...@jakarta.apache.org>
> Sent: Wednesday, March 13, 2002 11:18 AM
> Subject: Re: XML output, I need help.
>
>
> > Let me clarify that I generate a XML, not HTML,  format output by JSP.
> >
> > IE should know the input is XML format, especially I specify the
> > contentType.
> >
> > What is the problem? Is the problem on Tomcat side or IE side?
> >
> > ----- Original Message -----
> > From: "Neo Gigs" <gi...@yahoo.com>
> > To: "Tomcat Users List" <to...@jakarta.apache.org>
> > Sent: Wednesday, March 13, 2002 10:50 AM
> > Subject: Re: XML output, I need help.
> >
> >
> > > You should only display a XMl file by not running the XMl file, you
need
> > > either a parser of some form of stylesheet like XSLT to embed the
output
> > >
> > > ----- Original Message -----
> > > From: "Xiao Juguang" <ju...@fugu-sg.org>
> > > To: "Tomcat Users List" <to...@jakarta.apache.org>
> > > Sent: Wednesday, March 13, 2002 10:35 AM
> > > Subject: XML output, I need help.
> > >
> > >
> > > > Hi, guys,
> > > >
> > > > I tried to write a XML format output using JSP, while I remember to
> set
> > > > contentType="text/xml" and write <?xml version="1.0" ?> in the head
of
> > > > output. Then browsing my JSP in IE 5. What I saw is just text while
is
> > > > outside of the tag, and the source is correct XML. How can I make IE
> > > > defaultly render XML?
> > > >
> > > > By the way, <mime-mapping> has been set for XML.
> > > >
> > > > Thanks in advance.
> > > >
> > > > Juguang.
> > > >
> > > >
> > > >
> > > >
> > > > --
> > > > To unsubscribe:
<ma...@jakarta.apache.org>
> > > > For additional commands:
<ma...@jakarta.apache.org>
> > > > Troubles with the list:
<ma...@jakarta.apache.org>
> > >
> > >
> > > _________________________________________________________
> > > Do You Yahoo!?
> > > Get your free @yahoo.com address at http://mail.yahoo.com
> > >
> > >
> > > --
> > > To unsubscribe:   <ma...@jakarta.apache.org>
> > > For additional commands: <ma...@jakarta.apache.org>
> > > Troubles with the list: <ma...@jakarta.apache.org>
> > >
> >
> >
> > --
> > To unsubscribe:   <ma...@jakarta.apache.org>
> > For additional commands: <ma...@jakarta.apache.org>
> > Troubles with the list: <ma...@jakarta.apache.org>
>
>
> _________________________________________________________
> Do You Yahoo!?
> Get your free @yahoo.com address at http://mail.yahoo.com
>
>
> --
> To unsubscribe:   <ma...@jakarta.apache.org>
> For additional commands: <ma...@jakarta.apache.org>
> Troubles with the list: <ma...@jakarta.apache.org>
>


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: XML output, I need help.

Posted by Neo Gigs <gi...@yahoo.com>.
Did ur JSP codes correct? Try to post the codes for debugging purposes?

----- Original Message -----
From: "Xiao Juguang" <ju...@fugu-sg.org>
To: "Tomcat Users List" <to...@jakarta.apache.org>
Sent: Wednesday, March 13, 2002 11:18 AM
Subject: Re: XML output, I need help.


> Let me clarify that I generate a XML, not HTML,  format output by JSP.
>
> IE should know the input is XML format, especially I specify the
> contentType.
>
> What is the problem? Is the problem on Tomcat side or IE side?
>
> ----- Original Message -----
> From: "Neo Gigs" <gi...@yahoo.com>
> To: "Tomcat Users List" <to...@jakarta.apache.org>
> Sent: Wednesday, March 13, 2002 10:50 AM
> Subject: Re: XML output, I need help.
>
>
> > You should only display a XMl file by not running the XMl file, you need
> > either a parser of some form of stylesheet like XSLT to embed the output
> >
> > ----- Original Message -----
> > From: "Xiao Juguang" <ju...@fugu-sg.org>
> > To: "Tomcat Users List" <to...@jakarta.apache.org>
> > Sent: Wednesday, March 13, 2002 10:35 AM
> > Subject: XML output, I need help.
> >
> >
> > > Hi, guys,
> > >
> > > I tried to write a XML format output using JSP, while I remember to
set
> > > contentType="text/xml" and write <?xml version="1.0" ?> in the head of
> > > output. Then browsing my JSP in IE 5. What I saw is just text while is
> > > outside of the tag, and the source is correct XML. How can I make IE
> > > defaultly render XML?
> > >
> > > By the way, <mime-mapping> has been set for XML.
> > >
> > > Thanks in advance.
> > >
> > > Juguang.
> > >
> > >
> > >
> > >
> > > --
> > > To unsubscribe:   <ma...@jakarta.apache.org>
> > > For additional commands: <ma...@jakarta.apache.org>
> > > Troubles with the list: <ma...@jakarta.apache.org>
> >
> >
> > _________________________________________________________
> > Do You Yahoo!?
> > Get your free @yahoo.com address at http://mail.yahoo.com
> >
> >
> > --
> > To unsubscribe:   <ma...@jakarta.apache.org>
> > For additional commands: <ma...@jakarta.apache.org>
> > Troubles with the list: <ma...@jakarta.apache.org>
> >
>
>
> --
> To unsubscribe:   <ma...@jakarta.apache.org>
> For additional commands: <ma...@jakarta.apache.org>
> Troubles with the list: <ma...@jakarta.apache.org>


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: XML output, I need help.

Posted by Richard <Ri...@CreditDiscovery.com>.
IE has some interesting issues involving XML.. I have seen instances where you need to close out IE and re-open it to view your XML.. Clicking refresh while holding the shift key will also complete a refresh.. If that fails try taking your source saving it to file (locally) as source.xml or something and then try and open it.. if you still have issues start editing the local file until it displays properly.. Also try upgrading to IE 6.0.. in earlier versions of IE I would sometimes have problems displaying xml that while formed correctly had hidden characters which for one reason or another prevented IE from displaying the xml in the tree structure you are expecting... IE 6 seems to be a lot more forgiving in this respect.. hope that helps.. 
Richard Haag
Sr. Technical Specialist
Credit Discovery
1-877-789-4976 x8009
Richard@creditdiscovery.com
  ----- Original Message ----- 
  From: Xiao Juguang 
  To: Tomcat Users List 
  Sent: Tuesday, March 12, 2002 7:18 PM
  Subject: Re: XML output, I need help.


  Let me clarify that I generate a XML, not HTML,  format output by JSP.

  IE should know the input is XML format, especially I specify the
  contentType.

  What is the problem? Is the problem on Tomcat side or IE side?

  ----- Original Message -----
  From: "Neo Gigs" <gi...@yahoo.com>
  To: "Tomcat Users List" <to...@jakarta.apache.org>
  Sent: Wednesday, March 13, 2002 10:50 AM
  Subject: Re: XML output, I need help.


  > You should only display a XMl file by not running the XMl file, you need
  > either a parser of some form of stylesheet like XSLT to embed the output
  >
  > ----- Original Message -----
  > From: "Xiao Juguang" <ju...@fugu-sg.org>
  > To: "Tomcat Users List" <to...@jakarta.apache.org>
  > Sent: Wednesday, March 13, 2002 10:35 AM
  > Subject: XML output, I need help.
  >
  >
  > > Hi, guys,
  > >
  > > I tried to write a XML format output using JSP, while I remember to set
  > > contentType="text/xml" and write <?xml version="1.0" ?> in the head of
  > > output. Then browsing my JSP in IE 5. What I saw is just text while is
  > > outside of the tag, and the source is correct XML. How can I make IE
  > > defaultly render XML?
  > >
  > > By the way, <mime-mapping> has been set for XML.
  > >
  > > Thanks in advance.
  > >
  > > Juguang.
  > >
  > >
  > >
  > >
  > > --
  > > To unsubscribe:   <ma...@jakarta.apache.org>
  > > For additional commands: <ma...@jakarta.apache.org>
  > > Troubles with the list: <ma...@jakarta.apache.org>
  >
  >
  > _________________________________________________________
  > Do You Yahoo!?
  > Get your free @yahoo.com address at http://mail.yahoo.com
  >
  >
  > --
  > To unsubscribe:   <ma...@jakarta.apache.org>
  > For additional commands: <ma...@jakarta.apache.org>
  > Troubles with the list: <ma...@jakarta.apache.org>
  >


  --
  To unsubscribe:   <ma...@jakarta.apache.org>
  For additional commands: <ma...@jakarta.apache.org>
  Troubles with the list: <ma...@jakarta.apache.org>



Re: XML output, I need help.

Posted by Xiao Juguang <ju...@fugu-sg.org>.
Let me clarify that I generate a XML, not HTML,  format output by JSP.

IE should know the input is XML format, especially I specify the
contentType.

What is the problem? Is the problem on Tomcat side or IE side?

----- Original Message -----
From: "Neo Gigs" <gi...@yahoo.com>
To: "Tomcat Users List" <to...@jakarta.apache.org>
Sent: Wednesday, March 13, 2002 10:50 AM
Subject: Re: XML output, I need help.


> You should only display a XMl file by not running the XMl file, you need
> either a parser of some form of stylesheet like XSLT to embed the output
>
> ----- Original Message -----
> From: "Xiao Juguang" <ju...@fugu-sg.org>
> To: "Tomcat Users List" <to...@jakarta.apache.org>
> Sent: Wednesday, March 13, 2002 10:35 AM
> Subject: XML output, I need help.
>
>
> > Hi, guys,
> >
> > I tried to write a XML format output using JSP, while I remember to set
> > contentType="text/xml" and write <?xml version="1.0" ?> in the head of
> > output. Then browsing my JSP in IE 5. What I saw is just text while is
> > outside of the tag, and the source is correct XML. How can I make IE
> > defaultly render XML?
> >
> > By the way, <mime-mapping> has been set for XML.
> >
> > Thanks in advance.
> >
> > Juguang.
> >
> >
> >
> >
> > --
> > To unsubscribe:   <ma...@jakarta.apache.org>
> > For additional commands: <ma...@jakarta.apache.org>
> > Troubles with the list: <ma...@jakarta.apache.org>
>
>
> _________________________________________________________
> Do You Yahoo!?
> Get your free @yahoo.com address at http://mail.yahoo.com
>
>
> --
> To unsubscribe:   <ma...@jakarta.apache.org>
> For additional commands: <ma...@jakarta.apache.org>
> Troubles with the list: <ma...@jakarta.apache.org>
>


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: XML output, I need help.

Posted by Neo Gigs <gi...@yahoo.com>.
You should only display a XMl file by not running the XMl file, you need
either a parser of some form of stylesheet like XSLT to embed the output

----- Original Message -----
From: "Xiao Juguang" <ju...@fugu-sg.org>
To: "Tomcat Users List" <to...@jakarta.apache.org>
Sent: Wednesday, March 13, 2002 10:35 AM
Subject: XML output, I need help.


> Hi, guys,
>
> I tried to write a XML format output using JSP, while I remember to set
> contentType="text/xml" and write <?xml version="1.0" ?> in the head of
> output. Then browsing my JSP in IE 5. What I saw is just text while is
> outside of the tag, and the source is correct XML. How can I make IE
> defaultly render XML?
>
> By the way, <mime-mapping> has been set for XML.
>
> Thanks in advance.
>
> Juguang.
>
>
>
>
> --
> To unsubscribe:   <ma...@jakarta.apache.org>
> For additional commands: <ma...@jakarta.apache.org>
> Troubles with the list: <ma...@jakarta.apache.org>


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


XML output, I need help.

Posted by Xiao Juguang <ju...@fugu-sg.org>.
Hi, guys,

I tried to write a XML format output using JSP, while I remember to set
contentType="text/xml" and write <?xml version="1.0" ?> in the head of
output. Then browsing my JSP in IE 5. What I saw is just text while is
outside of the tag, and the source is correct XML. How can I make IE
defaultly render XML?

By the way, <mime-mapping> has been set for XML.

Thanks in advance.

Juguang.




--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: Connection refuse

Posted by Jayson Yu <yu...@philonline.com>.
>public class TestTomcat extends Thread{
>
>  private static int request=0;
>
>  public void run() {
>   try{
>   String inputLine;
>   URL url = new 
> URL("http://localhost:8080/examples/servlet/TestTomcat?request=" + ++request);
>   URLConnection connection = url.openConnection();
>   connection.setDoOutput(true);
>   BufferedReader inp = new BufferedReader(
>     new InputStreamReader(
>     connection.getInputStream()));
>   while ((inputLine = inp.readLine()) != null)
>       System.out.println(inputLine);
>
>    inp.close();
>   }
>   catch(Exception e){}

System.out.println(e);

>   }
>
>
>     public static void main(String[] args) {
>
>   int m=0;
>  try{
>   for (int p=0;p<100;p++){
>    for(m=0;m<5;m++){
>     TestTomcat rg= new TestTomcat();
>     rg.start();
>    }
>    Thread.sleep(1000);
>   }
>  }
>  catch(Exception e){}

System.out.println(e);

>  }
>
>}


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>