Results 1 to 2 of 2
  1. #1
    tamayo is offline Member
    Join Date
    Jul 2007
    Posts
    4
    Rep Power
    0

    Default ConnectException not found

    Hi, I´m writing a socket app, when I try to compile it, i obtained the error in the main "can´t find the symbol"
    Symbol: class ConnectException

    But i don't get why I obtained that error, because when I define the socket it does not problem with that, so here is my code:

    Thanks for your help

    Java Code:
    //THESE ARE MY IMPORTS
    
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.io.*;
    import javax.net.*;
    import java.net.Socket;
    
    public class sslcliente extends JFrame {
    	
    	//declarando variables
    
        Sesion sesion; //incluir este hilo
    	PrintStream prntextofuera;
    	BufferedReader rdrtextodentro;
    	Socket sktcliente;	
                .....
    
    	public sslcliente ()
    	
    	{
    		
    		super ("sslcliente");
    		sktcliente=new Socket("localhost", 9000); //parametrizar
    		prntextofuera=new PrintStream(sktcliente.getOutputStream());
    		rdrtextodentro=new BufferedReader(new InputStreamReader(sktcliente.getInputStream()));
    		sesion=new Sesion(this);
    		sesion.start();
                     ....
               }//end of sscliente function
    
    
    
    //THIS IS MY MAIN:
    	public static void main(String[] args) throws IOException, ConnectException{
    		try{
    		sslcliente xcliente = new sslcliente();
    		xcliente.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    		}//fin de try
    		catch(Exception e){
    			JOptionPane.showMessageDialog(null,"Error al conectarse");
    			System.exit(0);
    		}//fin de catch
    	}//fin de del metodo main
    
    }//end of sslcliente jframe
    Last edited by JavaBean; 07-23-2007 at 08:22 AM. Reason: Code placed inside [code] tag

  2. #2
    JavaBean's Avatar
    JavaBean is offline Moderator
    Join Date
    May 2007
    Posts
    1,270
    Rep Power
    10

    Default

    Your main method throws ConnectException and it is not part of standard Java library. You need to place it to the same package of this class.

Similar Threads

  1. could not be found in the registry
    By alam99 in forum Eclipse
    Replies: 0
    Last Post: 01-08-2008, 08:21 AM
  2. 404 Not Found
    By mary in forum Java Servlet
    Replies: 5
    Last Post: 11-07-2007, 10:15 AM
  3. Replies: 1
    Last Post: 07-27-2007, 10:59 PM
  4. java.net.ConnectException: Connection refused
    By Albert in forum Advanced Java
    Replies: 2
    Last Post: 07-03-2007, 04:49 PM
  5. Hibernate table not found
    By orchid in forum JDBC
    Replies: 2
    Last Post: 05-06-2007, 07:44 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •