Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Linux Archive
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-23-2007, 04:04 AM
Member
 
Join Date: Jul 2007
Posts: 4
tamayo is on a distinguished road
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

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 10:22 AM. Reason: Code placed inside [code] tag
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 07-23-2007, 10:23 AM
JavaBean's Avatar
Moderator
 
Join Date: May 2007
Posts: 1,272
JavaBean is on a distinguished road
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.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
could not be found in the registry alam99 Eclipse 0 01-08-2008 10:21 AM
404 Not Found mary Java Servlet 5 11-07-2007 12:15 PM
Exception in thread "main" java.net.ConnectException: Connection timed out osval Advanced Java 1 07-28-2007 12:59 AM
java.net.ConnectException: Connection refused Albert Advanced Java 2 07-03-2007 06:49 PM
Hibernate table not found orchid Database 2 05-06-2007 09:44 AM


All times are GMT +3. The time now is 10:56 AM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org