hi renee,
 
this might not be a tomcat but an nt problem.
we experience similiar connection exceptions on our nt4.0 development
machine,
with both allaire jrun2.3.3 and sun jsdk (test) servlet engines.
 
matthias
 

-----Urspr�ngliche Nachricht-----
Von: Arion Yu [mailto:[EMAIL PROTECTED]]
Gesendet am: Samstag, 21. Oktober 2000 09:47
An: [EMAIL PROTECTED]
Betreff: Re: stopping tomcat when running it stand along
Absolutely correct. 

Arion 


Renee Petris wrote: 


 I am running tomcat standalone on WinNT 4.0. Following the instructions in
the user's guide, I removed the unneeded the unneeded Ajp12 connector. Now
my server.xml only contains:<Connector
className="org.apache.tomcat.service.SimpleTcpConnector"> 
            <Parameter 
                name="handler" 
 
value="org.apache.tomcat.service.http.HttpConnectionHandler"/> 
            <Parameter 
                name="port" 
                value="8080"/> 
        </Connector> 
However, when I go to shutdown tomcat, I get the following error:Stop tomcat

java.net.ConnectException: Connection refused: no further information 
        at java.net.PlainSocketImpl.socketConnect(Native Method) 
        at java.net.PlainSocketImpl.doConnect(Unknown Source) 
        at java.net.PlainSocketImpl.connectToAddress(Unknown Source) 
        at java.net.PlainSocketImpl.connect(Unknown Source) 
        at java.net.Socket.<init>(Unknown Source) 
        at java.net.Socket.<init>(Unknown Source) 
        at org.apache.tomcat.startup.Tomcat.stopTomcat(Tomcat.java:208) 
        at org.apache.tomcat.startup.Tomcat.execute(Tomcat.java:130) 
        at org.apache.tomcat.startup.Tomcat.main(Tomcat.java:163)I looked at
stopTomcat() method on Tomcat.java and this method seems to assume port 8007
and the Ajp12 connector:    /** Stop tomcat using the configured cm 
     *  The manager is set up using the same configuration file, so 
     *  it will have the same port as the original instance ( no need 
     *  for a "log" file). 
     *  It uses the Ajp12 connector, which has a built-in "stop" method, 
     *  that will change when we add real callbacks ( it's equivalent 
     *  with the previous RMI method from almost all points of view ) 
     */.... // Find Ajp12 connector 
 int portInt=8007; 
 Enumeration enum=cm.getConnectors(); 
 while( enum.hasMoreElements() ) { 
     Object con=enum.nextElement(); 
     if( con instanceof  TcpEndpointConnector ) { 
  TcpEndpointConnector tcpCon=(TcpEndpointConnector) con; 
  if( tcpCon.getTcpConnectionHandler()  instanceof Ajp12ConnectionHandler )
{ 
      portInt=tcpCon.getPort(); 
  } 
     } 
 }  // use Ajp12 to stop the server... 
 try { 
     Socket socket = new Socket("localhost", portInt); 
     OutputStream os=socket.getOutputStream(); 
     byte stopMessage[]=new byte[2]; 
     stopMessage[0]=(byte)254; 
     stopMessage[1]=(byte)15; 
     os.write( stopMessage ); 
     socket.close(); 
 } catch(Exception ex ) { 
     ex.printStackTrace(); 
 }Does this mean that I have to keep the Ajp12 connector in the server.xml
file to properly shutdown tomcat? 

Ren�e Petris 
Overseer of the Execution 
Loudeye Technologies 
[EMAIL PROTECTED] 
414 Olive Way, Suite 300 
Seattle, WA 98101 
206-832-4500 phone 
206-832-4475 fax 

-- 
[This email and any files transmitted with it are confidential and may
contain information that is legally privileged. They are intended solely for
the addressee(s). Access to this email by anyone else is unauthorized. If
you are not the intended recipient, please delete it and notify the sender
by email immediately; you should not copy or use it for any purpose, nor
disclose its contents to any other person. Thank you.] 
  

Reply via email to